function dispManageTable($arrBoards, $indent = 0) { global $mysqli, $MAIN_ROOT, $THEME, $cID; $boardObj = new ForumBoard($mysqli); $counter = 0; $x = 0; foreach ($arrBoards as $boardID) { $boardObj->select($boardID); $boardInfo = $boardObj->get_info_filtered(); $dispUpArrow = "<a href='javascript:void(0)' onclick=\"moveBoard('up', '" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/uparrow.png' width='24' height='24' title='Move Up'></a>"; $dispDownArrow = "<a href='javascript:void(0)' onclick=\"moveBoard('down', '" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/downarrow.png' width='24' height='24' title='Move Down'></a>"; if ($x == 0) { $dispUpArrow = "<img src='" . $MAIN_ROOT . "images/transparent.png' width='24' height='24'>"; } if ($boardObj->getHighestSortNum() == $boardInfo['sortnum']) { $dispDownArrow = "<img src='" . $MAIN_ROOT . "images/transparent.png' width='24' height='24'>"; } if ($counter == 1) { $addCSS = " alternateBGColor"; $counter = 0; } else { $addCSS = ""; $counter = 1; } echo "\n\t\t\t<tr>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 76%; padding-left: 10px'>" . str_repeat(" ", $indent) . "<b><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&bID=" . $boardInfo['forumboard_id'] . "&action=edit'>" . $boardInfo['name'] . "</a></b></td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'>" . $dispUpArrow . "</td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'>" . $dispDownArrow . "</td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&bID=" . $boardInfo['forumboard_id'] . "&action=edit'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/edit.png' width='24' height='24' title='Edit Board'></a></td>\n\t\t\t\t<td class='dottedLine main" . $addCSS . "' style='width: 6%' align='center'><a href='javascript:void(0)' onclick=\"deleteBoard('" . $boardInfo['forumboard_id'] . "')\"><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/buttons/delete.png' width='24' height='24' title='Delete Board'></a></td>\n\t\t\t</tr>\n\t\t"; $x++; $arrSubForums = $boardObj->getSubForums(); if (count($arrSubForums) > 0) { dispManageTable($arrSubForums, $indent + 1); } } }
public function delete() { $returnVal = false; if ($this->intTableKeyValue != "") { $arrSubForums = $this->getSubForums(); $result[] = $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "forum_post WHERE forumboard_id = '" . $this->intTableKeyValue . "'"); $result[] = $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "forum_topic WHERE forumboard_id = '" . $this->intTableKeyValue . "'"); $result[] = $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "forum_rankaccess WHERE board_id = '" . $this->intTableKeyValue . "'"); $result[] = $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "forum_memberaccess WHERE board_id = '" . $this->intTableKeyValue . "'"); $result[] = parent::delete(); if (count($arrSubForums) > 0) { $subForumObj = new ForumBoard($this->MySQL); $arrColumns = array("sortnum", "subforum_id"); foreach ($arrSubForums as $subForumID) { $subForumObj->select($subForumID); $subForumInfo = $subForumObj->get_info(); $newSortNum = $subForumInfo['sortnum'] + ($this->arrObjInfo['sortnum'] - 1); $arrValues = array($newSortNum, $this->arrObjInfo['subforum_id']); $subForumObj->update($arrColumns, $arrValues); } $subForumObj->resortOrder(); } if (!in_array(false, $result)) { $returnVal = true; } } return $returnVal; }
public function getForumActivity($amountToShow = 5) { $forumObj = new ForumBoard($this->MySQL); $arrReturn = array(); $memberInfo = $this->memberObj->get_info(); $result = $this->MySQL->query("SELECT forumpost_id FROM " . $this->MySQL->get_tablePrefix() . "forum_post ORDER BY dateposted DESC"); while (count($arrReturn) < $amountToShow && ($row = $result->fetch_assoc())) { $forumPostID = $row['forumpost_id']; $forumObj->objPost->select($forumPostID); $topicID = $forumObj->objPost->get_info("forumtopic_id"); $forumObj->objTopic->select($topicID); $boardID = $forumObj->objTopic->get_info("forumboard_id"); $forumObj->select($boardID); $boardAccessType = $forumObj->get_info("accesstype"); if (!in_array($forumPostID, $arrReturn) && $boardAccessType == 0) { $arrReturn[] = $forumPostID; } elseif (!in_array($forumPostID, $arrReturn) && $boardAccessType == 1 && $this->blnLoggedIn && $forumObj->memberHasAccess($memberInfo)) { $arrReturn[] = $forumPostID; } } return $arrReturn; }
public function getBoardList($db = DB_SLAVE) { $boardTitles = $this->getListTitles($db, NS_WIKIA_FORUM_BOARD); $titlesBatch = new TitleBatch($boardTitles); $orderIndexes = $titlesBatch->getWikiaProperties(WPP_WALL_ORDER_INDEX, $db); $boards = array(); /** @var $title Title */ foreach ($boardTitles as $title) { /** @var $board ForumBoard */ $board = ForumBoard::newFromTitle($title); $title = $board->getTitle(); $id = $title->getArticleID(); $boardInfo = $board->getBoardInfo(); $boardInfo['id'] = $title->getArticleID(); $boardInfo['name'] = $title->getText(); $boardInfo['description'] = $board->getDescriptionWithoutTemplates(); $boardInfo['url'] = $title->getFullURL(); $orderIndex = $orderIndexes[$id]; $boards[$orderIndex] = $boardInfo; } krsort($boards); return $boards; }
function listSubForums($forumID, $filterOut, $indent = 1) { global $mysqli; $boardObj = new ForumBoard($mysqli); $boardObj->select($forumID); $arrSubForums = $boardObj->getSubForums(); foreach ($arrSubForums as $value) { if ($filterOut != $value) { $boardObj->select($value); $boardInfo = $boardObj->get_info_filtered(); echo "<option value='" . $boardInfo['forumboard_id'] . "'>" . str_repeat(" ", $indent) . "· " . $boardInfo['name'] . "</option>"; $moreSubForums = $boardObj->getSubForums(); if (count($moreSubForums) > 0) { listSubForums($value, $filterOut, $indent + 1); } } } }
* E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ include_once "../classes/forumboard.php"; if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $cID = $_GET['cID']; $intAddBoardCID = $consoleObj->findConsoleIDByName("Add Board"); $intEditCatCID = $consoleObj->findConsoleIDByName("Manage Forum Categories"); $intAddCatCID = $consoleObj->findConsoleIDByName("Add Forum Category"); $boardObj = new ForumBoard($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); if ($boardObj->select($_GET['bID']) && $_GET['action'] == "edit") { include "include/edit_board.php"; } else { echo "\n\t\n\t\t<table class='formTable'>\n\t\t\t<tr>\n\t\t\t\t<td class='main' colspan='2' align='right'>\n\t\t\t\t\t» <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intAddBoardCID . "'>Add Board</a> « » <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intAddCatCID . "'>Add Category</a> «<br><br>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' style='width: 76%'>Board Name:</td>\n\t\t\t\t<td class='formTitle' style='width: 24%'>Actions:</td>\n\t\t\t</tr>\n\t\t</table>\n\t\n\t\t<div id='loadingSpiral' class='loadingSpiral'>\n\t\t\t<p align='center'>\n\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t\n\t\t<div id='boardList'>\n\t\n\t\n\t"; include "include/main_manageboards.php"; echo "\n\t\t</div>\n\t\t<div id='deleteBoardDiv' style='display: none'></div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\tfunction moveBoard(strDir, intBoardID) {\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\$('#boardList').fadeOut(250);\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/forum/include/move_board.php', { bID: intBoardID, bDir: strDir }, function(data) {\n\t\t\t\t\t\t\$('#boardList').html(data);\n\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\$('#boardList').fadeIn(250);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\n\t\t\n\t\t\tfunction deleteBoard(intBoardID) {\n\t\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/forum/include/delete_board.php', { bID: intBoardID }, function(data) {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#deleteBoardDiv').html(data);\n\t\t\t\t\t\t\$('#deleteBoardDiv').dialog({\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttitle: 'Delete Board',\n\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\tzIndex: 999999,\n\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\t\$('#boardList').fadeOut(250);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/forum/include/delete_board.php', { bID: intBoardID, confirm: 1 }, function(data1) {\n\n\t\t\t\t\t\t\t\t\t\t\$('#boardList').html(data1);\n\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\$('#boardList').fadeIn(250);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t}\n\t\t</script>\n\t"; }
include_once "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/basicorder.php"; include_once "../../../../classes/forumboard.php"; // Start Page $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Moderators"); $consoleObj->select($cID); $consoleInfo = $consoleObj->get_info_filtered(); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $memberModObj = new Member($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); $boardObj = new ForumBoard($mysqli); // Check Login $LOGIN_FAIL = true; if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) { echo "\n\t\n\t\t<table class='formTable' style='margin-bottom: 20px'>\n\t\t\t<tr>\n\t\t\t\t<td class='formTitle' style='width: 50%'>Board:</td>\n\t\t\t\t<td class='formTitle' style='width: 35%'>Date Added:</td>\n\t\t\t\t<td class='formTitle' style='width: 15%'>Actions:</td>\n\t\t\t</tr>\n\t\n\t"; if (isset($_POST['mID']) && $memberModObj->select($_POST['mID'])) { $memberModInfo = $memberModObj->get_info_filtered(); if ($_POST['action'] == "add") { if (substr($_POST['bID'], 0, 4) == "cat_") { $catID = str_replace("cat_", "", $_POST['bID']); if ($categoryObj->select($catID)) { $arrBoards = $categoryObj->getAssociateIDs(); foreach ($arrBoards as $boardID) { $boardObj->select($boardID); $boardObj->addMod($memberModInfo['member_id']); }
<?php /* * Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ include "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/forumboard.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $boardObj = new ForumBoard($mysqli); $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Boards"); $consoleObj->select($cID); if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if (($memberInfo['rank_id'] == 1 || $member->hasAccess($consoleObj)) && $boardObj->select($_POST['bID'])) { define('MEMBERRANK_ID', $memberInfo['rank_id']); $boardObj->move($_POST['bDir']); include "main_manageboards.php"; } }
/** * @return \yii\db\ActiveQuery */ public function getForumBoards() { return $this->hasMany(ForumBoard::className(), ['forum_id' => 'id']); }
* Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ // Config File $prevFolder = "../"; include $prevFolder . "_setup.php"; $consoleObj = new ConsoleOption($mysqli); $boardObj = new ForumBoard($mysqli); $subForumObj = new ForumBoard($mysqli); $member = new Member($mysqli); $postMemberObj = new Member($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); $ipbanObj = new Basic($mysqli, "ipban", "ipaddress"); if ($ipbanObj->select($IP_ADDRESS, false)) { $ipbanInfo = $ipbanObj->get_info(); if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>"); } else { $ipbanObj->delete(); } } // Start Page
* E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $boardObj = new ForumBoard($mysqli); if (!$boardObj->objTopic->select($_GET['topicID'])) { echo "\n\t\t<script type='text/javascript'>\n\t\t\twindow.location = '" . $MAIN_ROOT . "members'\n\t\t</script>\n\t"; exit; } $topicInfo = $boardObj->objTopic->get_info_filtered(); $boardObj->select($boardObj->objTopic->get_info("forumboard_id")); $boardInfo = $boardObj->get_info_filtered(); $forumCatObj = new Basic($mysqli, "forum_category", "forumcategory_id"); $boardObj->objPost->select($topicInfo['forumpost_id']); $postInfo = $boardObj->objPost->get_info_filtered(); $boardIDs = $boardObj->getAllBoards(); $catName = ""; $nonSelectableItems = array(); foreach ($boardIDs as $id) { $boardObj->select($id);
$newestMemberInfo = $menuMemberObj->get_info_filtered(); $checkURL = parse_url($newestMemberInfo['profilepic']); if ((!isset($checkURL['scheme']) || $checkURL['scheme'] == "") && $newestMemberInfo['profilepic'] != "") { $newestMemberInfo['profilepic'] = $MAIN_ROOT . $newestMemberInfo['profilepic']; } elseif ($newestMemberInfo['profilepic'] == "") { $newestMemberInfo['profilepic'] = $MAIN_ROOT . "themes/alliancebattle/images/defaultprofile.png"; } $menuMemberRankObj->select($newestMemberInfo['rank_id']); $arrSpecialMenuItems['newmembers'] .= "<div style='float: left; width: 43px'><img src='" . $newestMemberInfo['profilepic'] . "' style='width: 40px; height: 53px; border: solid black 1px'></div>"; $arrSpecialMenuItems['newmembers'] .= "<div style='float: left; padding-left: 8px; width: 85px'><div style='font-size: 12px; overflow: hidden; text-overflow: ellipsis; width: 85px'>" . $menuMemberObj->getMemberLink() . "</div><div class='main' style=\"font-family: 'Fenix', verdana, sans-serif; width: 85px; overflow: hidden; text-overflow: ellipsis\">" . $menuMemberRankObj->get_info_filtered("name") . "</div></div>"; $arrSpecialMenuItems['newmembers'] .= "<div style='clear: both'></div>"; $arrSpecialMenuItems['newmembers'] .= "</div>"; } $arrSpecialMenuItems['newmembers'] .= "<div style='clear: both'></div></div>"; // LATEST FORUM ACTIVITY $forumActivityObj = new ForumBoard($mysqli); $arrSpecialMenuItems['forumactivity'] = "<div style='margin-left: 2px; margin-right: 2px; margin-top: 0px; padding-bottom: 10px'>"; $counter = 0; $postCount = 0; $result = $mysqli->query("SELECT * FROM " . $dbprefix . "forum_post ORDER BY dateposted DESC"); $arrShownTopics = array(); while ($row = $result->fetch_assoc()) { $blnShowPost = false; $forumActivityObj->objTopic->select($row['forumtopic_id']); $menuTopicInfo = $forumActivityObj->objTopic->get_info_filtered(); $forumActivityObj->objPost->select($menuTopicInfo['forumpost_id']); $menuTopicPostInfo = $forumActivityObj->objPost->get_info_filtered(); $forumActivityObj->select($menuTopicInfo['forumboard_id']); $menuBoardInfo = $forumActivityObj->get_info_filtered(); if (!in_array($row['forumtopic_id'], $arrShownTopics) && $menuBoardInfo['accesstype'] == 0) { $blnShowPost = true;
/** * Remove and merge board * @request boardId - board to remove * @request boardTitle - board Title for validation * @request destinationBoardId - board to merge existing threads to * @response status - [ok|error|accessdenied] * @response errorfield - optional error field. nullable * @response errormsg - optional error message. �nullable */ public function removeBoard() { $this->status = self::checkAdminAccess(); if (!empty($this->status)) { return; } $boardId = $this->getVal('boardId', ''); $boardTitle = $this->getVal('boardTitle', ''); $destinationBoardId = $this->getVal('destinationBoardId', ''); if ($destinationBoardId == '') { $this->status = 'error'; $this->errormsg = ''; $this->errorfield = 'destinationBoardId'; return true; } /** * @var ForumBoard $board * @var ForumBoard $destinationBoard */ $board = ForumBoard::newFromId($boardId); $destinationBoard = ForumBoard::newFromId($destinationBoardId); if (empty($boardId) || empty($destinationBoardId)) { $this->status = 'error'; $this->errormsg = ''; return true; } if ($boardTitle != $board->getTitle()->getText()) { $this->status = 'error'; $this->errorfield = 'boardTitle'; $this->errormsg = ''; return true; } $board->moveAllThread($destinationBoard); $board->clearCacheBoardInfo(); $destinationBoard->clearCacheBoardInfo(); $forum = new Forum(); $forum->deleteBoard($board); $this->status = 'ok'; $this->errorfield = ''; $this->errormsg = ''; }
} for ($i = 1; $i <= $NUM_OF_PAGES; $i++) { $selectPage = ""; if ($i == $_GET['pID']) { $selectPage = " selected"; } $pageoptions .= "<option value='" . $i . "'" . $selectPage . ">" . $i . "</option>"; } $dispPageSelectTop = ""; $dispPageSelectBottom = ""; if ($blnPageSelect) { $dispPageSelectTop = "\n\t<p style='margin-top: 0px'><b>Page:</b> <select id='pageSelectTop' class='textBox'>" . $pageoptions . "</select> <input type='button' id='btnPageSelectTop' class='submitButton' value='GO' style='width: 40px'></p>\n\t<p style='margin-top: 0px'>" . $dispPreviousPage . $dispNextPage . "</p>\n\t"; $dispPageSelectBottom = "\n\t<p style='margin-top: 0px'><b>Page:</b> <select id='pageSelectBottom' class='textBox'>" . $pageoptions . "</select> <input type='button' id='btnPageSelectBottom' class='submitButton' value='GO' style='width: 40px'></p>\n\t<p style='margin-top: 0px'>" . $dispPreviousPage . $dispNextPage . "</p>\n\t"; } // Subforums $subForumObj = new ForumBoard($mysqli); $arrSubForums = $boardObj->getSubForums(); $dispSubForums = ""; foreach ($arrSubForums as $boardID) { $subForumObj->select($boardID); if ($subForumObj->memberHasAccess($memberInfo)) { $subForumInfo = $subForumObj->get_info_filtered(); $arrForumTopics = $subForumObj->getForumTopics(); $newTopicBG = ""; $dispNewTopicIMG = ""; if ($LOGGED_IN && $subForumObj->hasNewTopics($memberInfo['member_id'])) { $dispNewTopicIMG = " <img style='margin-left: 5px' src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/forum-new.png' title='New Posts!'>"; $newTopicBG = " boardNewPostBG"; } // Get Last Post Display Info if (count($arrForumTopics) > 0) {
* Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ include "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/forumboard.php"; $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $boardObj = new ForumBoard($mysqli); $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Boards"); $consoleObj->select($cID); if ($member->authorizeLogin($_SESSION['btPassword']) && $boardObj->select($_POST['bID'])) { $boardInfo = $boardObj->get_info_filtered(); if (isset($_POST['confirm'])) { $boardObj->delete(); $member->logAction("Deleted Forum Board: " . $boardInfo['name']); include "main_manageboards.php"; } else { $addMessage = ""; if (count($boardObj->getSubForums()) > 0) { $addMessage = "<br><br>All sub-forums will be moved to the parent category/sub-forum."; } echo "\n\t\t\n\t\t\t<p class='main' align='center'>\n\t\t\t\tAre you sure you want to delete the board, <b>" . $boardInfo['name'] . "</b>?<br><br>All posts in this board will also be deleted." . $addMessage . "\n\t\t\t</p>\n\t\t\n\t\t";
public function header() { $forum = new Forum(); $this->response->setVal('threads', $forum->getTotalThreads()); $this->response->setVal('activeThreads', $forum->getTotalActiveThreads()); $title = $this->wg->Title; $pageHeading = wfMessage('forum-specialpage-heading')->escaped(); $pageDescription = ''; $this->showStats = true; $nameSpace = $title->getNamespace(); if ($nameSpace === NS_WIKIA_FORUM_BOARD) { $this->showStats = false; $pageHeading = wfMessage('forum-board-title', $title->getText())->escaped(); $board = ForumBoard::newFromTitle($title); $pageDescription = $board->getDescription(); } else { if ($nameSpace === NS_USER_WALL_MESSAGE) { $this->showStats = false; $messageKey = $title->getText(); $message = WallMessage::newFromId($messageKey); if (!empty($message)) { $message->load(); $pageHeading = $message->getMetaTitle(); } } } $this->pageHeading = $pageHeading; $this->pageDescription = $pageDescription; }
<?php /* * Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ include_once "../classes/forumboard.php"; $boardObj = new ForumBoard($mysqli); if (isset($_GET['tID']) && $boardObj->objTopic->select($_GET['tID'])) { $boardID = $boardObj->objTopic->get_info("forumboard_id"); $boardObj->select($boardID); } elseif (isset($_GET['pID']) && $boardObj->objPost->select($_GET['pID'])) { $topicID = $boardObj->objPost->get_info("forumtopic_id"); $postMemberID = $boardObj->objPost->get_info("member_id"); $boardObj->objTopic->select($topicID); $boardID = $boardObj->objTopic->get_info("forumboard_id"); $boardObj->select($boardID); } if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj) && !$boardObj->memberIsMod($memberInfo['member_id']) && $memberInfo['member_id'] != $postMemberID) {
/** * purge memc and vernish cache for pages releated to this thread * * in case of edit this hook is run two time before (WallBeforeEdit) edit and after edit (WallAction) * */ public static function onWallAction($action, $parent, $comment_id) { $title = Title::newFromId($comment_id, Title::GAID_FOR_UPDATE); if (!empty($title) && MWNamespace::getSubject($title->getNamespace()) == NS_WIKIA_FORUM_BOARD) { $threadId = empty($parent) ? $comment_id : $parent; RelatedForumDiscussionController::purgeCache($threadId); //cleare board info $commentsIndex = CommentsIndex::newFromId($comment_id); if (empty($commentsIndex)) { return true; } $board = ForumBoard::newFromId($commentsIndex->getParentPageId()); if (empty($board)) { return true; } $thread = WallThread::newFromId($threadId); if (!empty($thread)) { $thread->purgeLastMessage(); } } return true; }
/* * Bluethrust Clan Scripts v4 * Copyright 2014 * * Author: Bluethrust Web Development * E-mail: support@bluethrust.com * Website: http://www.bluethrust.com * * License: http://www.bluethrust.com/license.php * */ // Config File $prevFolder = "../"; include $prevFolder . "_setup.php"; $consoleObj = new ConsoleOption($mysqli); $boardObj = new ForumBoard($mysqli); $subForumObj = new ForumBoard($mysqli); $member = new Member($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); define("RESIZE_FORUM_IMAGES", true); include "forum_image_resize.php"; // Start Page $PAGE_NAME = "Search Forum - "; include $prevFolder . "themes/" . $THEME . "/_header.php"; // Check Private Forum if ($websiteInfo['privateforum'] == 1 && !constant("LOGGED_IN")) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "login.php';</script>"); } $LOGGED_IN = false;
} } $cID = $_GET['cID']; $forumAttachmentsCID = $consoleObj->findConsoleIDByName("Post Forum Attachments"); $consoleObj->select($forumAttachmentsCID); $blnCheckForumAttachments = $member->hasAccess($consoleObj); $consoleObj->select($cID); if ($blnCheckForumAttachments) { include_once $prevFolder . "classes/download.php"; include_once $prevFolder . "classes/downloadcategory.php"; $attachmentObj = new Download($mysqli); $downloadCatObj = new DownloadCategory($mysqli); $downloadCatObj->selectBySpecialKey("forumattachments"); $forumAttachmentCatID = $downloadCatObj->get_info("downloadcategory_id"); } $boardObj = new ForumBoard($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); if (!$boardObj->select($_GET['bID']) || $boardObj->select($_GET['bID']) && !$boardObj->memberHasAccess($memberInfo)) { echo "<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members'</script>"; exit; } $boardInfo = $boardObj->get_info_filtered(); $blnPostReply = false; $addToForm = ""; if (isset($_GET['tID']) && $boardObj->objTopic->select($_GET['tID'])) { $blnPostReply = true; $topicInfo = $boardObj->objTopic->get_info(); // Check if topic is actually in the selected board if ($topicInfo['forumboard_id'] != $boardInfo['forumboard_id']) {
public function removeBoardModal() { wfProfileIn(__METHOD__); if (!$this->wg->User->isAllowed('forumadmin')) { $this->displayRestrictionError(); wfProfileOut(__METHOD__); return false; // skip rendering } $boardId = $this->getVal('boardId', -1); $board = ForumBoard::newFromId($boardId); if (empty($board)) { WikiaLogger::instance()->error('Error reporter: failed to find board', ['jiraTicket' => 'SOC-590', 'boardId' => $boardId, 'method' => __METHOD__]); $this->response->setCode(404); return true; } $boardTitle = $board->getTitle()->getText(); $forum = new Forum(); $list = $forum->getBoardList(); $this->destinationBoards = array(array('value' => '', 'content' => wfMessage('forum-board-destination-empty')->escaped())); foreach ($list as $value) { if ($boardId != $value['id']) { $this->destinationBoards[] = array('value' => $value['id'], 'content' => htmlspecialchars($value['name'])); } } $this->setVal('title', wfMessage('forum-admin-delete-and-merge-board-modal-heading', $boardTitle)->plain()); $this->setVal('submitLabel', wfMessage('forum-admin-delete-and-merge-button-label')->plain()); $form = array('inputs' => array(array('type' => 'text', 'name' => 'boardTitle', 'isRequired' => true, 'label' => wfMessage('forum-admin-delete-board-title')->plain()), array('type' => 'custom', 'output' => wfMessage('forum-admin-merge-board-warning')->plain()), array('type' => 'select', 'name' => 'destinationBoardId', 'class' => 'destinationBoardId', 'isRequired' => true, 'label' => wfMessage('forum-admin-merge-board-destination', $boardTitle)->plain(), 'options' => $this->destinationBoards)), 'method' => 'post', 'action' => ''); $this->setVal('html', $this->app->renderView('WikiaStyleGuideForm', 'index', array('form' => $form))); wfProfileOut(__METHOD__); }
* * License: http://www.bluethrust.com/license.php * */ include_once "../classes/forumboard.php"; if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } $cID = $_GET['cID']; $boardObj = new ForumBoard($mysqli); $categoryObj = new BasicOrder($mysqli, "forum_category", "forumcategory_id"); $categoryObj->set_assocTableName("forum_board"); $categoryObj->set_assocTableKey("forumboard_id"); $memberOptions = "<option value='select'>[SELECT]</option>"; $result = $mysqli->query("SELECT " . $dbprefix . "members.*, " . $dbprefix . "ranks.ordernum FROM " . $dbprefix . "members, " . $dbprefix . "ranks WHERE " . $dbprefix . "members.rank_id != '1' AND " . $dbprefix . "members.rank_id = " . $dbprefix . "ranks.rank_id ORDER BY " . $dbprefix . "ranks.ordernum DESC"); while ($row = $result->fetch_assoc()) { $memberRank->select($row['rank_id']); $dispRankName = $memberRank->get_info_filtered("name"); $memberOptions .= "<option value='" . $row['member_id'] . "'>" . $dispRankName . " " . filterText($row['username']) . "</option>"; } $boardOptions = "<option value='select'>[SELECT]</option>"; $result = $mysqli->query("SELECT forumcategory_id FROM " . $dbprefix . "forum_category ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $categoryObj->select($row['forumcategory_id']); $arrBoards = $categoryObj->getAssociateIDs(" ORDER BY sortnum");
* * License: http://www.bluethrust.com/license.php * */ include_once "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/basicsort.php"; include_once "../../../../classes/forumboard.php"; // Start Page $consoleObj = new ConsoleOption($mysqli); $cID = $consoleObj->findConsoleIDByName("Add Board"); $consoleObj->select($cID); $consoleInfo = $consoleObj->get_info_filtered(); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $boardObj = new ForumBoard($mysqli); if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) { if (isset($_POST['subforum']) && $boardObj->select($_POST['subforum'])) { $arrSubForums = $boardObj->getSubForums(); $arrSelectBoard = ""; if (isset($_POST['bID']) && $boardObj->select($_POST['bID'])) { $arrSelectBoard = $boardObj->findBeforeAfter(); } else { $_POST['bID'] = ""; } foreach ($arrSubForums as $forumID) { if ($forumID != $_POST['bID']) { $boardObj->select($forumID); $boardInfo = $boardObj->get_info_filtered(); $selectBoard = ""; if ($_POST['bID'] != "" && $arrSelectBoard[0] == $boardInfo['forumboard_id']) {
$newestMemberInfo = $menuMemberObj->get_info_filtered(); $checkURL = parse_url($newestMemberInfo['profilepic']); if ((!isset($checkURL['scheme']) || $checkURL['scheme'] == "") && $newestMemberInfo['profilepic'] != "") { $newestMemberInfo['profilepic'] = $MAIN_ROOT . $newestMemberInfo['profilepic']; } elseif ($newestMemberInfo['profilepic'] == "") { $newestMemberInfo['profilepic'] = $MAIN_ROOT . "themes/orangegrunge/images/defaultprofile.png"; } $menuMemberRankObj->select($newestMemberInfo['rank_id']); $arrSpecialMenuItems['newmembers'] .= "<div style='float: left; width: 43px'><img src='" . $newestMemberInfo['profilepic'] . "' style='width: 40px; height: 53px; border: solid black 1px'></div>"; $arrSpecialMenuItems['newmembers'] .= "<div style='float: left; padding-left: 8px; width: 80px'><div style='font-size: 12px; overflow: hidden; text-overflow: ellipsis; width: 80px'>" . $menuMemberObj->getMemberLink() . "</div><div class='main' style='width: 89px; overflow: hidden; text-overflow: ellipsis'>" . $menuMemberRankObj->get_info_filtered("name") . "</div></div>"; $arrSpecialMenuItems['newmembers'] .= "<div style='clear: both'></div>"; $arrSpecialMenuItems['newmembers'] .= "</div>"; } $arrSpecialMenuItems['newmembers'] .= "<div style='clear: both'></div></div>"; // LATEST FORUM ACTIVITY $forumActivityObj = new ForumBoard($mysqli); $arrSpecialMenuItems['forumactivity'] = "<div style='margin-left: 3px; margin-right: 3px; margin-top: 5px; margin-bottom: 20px'>"; $counter = 0; $postCount = 0; $result = $mysqli->query("SELECT * FROM " . $dbprefix . "forum_post ORDER BY dateposted DESC"); while ($row = $result->fetch_assoc()) { $blnShowPost = false; $forumActivityObj->objTopic->select($row['forumtopic_id']); $menuTopicInfo = $forumActivityObj->objTopic->get_info_filtered(); $forumActivityObj->objPost->select($menuTopicInfo['forumpost_id']); $menuTopicPostInfo = $forumActivityObj->objPost->get_info_filtered(); $forumActivityObj->select($menuTopicInfo['forumboard_id']); $menuBoardInfo = $forumActivityObj->get_info_filtered(); if ($menuBoardInfo['accesstype'] == 0) { $blnShowPost = true; $postCount++;
if (trim($_POST['boardname']) == "") { $dispError .= " <b>·</b> Board name may not be blank.<br>"; $countErrors++; } // Check Category if (!$categoryObj->select($_POST['forumcat'])) { $dispError .= " <b>·</b> You selected an invalid forum category.<br>"; $countErrors++; } // Check Subforum if ($_POST['subforum'] == 1 && $boardObj->select($_POST['subforumboard'])) { $setSubForum = $_POST['subforumboard']; } else { $setSubForum = 0; } $boardObj = new ForumBoard($mysqli); // Reset boardObj $boardObj->setSubForumID($setSubForum); // Check Order $boardObj->setCategoryKeyValue($categoryObj->get_info("forumcategory_id")); $intNewOrderSpot = $boardObj->validateOrder($_POST['displayorder'], $_POST['beforeafter']); if ($intNewOrderSpot === false) { $dispError .= " <b>·</b> You selected an invalid display order.<br>"; $countErrors++; } // Forum Access if ($_POST['accesstype'] != 1) { $_POST['accesstype'] = 0; $arrRanks = array(); $arrMembers = array(); } else {