findByPostId($postId); if (is_null($forum)) { error(404); } if (!isset($_GET['threadid'])) { header("Location: forums.php?action=viewthread&threadid=" . $forum->findThreadIdByPostId($postId) . "&postid=$postId#post$postId" ); exit; } $threadId = $forum->findThreadIdByPostId($postId); } elseif (isset($_GET['threadid'])) { $postId = false; $threadId = (int)$_GET['threadid']; $forum = $forumMan->findByThreadId($threadId); if (is_null($forum)) { error(404); } } else { error(404); } $forumId = $forum->id(); $threadInfo = $forum->threadInfo($threadId); if (empty($threadInfo)) { error(404); } $user = new Gazelle\User($LoggedUser['ID']); if (!$user->readAccess($forum)) { error(403); } //Escape strings for later display $threadTitle = display_str($threadInfo['Title']); $ForumName = display_str($Forums[$forumId]['Name']); $IsDonorForum = ($forumId == DONOR_FORUM); $PerPage = $LoggedUser['PostsPerPage'] ?? POSTS_PER_PAGE; //Post links utilize the catalogue & key params to prevent issues with custom posts per page if ($threadInfo['Posts'] <= $PerPage) { $PostNum = 1; } else { if (isset($_GET['post'])) { $PostNum = (int)($_GET['post'] ?? 1); } elseif ($postId && $postId != $threadInfo['StickyPostID']) { $PostNum = $forum->threadNumPosts($threadId, $postId, $threadInfo['StickyPostID'] < $postId); } else { $PostNum = 1; } } [$Page] = Format::page_limit($PerPage, min($threadInfo['Posts'], $PostNum)); if (($Page - 1) * $PerPage > $threadInfo['Posts']) { $Page = (int)ceil($threadInfo['Posts'] / $PerPage); } $Catalogue = $forum->threadCatalog($threadId, $PerPage, $Page, THREAD_CATALOGUE); $thread = array_slice($Catalogue, (($Page - 1) * $PerPage) % THREAD_CATALOGUE, $PerPage, true); $FirstPost = current($thread)['ID']; $LastPost = end($thread)['ID']; if ($threadInfo['Posts'] <= $PerPage * $Page && $threadInfo['StickyPostID'] > $LastPost) { $LastPost = $threadInfo['StickyPostID']; } //Handle last read if (!$threadInfo['isLocked'] || $threadInfo['isSticky']) { $lastRead = $forum->userLastReadPost($user->id(), $threadId); if ($lastRead < $LastPost) { $forum->userCatchupThread($user->id(), $threadId, $LastPost); } } $isSubscribed = (new Gazelle\Manager\Subscription($user->id()))->isSubscribed($threadId); if ($isSubscribed) { $Cache->delete_value('subscriptions_user_new_'.$user->id()); } $QuoteNotificationsCount = $Cache->get_value('notify_quoted_' . $user->id()); if ($QuoteNotificationsCount === false || $QuoteNotificationsCount > 0) { (new Gazelle\User\Quote($user))->clearThread($threadId, $FirstPost, $LastPost); } $Pages = Format::get_pages($Page, $threadInfo['Posts'], $PerPage, 9); $transitions = Forums::get_thread_transitions($forumId); $auth = $LoggedUser['AuthKey']; View::show_header("Forums › $ForumName › " . display_str($threadInfo['Title']), 'comments,subscriptions,bbcode', $IsDonorForum ? ',donor' : ''); ?>

Forums › ›

Move thread
pollData($threadId); if (!empty($Votes)) { $TotalVotes = array_sum($Votes); $MaxVotes = max($Votes); } else { $TotalVotes = 0; $MaxVotes = 0; } $RevealVoters = in_array($forumId, $ForumsRevealVoters); //Polls lose the you voted arrow thingy $UserResponse = $DB->scalar(" SELECT Vote FROM forums_polls_votes WHERE UserID = ? AND TopicID = ? ", $user->id(), $threadId ); if ($UserResponse > 0) { $Answers[$UserResponse] = '» '.$Answers[$UserResponse]; } else { if (!empty($UserResponse) && $RevealVoters) { $Answers[$UserResponse] = '» '.$Answers[$UserResponse]; } } ?>
Poll View

    $Answer) { if (!empty($Votes[$i]) && $TotalVotes > 0) { $Ratio = $Votes[$i] / $MaxVotes; $Percent = $Votes[$i] / $TotalVotes; } else { $Ratio = 0; $Percent = 0; } ?>
  • (%)
  • 0) { ?>
  • (Blank) (%)

Votes:

prepared_query(" SELECT fpv.Vote AS Vote, GROUP_CONCAT(um.Username SEPARATOR ', ') FROM users_main AS um LEFT JOIN forums_polls_votes AS fpv ON (um.ID = fpv.UserID) WHERE TopicID = ? GROUP BY fpv.Vote ", $threadId ); $StaffVotesTmp = $DB->to_array(); $StaffCount = count($StaffNames); $StaffVotes = []; foreach ($StaffVotesTmp as $StaffVote) { [$Vote, $Names] = $StaffVote; $StaffVotes[$Vote] = $Names; $Names = explode(', ', $Names); $StaffNames = array_diff($StaffNames, $Names); } ?>
    $Answer) { ?>
  • -  (%) X
  • Blank -  (%)

Votes: / current staff, total
Missing votes:

+
    $Answer) { ?>


+

$Post) { [$PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime] = array_values($Post); [$AuthorID, $Username, $PermissionID, $Paranoia, $Donor, $Warned, $Avatar, $Enabled, $UserTitle] = array_values(Users::user_info($AuthorID)); $tableClass = ['forum_post', 'wrap_overflow', 'box vertical_margin']; if (((!$threadInfo['isLocked'] || $threadInfo['isSticky']) && $PostID > $lastRead && strtotime($AddedTime) > $user->forumCatchupEpoch() ) || (isset($RequestKey) && $Key == $RequestKey) ) { $tableClass[] = 'forum_unread'; } if (!Users::has_avatars_enabled()) { $tableClass[] = 'noavatar'; } if ($threadInfo['AuthorID'] == $AuthorID) { $tableClass[] = 'important_user'; } if ($PostID == $threadInfo['StickyPostID']) { $tableClass[] = 'sticky_post'; } ?>
# - Quote id()) || check_perms('site_moderate_forums')) { ?> - Edit 1) { ?> - Delete - X - 📌 Report id()) { $AuthorInfo = Users::user_info($AuthorID); if ($LoggedUser['Class'] >= $AuthorInfo['Class']) { ?> - Warn   ↑
>


« Last edited by
'Post reply', 'InputName' => 'thread', 'InputID' => $threadId, 'ForumID' => $forumId, 'TextareaCols' => 90 ]); } } if (count($transitions) > 0 && !check_perms('site_moderate_forums')) { ?>
Move thread
threadNotes($threadId); ?>

Thread notes

Toggle

Edit thread

> 0) { ?>
tabindex="4" />
tabindex="6" />