diff options
author | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-24 13:46:28 -0700 |
---|---|---|
committer | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-24 13:46:28 -0700 |
commit | 6500ec0543a316f9fa5f16a5c47e7103ec9bbe9e (patch) | |
tree | 57c252240cf9677b00053b411412d4f698f06a86 /index.php | |
parent | d2909ea89f5cff052783006ee6596903e9881c73 (diff) |
Add more links to user page
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -43,7 +43,7 @@ include_once 'header.php'; echo $row['cat_description']; if ($thread) { echo '</td><td class="right">' . $thread['thread_subject'] . '<br>'; - echo '<small>by <b>' . $thread['user_name'] . '</b></small></td></tr>'; + echo '<small>by <b><a href="user.php?id=' . $thread['user_id'] . '">' . $thread['user_name'] . '</a></b></small></td></tr>'; } else { $no_threads_msg = 'There are no threads in this category yet.'; echo '</td><td class="right"><small>'. $no_threads_msg .'</small></td>'; @@ -62,7 +62,7 @@ include_once 'header.php'; <?php include_once 'includes/db_inc.php'; - $sql = "SELECT thread_id, thread_subject, thread_date, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id ORDER BY thread_id DESC LIMIT 5"; + $sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name, cat_id, cat_name FROM threads JOIN users ON thread_author = user_id JOIN categories ON thread_cat = cat_id ORDER BY thread_id DESC LIMIT 5"; $result = mysqli_query($dbc, $sql); if (!$result) { @@ -72,7 +72,7 @@ include_once 'header.php'; 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">Posted in <a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] .'</a></td></tr>'; + echo '<small>by <b><a href="user.php?id=' . $thread['user_id'] . '">' . $row['user_name'] . '</a></b> on ' . date('M d, Y', strtotime($row['thread_date'])) . '</small></td><td class="right">Posted in <a href="category.php?id=' . $row['cat_id'] . '">' . $row['cat_name'] .'</a></td></tr>'; } mysqli_free_result($result); |