diff options
author | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-20 01:15:15 +0200 |
---|---|---|
committer | Minteck <46352972+Minteck@users.noreply.github.com> | 2021-07-20 01:15:15 +0200 |
commit | af9e5ef458b93ef2003905e1ccc5665e7266c242 (patch) | |
tree | 989ac25a8b75578788cd7157308f37b9b83cf8f5 /includes/blog/list.php | |
download | main-af9e5ef458b93ef2003905e1ccc5665e7266c242.tar.gz main-af9e5ef458b93ef2003905e1ccc5665e7266c242.tar.bz2 main-af9e5ef458b93ef2003905e1ccc5665e7266c242.zip |
Commit
Diffstat (limited to 'includes/blog/list.php')
-rw-r--r-- | includes/blog/list.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/blog/list.php b/includes/blog/list.php new file mode 100644 index 0000000..5166966 --- /dev/null +++ b/includes/blog/list.php @@ -0,0 +1,14 @@ +<div class="list-group"> + <?php + + $articles = scandir($_SERVER['DOCUMENT_ROOT'] . "/includes/blog/data"); + $i = 1; + 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"><?= DateTime::createFromFormat('Y-m-d', explode("@", $article)[0])->format("F jS, Y"); ?></span> ยท <?= $data["title"] ?></a> + <?php endif;$i++; ?> + <?php endforeach; ?> +</div>
\ No newline at end of file |