summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-06-05 11:18:10 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-06-05 11:18:10 -0600
commit24efe49bc2b545e3a3e46d7d6f2bd1166163e52b (patch)
treec1852447d06c062052def6fc89be2e2dece17c78 /index.php
parent45acfc48b3dd80b945a1501edea9ad4faa700c0f (diff)
Move object related functions into their classes.
Some of the pages are still broken from this commit, but I plan to either rewrite or ignore them.
Diffstat (limited to 'index.php')
-rw-r--r--index.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/index.php b/index.php
index 9d62f52..dadef39 100644
--- a/index.php
+++ b/index.php
@@ -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 {