}
    } else {
        if ($action == 'delete-topic') {
            // Delete Pending Topics
            //Getting Ids
            $topicIds = isset($_POST['tid']) ? $_POST['tid'] : null;
            if (!$topicIds) {
                buckys_redirect('/forum/pending_topcis.php', MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
            }
            $result = BuckysForumTopic::deletePendingTopics($topicIds);
            if ($result === true) {
                buckys_redirect('/forum/pending_topics.php', MSG_TOPIC_REMOVED_SUCCESSFULLY);
            } else {
                buckys_redirect('/forum/pending_topics.php', $result, MSG_TYPE_ERROR);
            }
        }
    }
}
//Getting Pending Topics
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$total = BuckysForumTopic::getTotalNumOfTopics('pending');
$pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$topics = BuckysForumTopic::getTopics($page, 'pending', null, null, BuckysForumTopic::$COUNT_PER_PAGE);
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/pending_topics';
$TNB_GLOBALS['title'] = 'Pending Topics - thenewboston Forum';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
Example #2
0
<?php

require dirname(__FILE__) . '/includes/bootstrap.php';
$userID = buckys_is_logged_in();
$popularImages = BuckysPost::getPostsFromStats('image');
$popularPosts = BuckysPost::getPostsFromStats('text');
$popularVideos = BuckysPost::getPostsFromStats('video');
$popularPages = BuckysPage::getPopularPagesForHomepage();
$recentTopics = BuckysForumTopic::getTopics(1, 'publish', null, 'lastReplyDate DESC, t.createdDate DESC', 5);
$recentTradeItems = BuckysTradeItem::getRecentItems(3);
buckys_enqueue_stylesheet('index.css');
$BUCKYS_GLOBALS['content'] = "home";
$BUCKYS_GLOBALS['title'] = "BuckysRoom - The Worlds Most Popular Open Source Social Network";
require DIR_FS_TEMPLATE . $BUCKYS_GLOBALS['template'] . "/" . $BUCKYS_GLOBALS['layout'] . ".php";
}
//Getting Topics by category id
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'recent';
switch ($orderby) {
    case 'recent':
        $orderbyString = 'lastReplyDate DESC';
        break;
    case 'rating':
        $orderbyString = 't.votes DESC';
        break;
    case 'replies':
        $orderbyString = 't.replies DESC';
        break;
}
$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'], $orderbyString, BuckysForumTopic::$COUNT_PER_PAGE);
$hierarchical = BuckysForumCategory::getCategoryHierarchical($category['categoryID']);
//Mark Forum Notifications to read
if (buckys_check_user_acl(USER_ACL_REGISTERED)) {
    BuckysForumNotification::makeNotificationsToRead($TNB_GLOBALS['user']['userID'], $category['categoryID']);
}
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/category';
$TNB_GLOBALS['title'] = $category['categoryName'] . ' - thenewboston Forum';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
<?php

require_once dirname(dirname(__FILE__)) . '/includes/bootstrap.php';
//Getting Topics by category id
$page = isset($_GET['page']) ? $_GET['page'] : 1;
$total = BuckysForumTopic::getTotalNumOfTopics('publish');
$pagination = new Pagination($total, BuckysForumTopic::$COUNT_PER_PAGE, $page);
$page = $pagination->getCurrentPage();
$topics = BuckysForumTopic::getTopics($page, 'publish', null, 'lastReplyDate DESC, t.createdDate DESC', BuckysForumTopic::$COUNT_PER_PAGE);
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/recent_activity';
$TNB_GLOBALS['title'] = 'Recent Activity - thenewboston Forum';
require DIR_FS_TEMPLATE . $TNB_GLOBALS['template'] . "/" . $TNB_GLOBALS['layout'] . ".php";
if ($videoID) {
    $video = $videoClass->getVideo($videoID);
    if (!$video) {
        buckys_redirect("/videos.php", MSG_INVALID_REQUEST, MSG_TYPE_ERROR);
        exit;
    }
    $categoryID = $video['categoryID'];
}
if ($categoryID) {
    $category = $videoClass->getCategory($categoryID);
    $categoryVideos = $videoClass->getVideos($categoryID);
    if (!$videoID) {
        $video = $categoryVideos[0];
    }
    //Getting Forum Recent Posts
    $topics = BuckysForumTopic::getTopics(1, 'publish', $category['forumCategoryID'], 'lastReplyDate DESC', 10);
    $forumCategory = BuckysForumCategory::getCategory($category['forumCategoryID']);
    //Get Prev, Next Video
    $prevVideoId = null;
    $nextVideoId = null;
    foreach ($categoryVideos as $idx => $v) {
        if ($v['videoID'] == $video['videoID']) {
            $nextVideoId = isset($categoryVideos[$idx + 1]) ? $categoryVideos[$idx + 1]['videoID'] : null;
            break;
        }
        $prevVideoId = $v['videoID'];
    }
    $subjectID = $category['subjectID'];
}
$videoSubject = $videoClass->getSubject($subjectID);
$videoCategories = $videoClass->getVideoCategories($subjectID);
Example #6
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";