From d55089758306fd078a00d2a6d9d0fafc14a0edcf Mon Sep 17 00:00:00 2001 From: Cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 23 Jan 2021 21:39:56 -0700 Subject: Implement latest post/thread columns --- category.php | 22 ++++++++++++++++++---- index.php | 23 +++++++++++++++++++---- 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/category.php b/category.php index fcc7851..f5cf9cb 100644 --- a/category.php +++ b/category.php @@ -27,23 +27,37 @@ mysqli_free_result($result); echo ''; -$sql = "SELECT thread_id, thread_subject, thread_date, user_name FROM threads LEFT JOIN users ON thread_author = user_id WHERE thread_cat = " . mysqli_real_escape_string($dbc, $_GET['id']) . " ORDER BY thread_id DESC"; +$sql = "SELECT thread_id, thread_subject, thread_date, user_name FROM threads JOIN users ON thread_author = user_id WHERE thread_cat = " . mysqli_real_escape_string($dbc, $_GET['id']) . " ORDER BY thread_id DESC"; $result = mysqli_query($dbc, $sql); if (!$result) { die('Error trying to display threads: ' . mysqli_error($dbc)); } -// Display table of posts - echo '
Thread | Latest Post |
---|---|
';
echo '' . $row['thread_subject'] . ''; - echo 'by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['thread_date'])) . ' | by cflip 01-22-2021 9:34 | by ' . $thread['user_name'] . ' ' . date('m/d/Y g:ia', strtotime($thread['post_date'])) . ' | ';
}
+mysqli_stmt_close($stmt);
+mysqli_free_result($result);
+
echo '
Latest Threads | -Latest Post | +Categories | ';
echo '' . $row['thread_subject'] . ''; - echo 'by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['thread_date'])) . ' | by cflip 01-22-2021 9:34 | ';
+ echo 'by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['thread_date'])) . 'Posted in ' . $row['cat_name'] .' | '; } mysqli_free_result($result); -- cgit v1.2.3
---|