aboutsummaryrefslogtreecommitdiff
path: root/_site/rewrites/admin-article.php
blob: a8a7813d2675c542b6e9457d027cbd90dbdf8e2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php

if (!isset($_GET['i'])) {
    header("Location: /articles");
    die();
}

if (strpos($_GET['i'], "/") !== false && strpos($_GET['i'], ".") !== false && strpos($_GET['i'], "\\") !== false) {
    header("Location: /articles");
    die();
}

if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/../_posts/_drafts/" . $_GET['i'] . ".md") || !is_file($_SERVER['DOCUMENT_ROOT'] . "/../_posts/_drafts/" . $_GET['i'] . ".md")) {
    header("Location: /articles");
    die();
}

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/markdown.php";
$Parsedown = new Parsedown();

require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/articles/getlist.php";
$list = getArticlesList(false);
$item = $list[$_GET['i']];

$_TITLE = $item["title"];
$__ADMIN = true;
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/header.php";

?>

<div class="container" style="margin-top:30px;">
    <div class="card" style="margin-bottom:20px;">
        <div class="card-body">
            <h1><?= $_TITLE ?></h1>
            <p><b>Unreleased article</b>, by <?= implode(" and ", $item["author"]) ?></p>
        </div>
    </div>
</div>

<?php if (!is_null($item["cover"])): ?>
<header id="article-cover" style="background-image:url('<?= $item["cover"] ?>')"></header>
<?php endif; ?>

<div class="container" style="margin-top:15px;">
    <article>
        <?= $item["content"]["full"] ?>
    </article>
</div>

<div class="container">
    <div class="card">
        <div class="card-body" style="padding: .5rem;text-align: center">
            <small>
                <b>This article hasn't been released yet</b><br>
                This article is a work in progress. Unauthorized publishing or disclosure of this article without the consent of all the contributors will possibly lead to a ban.
            </small>
        </div>
    </div>
</div>

<style>
    body {
        filter: hue-rotate(-45deg);
    }

    .badge-secondary, .nav-admin, img:not(#siteicon), #article-cover, .admin-text {
        filter: hue-rotate(45deg);
    }
</style>

<?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/footer.php"; ?>