/** * @param $categoryID * @param $applicants */ public static function approveApplicants($categoryID, $applicants) { global $db; foreach ($applicants as $aid) { $query = $db->prepare("UPDATE " . TABLE_FORUM_MODERATORS . " SET `status`='Approved' WHERE categoryID=%d AND userID=%d", $categoryID, $aid); $db->query($query); //Make the user follow the forum if (!BuckysForumFollower::isFollow($categoryID, $aid)) { BuckysForumFollower::followForum($aid, $categoryID); } } }
" alt="" class="forum-logo"/></a> <p class="followers"> <?php echo number_format($category['followers']); ?> follower<?php echo $category['followers'] > 1 ? "s" : ""; ?> </p> <?php if ($userID = buckys_is_logged_in()) { ?> <?php if (BuckysForumFollower::isFollow($category['categoryID'])) { ?> <?php if ($userID != $category['creatorID']) { ?> <a href="/forum/category.php?action=unfollow&id=<?php echo $category['categoryID']; ?> &<?php echo buckys_get_form_token(); ?> =1&return=<?php echo base64_encode($_SERVER["REQUEST_URI"]); ?> " class="forum-action-button forum-action-button-inactive" <?php
<?php require dirname(dirname(__FILE__)) . '/includes/bootstrap.php'; $categoryID = isset($_GET['id']) ? $_GET['id'] : 0; if (isset($_REQUEST['action'])) { if ($_REQUEST['action'] == 'follow' || $_REQUEST['action'] == 'unfollow') { if (!($userID = buckys_is_logged_in()) && buckys_check_form_token('request')) { buckys_redirect(isset($_REQUEST['return']) ? base64_decode($_REQUEST['return']) : '/forum', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } $category = BuckysForumCategory::getCategory($categoryID); if (!$category || $_REQUEST['action'] == 'follow' && BuckysForumFollower::isFollow($category['categoryID'], $userID) || $_REQUEST['action'] == 'unfollow' && !BuckysForumFollower::isFollow($category['categoryID'], $userID) || $category['creatorID'] == $userID) { buckys_redirect(isset($_REQUEST['return']) ? base64_decode($_REQUEST['return']) : '/forum', MSG_INVALID_REQUEST, MSG_TYPE_ERROR); } if ($_REQUEST['action'] == 'follow') { BuckysForumFollower::followForum($userID, $categoryID); buckys_add_message(MSG_FOLLOW_FORUM_SUCCESS); } else { BuckysForumFollower::unfollowForum($userID, $categoryID); buckys_add_message(MSG_UNFOLLOW_FORUM_SUCCESS); } buckys_redirect(isset($_REQUEST['return']) ? base64_decode($_REQUEST['return']) : '/forum'); } } $category = BuckysForumCategory::getCategory($categoryID); if (!$category) { buckys_redirect('/forum'); } //Getting Topics by category id $page = isset($_GET['page']) ? $_GET['page'] : 1; $orderby = isset($_GET['orderby']) ? $_GET['orderby'] : 'recent'; switch ($orderby) {