From 279d399461e6a66157bb2f0bc8209bf0fcb36c9c Mon Sep 17 00:00:00 2001 From: Cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 23 Jan 2021 12:25:51 -0700 Subject: Change terminology from topics to threads --- thread.php | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 thread.php (limited to 'thread.php') diff --git a/thread.php b/thread.php new file mode 100644 index 0000000..52ad8b3 --- /dev/null +++ b/thread.php @@ -0,0 +1,67 @@ + + +

' . $row['thread_subject'] . '

'; + echo 'Created by ' . $row['user_name'] . ' on ' . date('M d, Y', strtotime($row['thread_date'])) . ''; + $thread_id = $row['thread_id']; + } +} + +echo ''; + +mysqli_free_result($result); + +$sql = "SELECT post_content, post_date, post_author, user_id, user_name FROM posts LEFT JOIN users ON post_author = user_id WHERE post_thread = " . mysqli_real_escape_string($dbc, $_GET['id']); +$result = mysqli_query($dbc, $sql); + +if (!$result) { + die('Error trying to display posts: ' . mysqli_error($dbc)); +} + +if (mysqli_num_rows($result) == 0) { + echo '
This thread has no posts
'; +} else { + echo ''; + while ($row = mysqli_fetch_assoc($result)) { + echo ''; + echo ''; + } + echo '
Posted by ' . $row['user_name'] . '
' . date('m/d/Y g:ia', strtotime($row['post_date'])) . '
' . $row['post_content'] . '
'; +} + +mysqli_free_result($result); + +if (isset($_SESSION['signed_in'])) { + echo ' +
+
+

Reply to this thread

+ +
+ +
+
+ '; +} else { + echo ' +
+ Sign in to reply to this thread +
+ '; +} + +include_once 'footer.php'; +?> \ No newline at end of file -- cgit v1.2.3