diff options
author | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 19:40:50 -0600 |
---|---|---|
committer | cflip <36554078+cflip@users.noreply.github.com> | 2021-04-24 19:40:50 -0600 |
commit | 2098bf444afadcf0363d89b4cc1dca5d2213d754 (patch) | |
tree | da93b29e22170d7be7c9ed215fde5238e9d76178 /viewcategory.php | |
parent | aae25cd709d486f7ee9513753d40eb5cc239c42d (diff) |
Remove all uses of db_inc.php
This method of importing the database login every time wasn't very good.
Now everything uses the new Database singleton class.
Diffstat (limited to 'viewcategory.php')
-rw-r--r-- | viewcategory.php | 12 |
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>'; |