summaryrefslogtreecommitdiff
path: root/category.php
diff options
context:
space:
mode:
Diffstat (limited to 'category.php')
-rw-r--r--category.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/category.php b/category.php
index f5cf9cb..b26856a 100644
--- a/category.php
+++ b/category.php
@@ -27,7 +27,7 @@ mysqli_free_result($result);
echo '</section>';
-$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";
+$sql = "SELECT thread_id, thread_subject, thread_date, user_id, 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) {
@@ -52,7 +52,9 @@ while ($row = mysqli_fetch_assoc($result)) {
echo '<tr><td class="left">';
echo '<h4><a href="thread.php?id=' . $row['thread_id'] . '">' . $row['thread_subject'] . '</a></h4>';
- echo '<small>by <b>' . $row['user_name'] . '</b> on ' . date('M d, Y', strtotime($row['thread_date'])) . '</small></td><td class="right">by <b>' . $thread['user_name'] . '</b><br><small>' . date('m/d/Y g:ia', strtotime($thread['post_date'])) . '</small></td></tr>';
+ echo '<small>by <b><a href="user.php?id=' . $row['user_id'] . '">' . $row['user_name'] . '</a></b> on ' . date('M d, Y', strtotime($row['thread_date'])) . '</small>';
+ echo '</td><td class="right">by <b><a href="user.php?id=' . $row['user_id'] . '">' . $thread['user_name'] . '</a></b><br>';
+ echo '<small>' . date('m/d/Y g:ia', strtotime($thread['post_date'])) . '</small></td></tr>';
}
mysqli_stmt_close($stmt);