diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -27,10 +27,9 @@ <th>Latest Thread</th> </tr> <?php - include_once './includes/functions_category.php'; include_once './includes/model/Category.php'; - $categories = get_all_categories(); + $categories = Category::get_all_categories(); foreach ($categories as $category) { $latest_thread = $category->get_latest_thread(); @@ -42,7 +41,7 @@ echo '</td>'; echo '<td>' . $category->thread_count . '</td>'; echo '<td>' . $category->post_count . '</td>'; - if (!is_null($latest_thread)) { + if ($latest_thread->has_value()) { echo '<td><b><a href="viewthread.php?id=' . $latest_thread->id . '">' . $latest_thread->subject . '</a></b><br>'; echo '<small>by <b><a href="viewuser.php?id=' . $latest_thread->author->id . '">' . $latest_thread->author->name . '</a></b>, ' . $latest_thread->date_created . '</small></td>'; } else { |