$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');
buckys_enqueue_stylesheet('forum.css');
buckys_enqueue_stylesheet('publisher.css');
buckys_enqueue_stylesheet('uploadify.css');
$TNB_GLOBALS['headerType'] = 'forum';
    echo MSG_INVALID_REQUEST;
    exit;
}
$notificationLimit = 5;
//This module will make the notifications as read.
$result = ['success' => 1, 'content' => ''];
$type = isset($_REQUEST['type']) ? strtolower($_REQUEST['type']) : null;
if (isset($_POST['action']) && $_POST['action'] == 'read') {
    switch ($type) {
        case 'my':
            BuckysActivity::markReadNotifications($userID);
            $notiData = BuckysActivity::getNotifications($userID, $notificationLimit, 0);
            $result['content'] = render_footer_link_content($type, $notiData, false);
            break;
        case 'forum':
            BuckysForumNotification::makeNotificationsToRead($userID);
            $notiData = BuckysForumNotification::getNewNotifications($userID, 0, $notificationLimit);
            $result['content'] = render_footer_link_content($type, $notiData, false);
            break;
        case 'trade':
            $tradeNotiIns = new BuckysTradeNotification();
            $tradeNotiIns->markAsRead($userID);
            $notiData = $tradeNotiIns->getReceivedMessages($userID, null, 0, $notificationLimit);
            $result['content'] = render_footer_link_content($type, $notiData, false);
            break;
        case 'shop':
            $shopNotiIns = new BuckysShopNotification();
            $shopNotiIns->markAsRead($userID);
            $notiData = $shopNotiIns->getReceivedMessages($userID, null, 0, $notificationLimit);
            $result['content'] = render_footer_link_content($type, $notiData, false);
            break;
<?php

require dirname(dirname(__FILE__)) . '/includes/bootstrap.php';
if (!buckys_check_user_acl(USER_ACL_REGISTERED)) {
    buckys_redirect('/forum');
}
$page = isset($_GET['page']) ? $_GET['page'] : 1;
//Getting Type
$listType = isset($_GET['type']) ? $_GET['type'] : 'all';
if (!in_array($listType, ['all', 'responded', 'started'])) {
    $listType = 'all';
}
$total = BuckysForumTopic::getTotalNumberOfMyPosts($TNB_GLOBALS['user']['userID'], $listType);
$pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$topics = BuckysForumTopic::getMyPosts($TNB_GLOBALS['user']['userID'], $listType, $page, BuckysForumTopic::$COUNT_PER_PAGE);
//Mark Forum Notifications to read
BuckysForumNotification::makeNotificationsToRead($TNB_GLOBALS['user']['userID']);
buckys_enqueue_javascript('jquery-migrate-1.2.0.js');
buckys_enqueue_stylesheet('forum.css');
buckys_enqueue_stylesheet('publisher.css');
$TNB_GLOBALS['headerType'] = 'forum';
$TNB_GLOBALS['content'] = 'forum/myposts';
$TNB_GLOBALS['title'] = 'Recent Activity - thenewboston Forum';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
Example #4
0
<?php

require dirname(dirname(__FILE__)) . '/includes/bootstrap.php';
$categoryID = isset($_GET['id']) ? $_GET['id'] : 0;
$category = BuckysForumCategory::getCategory($categoryID);
if (!$category) {
    buckys_redirect('/forum');
}
//Getting Topics by category id
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$total = BuckysForumTopic::getTotalNumOfTopics('publish', $category['categoryID']);
$pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$topics = BuckysForumTopic::getTopics($page, 'publish', $category['categoryID'], null, BuckysForumTopic::$COUNT_PER_PAGE);
$hierarchical = BuckysForumCategory::getCategoryHierarchical($category['categoryID']);
//Mark Forum Notifications to read
if (buckys_check_user_acl(USER_ACL_REGISTERED)) {
    BuckysForumNotification::makeNotificationsToRead($BUCKYS_GLOBALS['user']['userID'], $category['categoryID']);
}
buckys_enqueue_javascript('jquery-migrate-1.2.0.js');
buckys_enqueue_stylesheet('forum.css');
$BUCKYS_GLOBALS['headerType'] = 'forum';
$BUCKYS_GLOBALS['content'] = 'forum/category';
$BUCKYS_GLOBALS['title'] = $category['categoryName'] . ' - BuckysRoomForum';
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";