From 6c9369ad85f2fb3dc61234b54db7e7079cdc0c4e Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Fri, 23 Apr 2021 18:43:12 -0600 Subject: Refactoring part 1 --- viewthread.php | 60 +++++++++++++++++++++++++++------------------------------- 1 file changed, 28 insertions(+), 32 deletions(-) (limited to 'viewthread.php') diff --git a/viewthread.php b/viewthread.php index d41fb9b..ae08090 100644 --- a/viewthread.php +++ b/viewthread.php @@ -1,6 +1,6 @@ get_from_database($_GET['id'], $dbc); if ($result == 0) { http_response_code(404); - include_once 'templates/404.php'; + include('includes/templates/404.php'); die(); } } ?> - + - <?= $current->subject; ?> - cflip.net forum - + <?= $current->subject; ?> - cflip.net forum + - -

subject; ?>

- created by author->name; ?> - in category->name; ?> - 3 days ago + +

subject; ?>

+created by author->name; ?> +in category->name; ?> +3 days ago -
- get_posts($dbc); +
+get_posts($dbc); - foreach ($posts as $post) { - $post->display_content($dbc); - } - ?> -
-

Reply to this thread

-
- -
- -
+foreach ($posts as $post) { + $post->display_content($dbc); +} +?> +
+

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); @@ -93,5 +90,4 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') { insert_post($dbc, $post_content, $current->id, $user_id, $current->category->id); } } - ?> -- cgit v1.2.3