aboutsummaryrefslogtreecommitdiff
path: root/_site/rewrites
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-07-01 00:54:32 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-07-01 00:54:32 +0200
commit1d62401c897a5ba82d0def92d97d09195a6d676f (patch)
treed26f11765a4eee20ac4867d5b77794fcdcaac641 /_site/rewrites
parent1f23d65f32e37d0c6d703951d6735c9926f8521c (diff)
downloadunchainedtech-1d62401c897a5ba82d0def92d97d09195a6d676f.tar.gz
unchainedtech-1d62401c897a5ba82d0def92d97d09195a6d676f.tar.bz2
unchainedtech-1d62401c897a5ba82d0def92d97d09195a6d676f.zip
Fixed stuff + official logo
Diffstat (limited to '_site/rewrites')
-rw-r--r--_site/rewrites/admin-article.php71
-rw-r--r--_site/rewrites/article.php1
2 files changed, 72 insertions, 0 deletions
diff --git a/_site/rewrites/admin-article.php b/_site/rewrites/admin-article.php
new file mode 100644
index 0000000..a8a7813
--- /dev/null
+++ b/_site/rewrites/admin-article.php
@@ -0,0 +1,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"; ?> \ No newline at end of file
diff --git a/_site/rewrites/article.php b/_site/rewrites/article.php
index 69a3014..aa858c9 100644
--- a/_site/rewrites/article.php
+++ b/_site/rewrites/article.php
@@ -22,6 +22,7 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/articles/getlist.php";
$list = getArticlesList(false);
$item = $list[$_GET['i']];
+$_DESCRIPTION = str_replace("\n", " ", str_replace("\"", "“", $item["content"]["little"]));
$_TITLE = $item["title"];
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/dom/header.php";