'; if (!isset($_GET['sort']) || $_GET['sort'] == 'newest') { $ids = article_ids_by_newest(); $filters .= '

Newest - Oldest

'; } else if ($_GET['sort'] == 'oldest') { $ids = article_ids_by_oldest(); $filters .= '

Oldest - Newest

'; } $filters .= '
'; echo '
' . $filters . '
'; foreach ($ids as $id) echo article_card($id); echo '
'; } else if (isset($_GET['article_id'])) { increment_read_counter($_GET['article_id']); echo article_page_from_markdown($_GET['article_id']); } else if (isset($_GET['author_id'])) { $ids = articles_ids_by_author($_GET['author_id']); foreach ($ids as $id) echo article_card($id); } else if (isset($_GET['tag'])) { $ids = article_ids_by_tag($_GET['tag']); foreach ($ids as $id) echo article_card($id); } include_once 'components/foot.php';