if (isset($_POST['link_title'])) {
        foreach ($_POST['link_title'] as $i => $link_title) {
            $link_url = $_POST['link_url'][$i];
            if (!$link_url || !$link_title) {
                continue;
            }
            BuckysForumCategory::saveCategoryLink($categoryID, $link_title, $link_url);
        }
    }
    buckys_redirect("/forum/category.php?id=" . $categoryID, MSG_FORUM_SAVED, MSG_TYPE_SUCCESS);
}
$categoryID = isset($_GET['id']) ? $_GET['id'] : null;
if ($categoryID != null) {
    $category = BuckysForumCategory::getCategory($categoryID);
    //Check Permission
    if (!$category || !buckys_is_admin() && !buckys_is_moderator() && !buckys_is_forum_admin($category['categoryID']) && !buckys_is_forum_moderator($category['categoryID'])) {
        buckys_redirect('/forum', MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
    }
}
buckys_enqueue_stylesheet('sceditor/themes/default.css');
buckys_enqueue_stylesheet('forum.css');
buckys_enqueue_stylesheet('posting.css');
buckys_enqueue_stylesheet('publisher.css');
buckys_enqueue_stylesheet('uploadify.css');
buckys_enqueue_stylesheet('jquery.Jcrop.css');
buckys_enqueue_javascript('sceditor/jquery.sceditor.bbcode.js');
buckys_enqueue_javascript('uploadify/jquery.uploadify.js');
buckys_enqueue_javascript('jquery.Jcrop.js');
buckys_enqueue_javascript('edit_forum.js');
$TNB_GLOBALS['headerType'] = 'forum';
$TNB_GLOBALS['content'] = 'forum/edit_category';
                    <?php 
    }
    ?>
                </td>
            </tr>
        <?php 
}
?>
    </table>

    <!-- Moderator -->
    <?php 
if ($userID = buckys_is_logged_in()) {
    ?>
        <?php 
    if (!(buckys_is_admin() || buckys_is_moderator() || buckys_is_forum_admin($category['categoryID']) || buckys_is_forum_moderator($category['categoryID']))) {
        ?>
            <?php 
        if (BuckysForumModerator::isAppliedToModerate($category['categoryID'])) {
            ?>
 <!-- already applied to moderate -->
                <a href="javascript: void(0)" class="forum-action-button forum-action-button-inactive"
                    title="Already applied to moderate">apply to moderate</a>
            <?php 
        } else {
            ?>
                <a href="/forum/moderator.php?action=apply-moderate&<?php 
            echo buckys_get_form_token();
            ?>
=1&id=<?php 
            echo $category['categoryID'];
<?php

if (!isset($TNB_GLOBALS)) {
    die("Invalid Request!");
}
//Check Permissions
if (buckys_is_admin() || buckys_is_moderator() || buckys_is_forum_admin($topic['categoryID']) || buckys_is_forum_moderator($topic['categoryID'])) {
    $can_block_user = true;
    $currentUserID = buckys_is_logged_in();
} else {
    $can_block_user = false;
    $currentUserID = null;
}
?>

<!-- Go to www.addthis.com/dashboard to customize your tools 
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-53c94706485ac73e"></script>
-->

<section id="main_section" class="forum-main-section">
    <ul id="forum-nav">
        <li class="current"><a href="/forum">Home</a></li>
        <li><a href="/forum/search_topics.php">Search Topics</a></li>
        <li><a href="/forum/search_forums.php">Browse Forums</a></li>
    </ul>

    <!-- Forum Left Menu Bar -->
    <?php 
buckys_get_panel('forum_left_panel', ['category' => $category]);
?>
Example #4
0
                $forumTopicIns->deleteTopic($topicID);
                buckys_redirect('/forum', MSG_TOPIC_REMOVED_SUCCESSFULLY, MSG_TYPE_SUCCESS);
            } else {
                //You don't have permission
                buckys_redirect('/forum/topic.php?id=' . $topicID, MSG_PERMISSION_DENIED, MSG_TYPE_ERROR);
            }
        }
    }
}
$topicID = isset($_GET['id']) ? $_GET['id'] : 0;
$topic = BuckysForumTopic::getTopic($topicID);
if (!$topic) {
    buckys_redirect('/forum');
}
//If the topic is not published(pending or suspended), only forum moderator and administrator can see this
if ($topic['status'] != 'publish' && !buckys_is_forum_moderator() && $BUCKYS_GLOBALS['user']['userID'] != $topic['creatorID']) {
    buckys_redirect('/forum');
}
$orderBy = isset($_GET['orderby']) ? $_GET['orderby'] : 'oldest';
//Getting Replies
$page = isset($_GET['page']) ? $_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($BUCKYS_GLOBALS['user']['userID'], null, $topic['topicID']);
}
buckys_enqueue_javascript('jquery-migrate-1.2.0.js');
if (buckys_is_logged_in()) {
    ?>
            <dd>
                <a href="/forum/add_forum.php"
                    style="font-family:OpenSans-Bold; color:#f2f2f2;" <?php 
    echo $TNB_GLOBALS['content'] == 'forum/edit_category' && !isset($categoryID) ? 'class="current"' : '';
    ?>
>Create a New Category +</a>
            </dd>
            <div class="menu-item-divider"></div>
        <?php 
}
?>

        <?php 
if (buckys_is_admin() || buckys_is_moderator() || isset($category) && (buckys_is_forum_admin($category['categoryID']) || buckys_is_forum_moderator($category['categoryID']))) {
    $reportedItemsCount = BuckysForumModerator::getReportedItemsCount();
}
?>
        <?php 
foreach ($followingCategories as $crow) {
    ?>
            <?php 
    if ($crow['parentID'] == 0) {
        continue;
    }
    ?>
            <dd>
                <a href="/forum/category.php?id=<?php 
    echo $crow['categoryID'];
    ?>