diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-08 12:04:30 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-08 12:04:30 +0200 |
commit | 95112b1eb06a4be531ded59563d53a63a8d614e8 (patch) | |
tree | fd3dc676227309c87a39feab9ca458985e327907 /includes/blog/list.php | |
parent | 87303b0d3540037fb94efdde24dbaacb2880d6cb (diff) | |
download | main-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.gz main-95112b1eb06a4be531ded59563d53a63a8d614e8.tar.bz2 main-95112b1eb06a4be531ded59563d53a63a8d614e8.zip |
Opening!
Diffstat (limited to 'includes/blog/list.php')
-rw-r--r-- | includes/blog/list.php | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/includes/blog/list.php b/includes/blog/list.php index 1c81630..4777027 100644 --- a/includes/blog/list.php +++ b/includes/blog/list.php @@ -1,15 +1,15 @@ -<div class="list-group"> - <?php - - $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data"); - $i = 1; - $articles = array_reverse($articles); - foreach ($articles as $article): - - ?> - <?php if (strpos($article, "@") !== false && strpos($article, ".html") === false): ?> - <?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true); ?> - <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></span> · <?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></a> - <?php endif;$i++; ?> - <?php endforeach; ?> +<div class="list-group">
+ <?php
+
+ $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data");
+ $i = 1;
+ $articles = array_reverse($articles);
+ foreach ($articles as $article):
+
+ ?>
+ <?php if (strpos($article, "@") !== false && strpos($article, ".html") === false && file_exists($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . substr($article, 0, -5) . ".json.md")): ?>
+ <?php $data = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data/" . $article), true); ?>
+ <a href="/blog/article-<?= explode(".", $article)[0] ?>" class="list-group-item list-group-item-action"><span class="text-muted"><?= strftime(l("%a %b %e, %Y", "%a %e %b %Y"), (int)DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("U")); ?></span> · <?= l($data["title"], $data["title.fr"] ?? $data["title"]) ?></a>
+ <?php endif;$i++; ?>
+ <?php endforeach; ?>
</div>
\ No newline at end of file |