From de9bbfdb8f0d3b366e76a5cc775690f7315c740f Mon Sep 17 00:00:00 2001 From: 53hornet Date: Fri, 10 Dec 2021 23:17:42 -0500 Subject: feat: custom routing, no required php in posts --- feed.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'feed.php') diff --git a/feed.php b/feed.php index c8f51ef..f76377c 100644 --- a/feed.php +++ b/feed.php @@ -12,16 +12,14 @@ https://www.53hor.net !empty($post) && $post != '.' && $post != '..'); - foreach (array_reverse($posts) as $post) { - if (!empty($post) && $post != '.' && $post != '..') { - $post_name = explode('/', $post)[2]; - include($post); - printf('https://www.53hor.net/posts/%s%s', $post_name, $title); - } - } + foreach ($posts as &$post) { + $title = str_replace('

', '', fgets(fopen("./posts/$post", 'r'))); + $title = str_replace('

', '', $title); + $post = str_replace('.php', '', $post); + printf('https://www.53hor.net/posts/%s%s', $post, $title); } ?> -- cgit v1.2.3