aboutsummaryrefslogtreecommitdiff
path: root/blog/comment/submit.php
diff options
context:
space:
mode:
authorHannah Isopod <me@bathynomus.xyz>2025-06-11 03:25:00 -0600
committerHannah Isopod <me@bathynomus.xyz>2025-06-11 03:25:00 -0600
commitb3bb0b898d3178963fefb9c0b16a00a76cf2a034 (patch)
treeeec6da7a21790183b15f31283fe3b8bcaabfaa4d /blog/comment/submit.php
parent5023bdef46281034c0476bc4201342a0a4cc2ae7 (diff)
total guestbook overhaul + new blog post + etc
- Added /about/pronouns/ in leiu of something like a pronouns.cc profile - New blog post about my new and improved AI opinions - Moved Stop Using Chromium to an actual blog post page - Blog posts now have previous and next buttons - New /blog/ background - Moved status.cafe widget from /blog/ to landing page - Total overhaul of guestbook: - Merged guestbook and blog comment section code - Beefed up bot protection - Added a word filter - Added a property to entries to facilitate holding comments for review and approving or denying them manually (The interface for this is somewhere else) - IP address from which a post originates is now tracked in order to IP ban malicious actors - Various new buttons - Updated /greenhouse/ - The site is now a member of the No AI Webring - a couple minor CSS fixes
Diffstat (limited to 'blog/comment/submit.php')
-rw-r--r--blog/comment/submit.php81
1 files changed, 0 insertions, 81 deletions
diff --git a/blog/comment/submit.php b/blog/comment/submit.php
deleted file mode 100644
index 26e5647..0000000
--- a/blog/comment/submit.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
-
- $returnLocation = $_POST["entry"];
- $returnCode = "success";
- if($_POST["botcheck"] != "isopod") {
- $returnCode = "botcheckfailed";
- } else if(!$_POST["name"]) {
- $returnCode = "noname";
- } else if(!$_POST["message"]) {
- $returnCode = "nomessage";
- } else {
-
- date_default_timezone_set("America/Edmonton");
- $currentPost = array(
- "date" => time(),
- "name" => htmlentities($_POST["name"]),
- "message" => htmlentities($_POST["message"]),
- "entry" => $_POST["entry"]
- );
-
- $filename = "posts.json";
-
- $handle = @fopen($filename, 'r+');
-
- // create the file if needed
- if ($handle === null)
- {
- $handle = fopen($filename, 'w+');
- }
-
- if ($handle)
- {
- // seek to the end
- fseek($handle, 0, SEEK_END);
-
- // are we at the end of is the file empty
- if (ftell($handle) > 0)
- {
- // move back a byte
- fseek($handle, -2, SEEK_END);
-
- // add the trailing comma
- fwrite($handle, ",\n", 2);
-
- // add the new json string
- fwrite($handle, json_encode($currentPost) . "]\n");
- }
- else
- {
- // write the first event inside an array
- fwrite($handle, json_encode(array($currentPost)));
- }
-
- // close the handle on the file
- fclose($handle);
- }
- }
- }
- header("Location: ../posts/$returnLocation/?return=$returnCode");
-?>
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Guestbook</title>
- <link href="../style.css" rel="stylesheet" type="text/css" media="all">
- <style type="text/css">
- body {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- </style>
- <?php include($_SERVER['DOCUMENT_ROOT'] . '/seasonal.php'); ?>
- </head>
- <body>
- <p>Your post has been submitted! It's weird that you're seeing this page though. Maybe your browser can't process location headers? At any rate, click <?php echo "<a href='./?return=$returnCode'>here</a>"; ?> to get where you're supposed to be right now.</p>
- </body>
-</html> \ No newline at end of file