From 442022125d9e843b10a3e36167e422d0becb5788 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Thu, 8 Apr 2021 14:22:06 -0600 Subject: Fix quote links --- model/Post.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'model/Post.php') diff --git a/model/Post.php b/model/Post.php index 308b5ac..5d85f20 100644 --- a/model/Post.php +++ b/model/Post.php @@ -5,7 +5,7 @@ include_once 'Thread.php'; function add_quote($dbc, $thread_id, $matches) { foreach ($matches as $match) { $id = (int) filter_var($match, FILTER_SANITIZE_NUMBER_INT); - $sql = "SELECT post_content, post_author, user_name FROM posts LEFT JOIN users ON post_author = user_id WHERE post_id = " . $id; + $sql = "SELECT post_content, post_author, post_thread, user_name FROM posts LEFT JOIN users ON post_author = user_id WHERE post_id = " . $id; $result = mysqli_query($dbc, $sql); if (!$result) { @@ -18,9 +18,7 @@ function add_quote($dbc, $thread_id, $matches) { return '
This post has been deleted
'; } - $id = $id + 1; - - return '
Quote from ' . $reply['user_name'] . '
' . $reply['post_content'] . '
'; + return '
Quote from ' . $reply['user_name'] . '
' . $reply['post_content'] . '
'; } } @@ -59,7 +57,7 @@ class Post { } function display_content($dbc) { - echo '
#' . $this->id . ''; + echo '
#' . $this->id . ''; echo ' Posted by ' . $this->author->name . ''; echo ' on ' . date('m/d/Y g:ia', strtotime($this->date)); if (isset($_SESSION['signed_in']) && $_SESSION['user_id'] == $this->author->id) { -- cgit v1.2.3