From 2098bf444afadcf0363d89b4cc1dca5d2213d754 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 24 Apr 2021 19:40:50 -0600 Subject: 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. --- viewthread.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'viewthread.php') diff --git a/viewthread.php b/viewthread.php index cc2d221..73a02ef 100644 --- a/viewthread.php +++ b/viewthread.php @@ -1,6 +1,5 @@ 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(); @@ -58,10 +58,12 @@ if (Session::get()->is_signed_in()) { ?>
get_posts($dbc); +include './includes/functions_post.php'; + +$posts = $current->get_posts(); foreach ($posts as $post) { - $post->display_content($dbc); + echo get_post_content($post); } ?>
-- cgit v1.2.3