$topic = BuckysForumTopic::getTopic($topicID); if (!$topic) { buckys_redirect('/forum'); } $category = BuckysForumCategory::getCategory($topic['categoryID']); //If the topic is not published(pending or suspended), only forum moderator and administrator can see this if ($topic['status'] != 'publish' && !buckys_is_moderator() && $TNB_GLOBALS['user']['userID'] != $topic['creatorID']) { buckys_redirect('/forum'); } $orderBy = isset($_GET['orderby']) ? buckys_escape_query_string($_GET['orderby']) : 'oldest'; //Getting Replies $page = isset($_GET['page']) ? buckys_escape_query_integer($_GET['page']) : 1; $total = BuckysForumReply::getTotalNumOfReplies($topic['topicID'], 'publish'); $pagination = new Pagination($total, BuckysForumReply::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $replies = BuckysForumReply::getReplies($topic['topicID'], 'publish', $page, $orderBy); $hierarchical = BuckysForumCategory::getCategoryHierarchical($topic['categoryID']); //Mark Forum Notifications to read if (buckys_check_user_acl(USER_ACL_REGISTERED)) { BuckysForumNotification::makeNotificationsToRead($TNB_GLOBALS['user']['userID'], null, $topic['topicID']); } if (buckys_check_user_acl(USER_ACL_MODERATOR)) { $reportID = BuckysReport::isReported($topicID, 'topic'); $categories = BuckysForumCategory::getAllCategories(); } buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js'); buckys_enqueue_javascript('uploadify/jquery.uploadify.js'); buckys_enqueue_javascript('highlight.pack.js'); buckys_enqueue_javascript('forum.js'); buckys_enqueue_stylesheet('sceditor/themes/default.css'); buckys_enqueue_stylesheet('obsidian.css');
} else { if ($action == 'delete-reply') { // Delete Pending Topics //Getting Ids $replyIds = isset($_POST['rid']) ? $_POST['rid'] : null; if (!$replyIds) { buckys_redirect('/forum/pending_topcis.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $result = BuckysForumReply::deletePendingReplies($replyIds); if ($result === true) { buckys_redirect('/forum/pending_replies.php', MSG_REPLY_REMOVED_SUCCESSFULLY); } else { buckys_redirect('/forum/pending_replies.php', $result, MSG_TYPE_ERROR); } } } } //Getting Pending Topics $page = isset($_GET['page']) ? $_GET['page'] : 1; $total = BuckysForumReply::getTotalNumOfReplies(null, 'pending'); $pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page); $page = $pagination->getCurrentPage(); $replies = BuckysForumReply::getReplies(null, 'pending', $page); buckys_enqueue_javascript('prettyprint/run_prettify.js'); buckys_enqueue_javascript('jquery-migrate-1.2.0.js'); buckys_enqueue_stylesheet('forum.css'); buckys_enqueue_stylesheet('prettify.css'); $BUCKYS_GLOBALS['headerType'] = 'forum'; $BUCKYS_GLOBALS['content'] = 'forum/pending_replies'; $BUCKYS_GLOBALS['title'] = 'Pending Replies - BuckysRoomForum'; require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";