'; } $reply = mysqli_fetch_assoc($result); return '
Quote from ' . $reply['user_name'] . ''; } } $sql = "SELECT thread_id, thread_subject, thread_date, user_id, user_name FROM threads LEFT JOIN users ON thread_author = user_id WHERE thread_id = " . mysqli_real_escape_string($dbc, $_GET['id']); $result = mysqli_query($dbc, $sql); if (!$result) { die('Error trying to display thread page: ' . mysqli_error($dbc)); } if (mysqli_num_rows($result) == 0) { echo 'This thread does not exist'; } else { while ($row = mysqli_fetch_assoc($result)) { echo '
' . $reply['post_content'] . '
' . $post_index . ' | |
---|---|
Posted by ' . $row['user_name'] . ' ' . date('m/d/Y g:ia', strtotime($row['post_date'])) . ' | ';
$post_content = $row['post_content'];
$post_content = preg_replace_callback('/>#\d+/', function($matches) use($thread_id, $dbc) {
return add_quote($dbc, $thread_id, $matches);
}, $post_content);
echo '' . $post_content . ' |