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); } } }
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); } } } }
if (count($arrForumTopics) > 0) { $boardObj->objPost->select($arrForumTopics[0]); $firstPostInfo = $boardObj->objPost->get_info_filtered(); $boardObj->objTopic->select($firstPostInfo['forumtopic_id']); $lastPostID = $boardObj->objTopic->get_info("lastpost_id"); $boardObj->objPost->select($lastPostID); $lastPostInfo = $boardObj->objPost->get_info_filtered(); $postMemberObj->select($lastPostInfo['member_id']); $dispLastPost = "<div class='boardLastPostTitle'><a href='viewtopic.php?tID=" . $firstPostInfo['forumtopic_id'] . "#" . $lastPostID . "' title='" . $firstPostInfo['title'] . "'>" . $firstPostInfo['title'] . "</a></div>by " . $postMemberObj->getMemberLink() . "<br>" . getPreciseTime($lastPostInfo['dateposted']); } else { $dispLastPost = "<div style='text-align: center'>No Posts</div>"; } $dispTopicCount = $boardObj->countTopics(); $dispPostCount = $boardObj->countPosts(); $arrDispSubForums = array(); $arrSubForums = $boardObj->getSubForums(); foreach ($arrSubForums as $value) { $subForumObj->select($value); $subForumInfo = $subForumObj->get_info_filtered(); $arrDispSubForums[] = "<a href='" . $MAIN_ROOT . "forum/viewboard.php?bID=" . $value . "'>" . $subForumInfo['name'] . "</a>"; } $dispSubForums = ""; if (count($arrDispSubForums) > 0) { $dispSubForums = "<br><br><b>Sub-Forums:</b><br> " . implode(" <b>|</b> ", $arrDispSubForums); } $dispBoards .= "\n\t\t\t\t<tr class='boardRows" . $newTopicBG . "'>\n\t\t\t\t\t<td class='boardName dottedLine" . $newTopicBG . "'><a href='viewboard.php?bID=" . $boardInfo['forumboard_id'] . "'>" . $boardInfo['name'] . "</a>" . $dispNewTopicIMG . "<br><span class='boardDescription'>" . $boardInfo['description'] . $dispSubForums . "</span></td>\n\t\t\t\t\t<td class='dottedLine boardLastPost" . $newTopicBG . "'>" . $dispLastPost . "</td>\n\t\t\t\t\t<td class='dottedLine boardTopicCount" . $newTopicBG . "' align='center'>" . $dispTopicCount . "<span id='forumPageTopicCount' style='display: none'> Topics</span></td>\n\t\t\t\t\t<td class='dottedLine boardTopicCount boardPostCount" . $newTopicBG . "' align='center'>" . $dispPostCount . "<span id='forumPagePostCount' style='display: none'> Posts</span></td>\n\t\t\t\t\n\t\t\t\t</tr>\n\t\t\t"; } } if ($dispBoards != "") { echo "\n\t\t\t<tr>\n\t\t\t\t<td colspan='4' class='boardCategory'>\n\t\t\t\t\t" . $catInfo['name'] . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class='boardTitles'>Forum:</td>\n\t\t\t\t<td class='boardTitles forumLastPost'>Last Post:</td>\n\t\t\t\t<td class='boardTitles forumTopicCount'>Topics:</td>\n\t\t\t\t<td class='boardTitles forumTopicCount'>Posts:</td>\n\t\t\t</tr>\n\t\t"; echo $dispBoards;
* * 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"; } }
if (count($arrForumTopics) > 0) { $subForumObj->objPost->select($arrForumTopics[0]); $firstPostInfo = $subForumObj->objPost->get_info_filtered(); $subForumObj->objTopic->select($firstPostInfo['forumtopic_id']); $lastPostID = $subForumObj->objTopic->get_info("lastpost_id"); $subForumObj->objPost->select($lastPostID); $lastPostInfo = $subForumObj->objPost->get_info_filtered(); $postMemberObj->select($lastPostInfo['member_id']); $dispLastPost = "<div class='boardLastPostTitle'><a href='viewtopic.php?tID=" . $firstPostInfo['forumtopic_id'] . "#" . $lastPostID . "' title='" . $firstPostInfo['title'] . "'>" . $firstPostInfo['title'] . "</a></div>by " . $postMemberObj->getMemberLink() . "<br>" . getPreciseTime($lastPostInfo['dateposted']); } else { $dispLastPost = "<div style='text-align: center'>No Posts</div>"; } $dispTopicCount = $subForumObj->countTopics(); $dispPostCount = $subForumObj->countPosts(); $arrDispMoreSubForums = array(); $arrMoreSubForums = $subForumObj->getSubForums(); foreach ($arrMoreSubForums as $value) { $subForumObj->select($value); $subForumInfo = $subForumObj->get_info_filtered(); $arrDispMoreSubForums[] = "<a href='" . $MAIN_ROOT . "forum/viewboard.php?bID=" . $value . "'>" . $subForumInfo['name'] . "</a>"; } $dispMoreSubForums = ""; if (count($arrDispMoreSubForums) > 0) { $dispMoreSubForums = "<br><br><b>Sub-Forums:</b><br> " . implode(" <b>|</b> ", $arrDispMoreSubForums); } $subForumObj->select($boardID); $subForumInfo = $subForumObj->get_info_filtered(); $dispSubForums .= "\n\t\t\t<tr class='boardRows" . $newTopicBG . "'>\n\t\t\t\t<td class='boardName dottedLine" . $newTopicBG . "'><a href='viewboard.php?bID=" . $subForumInfo['forumboard_id'] . "'>" . $subForumInfo['name'] . "</a>" . $dispNewTopicIMG . "<br><span class='boardDescription'>" . $subForumInfo['description'] . $dispMoreSubForums . "</span></td>\n\t\t\t\t<td class='dottedLine boardLastPost" . $newTopicBG . "'>" . $dispLastPost . "</td>\n\t\t\t\t<td class='dottedLine boardTopicCount" . $newTopicBG . "' align='center'>" . $dispTopicCount . "<span id='forumPageTopicCount' style='display: none'> Topics</span></td>\n\t\t\t\t<td class='dottedLine boardTopicCount" . $newTopicBG . "' align='center'>" . $dispPostCount . "<span id='forumPagePostCount' style='display: none'> Posts</span></td>\n\t\t\t\n\t\t\t</tr>\n\t\t"; } } $breadcrumbObj->setTitle($boardInfo['name']);