summaryrefslogtreecommitdiff
path: root/viewthread.php
diff options
context:
space:
mode:
Diffstat (limited to 'viewthread.php')
-rw-r--r--viewthread.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/viewthread.php b/viewthread.php
index cc2d221..73a02ef 100644
--- a/viewthread.php
+++ b/viewthread.php
@@ -1,6 +1,5 @@
<?php
-include('includes/db_inc.php');
-include('includes/model/Thread.php');
+include_once 'includes/model/Thread.php';
session_start();
@@ -11,8 +10,9 @@ 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();
@@ -58,10 +58,12 @@ if (Session::get()->is_signed_in()) {
?>
<hr>
<?php
-$posts = $current->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);
}
?>
<hr>