summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorCflip <36554078+cflip@users.noreply.github.com>2021-01-24 13:46:28 -0700
committerCflip <36554078+cflip@users.noreply.github.com>2021-01-24 13:46:28 -0700
commit6500ec0543a316f9fa5f16a5c47e7103ec9bbe9e (patch)
tree57c252240cf9677b00053b411412d4f698f06a86 /index.php
parentd2909ea89f5cff052783006ee6596903e9881c73 (diff)
Add more links to user page
Diffstat (limited to 'index.php')
-rw-r--r--index.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/index.php b/index.php
index 2a1c633..fabec83 100644
--- a/index.php
+++ b/index.php
@@ -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);