From eb61c1bae2ffad114e17393d91d86fb00d7ac8cd Mon Sep 17 00:00:00 2001 From: Hannah Isopod Date: Sat, 10 May 2025 03:03:58 -0600 Subject: Initialer commit Just remade the repo because I don't *need* need a comprehensive source history for my personal website and this is easier than getting filter-repo to work good --- guestbook/feed.php | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 guestbook/feed.php (limited to 'guestbook/feed.php') diff --git a/guestbook/feed.php b/guestbook/feed.php new file mode 100644 index 0000000..7cdb62e --- /dev/null +++ b/guestbook/feed.php @@ -0,0 +1,47 @@ +'; +echo 'isopod.cool guestbook'; +echo 'The guestbook on isopod.cool'; +echo 'en-us'; +echo 'https://isopod.cool/guestbook/'; +echo 'My crappy PHP code'; + +$postlist = json_decode(file_get_contents("posts.json")); +$index = 1; +$totaloutput = ""; +foreach($postlist as $post) { + $output = ""; + $date = date("D, d M Y H:m:s", $post->date) . " GMT"; + $name = $post->name; + $message = $post->message; + $found = $post->found; + $website = $post->website; + $cool = $post->cool; + $coolsanitized = htmlentities(preg_replace("/https?:\/\//i", "", $cool)); + $reply = htmlentities($post->reply); + + if($website) { $output = $output."$name:

"; } + else { $output = $output.$name.":

"; } + + if($cool) { + $output = $output."cool thing: $coolsanitized

"; + } + + if($found) { + $output = $output."How did you find me?
$found

"; + } + + $output = $output.$message."

"; + + if($reply) { + $output = $output."
Reply:
$reply"; + } + $totaloutput = "Entry #" . $index . " - " . $name . "https://isopod.cool/guestbook/" . $date . "".htmlentities($output)."" . $index . $post->date . $name . "".$totaloutput; + $index++; +} + +echo $totaloutput; +echo "
"; \ No newline at end of file -- cgit v1.2.3