diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-03-24 18:29:41 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-03-24 18:29:41 -0600 |
commit | c9732788143886b611cb2fecfb53daf3d8add48f (patch) | |
tree | 8dd3152611bf59cc4982be9839e340ec89d0bee2 /index.php | |
parent | 9c619586639b9ac0f107e63a54b5522d75ea2ee2 (diff) |
Show latest thread/post on pages
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -38,6 +38,8 @@ usort($categories, "cmp"); foreach ($categories as $category) { + $latest_thread = $category->get_latest_thread($dbc); + echo '<tr>'; echo '<td>'; echo '<b><a href="category/' . $category->id . '">' . $category->name . '</a></b>'; @@ -45,7 +47,8 @@ echo '</td>'; echo '<td>' . $category->thread_count . '</td>'; echo '<td>' . $category->post_count . '</td>'; - echo '<td><b>my supercool thread</b><br><small>by <b>cflip</b>, 3 days ago</small></td>'; + echo '<td><b><a href="./thread/' . $latest_thread->id . '">' . $latest_thread->subject . '</a></b><br>'; + echo '<small>by <b><a href="./user/' . $latest_thread->author->name . '">' . $latest_thread->author->name . '</a></b>, ' . $latest_thread->date_created . '</small></td>'; echo '</tr>'; } ?> |