From d61a18a93bc1b39d91725497ebb2fe85c4785ead Mon Sep 17 00:00:00 2001
From: cflip <36554078+cflip@users.noreply.github.com>
Date: Wed, 7 Apr 2021 11:44:11 -0600
Subject: Update links, rename files
---
viewthread.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 viewthread.php
(limited to 'viewthread.php')
diff --git a/viewthread.php b/viewthread.php
new file mode 100644
index 0000000..f784e40
--- /dev/null
+++ b/viewthread.php
@@ -0,0 +1,70 @@
+get_from_database($_GET['id'], $dbc);
+ if ($result == 0) {
+ http_response_code(404);
+ include_once 'templates/404.php';
+ die();
+ }
+}
+?>
+
+
+
+ subject; ?> - cflip.net forum
+
+
+
+ subject; ?>
+ created by author->name; ?>
+ in category->name; ?>
+ 3 days ago
+
+ get_posts($dbc);
+
+ foreach ($posts as $post) {
+ $post->display_content();
+ }
+ ?>
+
+ Reply to this thread
+
+
+
+signed in to reply to this thread.';
+ return;
+ }
+
+ $post_content = filter_input(INPUT_POST, 'post_content', FILTER_SANITIZE_STRING);
+ $user_id = filter_var($_SESSION['user_id'], FILTER_SANITIZE_NUMBER_INT);
+
+ if (empty($post_content) or !$post_content) {
+ echo 'Thread subject cannot be empty';
+ } else {
+ insert_post($dbc, $post_content, $current->id, $user_id, $current->category->id);
+ }
+}
+
+?>
\ No newline at end of file
--
cgit v1.2.3