summaryrefslogtreecommitdiff
path: root/viewcategory.php
diff options
context:
space:
mode:
Diffstat (limited to 'viewcategory.php')
-rw-r--r--viewcategory.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/viewcategory.php b/viewcategory.php
index 70733da..852148b 100644
--- a/viewcategory.php
+++ b/viewcategory.php
@@ -1,6 +1,6 @@
<?php
-include('includes/db_inc.php');
-include('includes/model/Category.php');
+
+include_once 'includes/model/Category.php';
session_start();
@@ -11,8 +11,8 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
include('includes/templates/404.php');
die();
} else {
- $result = $current->get_from_database($_GET['id'], $dbc);
- if ($result == 0) {
+ $result = $current->get_from_database($_GET['id']);
+ if (!$result) {
http_response_code(404);
include('includes/templates/404.php');
die();
@@ -37,10 +37,10 @@ if (!isset($_GET['id']) || !filter_var($_GET['id'], FILTER_VALIDATE_INT)) {
<th>Latest Post</th>
</tr>
<?php
- $threads = $current->get_threads($dbc);
+ $threads = $current->get_threads();
foreach ($threads as $thread) {
- $latest_post = $thread->get_latest_post($dbc);
+ $latest_post = $thread->get_latest_post();
echo '<tr>';
echo '<td><b><a href="viewthread.php?id=' . $thread->id . '">' . $thread->subject . '</a></b>';