Ejemplo n.º 1
0
    }
}
$topicID = isset($_GET['id']) ? buckys_escape_query_integer($_GET['id']) : 0;
$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');
Ejemplo n.º 2
0
                </div>
                <a href="index.php"><img src="/images/mainLogoTrade.png"></a>
            </header>
        <?php 
            break;
        case 'forum':
            ?>
            <header id="main_header">
                <div id="rightAlignLinks">                          
                <?php 
            if (buckys_check_user_acl(USER_ACL_ADMINISTRATOR) || BuckysModerator::isModerator($BUCKYS_GLOBALS['user']['userID'], MODERATOR_FOR_FORUM)) {
                ?>
                
                <?php 
                $pendingTopics = BuckysForumTopic::getTotalNumOfTopics('pending');
                $pendingReplies = BuckysForumReply::getTotalNumOfReplies(null, 'pending');
                ?>
                    <?php 
                if ($pendingTopics > 0) {
                    ?>
                    <a href="/forum/pending_topics.php" class="headerLinksBold">Pending Topics (<?php 
                    echo $pendingTopics;
                    ?>
)</a> |
                    <?php 
                }
                ?>
                    <?php 
                if ($pendingReplies > 0) {
                    ?>
                    <a href="/forum/pending_replies.php" class="headerLinksBold">Pending Replies (<?php