function dispMenu($intSectionNum) { global $MAIN_ROOT, $LOGGED_IN, $mysqli, $shoutBoxPostLink, $shoutBoxDeleteLink, $shoutBoxEditLink, $arrShoutBoxIDs, $websiteInfo, $arrLoginInfo; echo "<div id='menuSection_" . $intSectionNum . "'>"; $menuCatObj = new MenuCategory($mysqli); $menuItemObj = new MenuItem($mysqli); $customPageObj = new Basic($mysqli, "custompages", "custompage_id"); $customFormObj = new CustomForm($mysqli); $downloadCatObj = new Basic($mysqli, "downloadcategory", "downloadcategory_id"); $memberObj = new Member($mysqli); $pollObj = new Poll($mysqli); if ($LOGGED_IN) { $intMenuAccessType = 1; } else { $intMenuAccessType = 2; } $arrMenuCategories = $menuCatObj->getCategories($intSectionNum, $intMenuAccessType); foreach ($arrMenuCategories as $menuCatID) { $menuCatObj->select($menuCatID); $menuCatInfo = $menuCatObj->get_info(); $arrMenuItems = $menuItemObj->getItems($menuCatInfo['menucategory_id'], $intMenuAccessType); if ($menuCatInfo['headertype'] == "image") { echo "<img src='" . $MAIN_ROOT . $menuCatInfo['headercode'] . "' class='menuHeaderImg'><br>"; } else { $menuCatInfo['headercode'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCatInfo['headercode']); $menuCatInfo['headercode'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCatInfo['headercode']); echo $menuCatInfo['headercode']; } foreach ($arrMenuItems as $menuItemID) { $menuItemObj->select($menuItemID); $menuItemInfo = $menuItemObj->get_info(); $menuItemInfo['itemtype'] = $menuItemInfo['itemtype'] == "customcode" || $menuItemInfo['itemtype'] == "customformat" ? "customblock" : $menuItemInfo['itemtype']; switch ($menuItemInfo['itemtype']) { case "link": $menuItemObj->objLink->select($menuItemInfo['itemtype_id']); $menuLinkInfo = $menuItemObj->objLink->get_info(); $checkURL = parse_url($menuLinkInfo['link']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuLinkInfo['link'] = $MAIN_ROOT . $menuLinkInfo['link']; } echo "<div style='text-align: " . $menuLinkInfo['textalign'] . "'> " . $menuLinkInfo['prefix'] . "<a href='" . $menuLinkInfo['link'] . "' target='" . $menuLinkInfo['linktarget'] . "'>" . $menuItemInfo['name'] . "</a></div>"; break; case "top-players": $dispTopPlayers = unserialize(SPECIAL_MENU_ITEM); echo $dispTopPlayers['top-players']; break; case "customform": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuCustomFormInfo = $menuItemObj->objCustomPage->get_info(); $customFormObj->select($menuCustomFormInfo['custompage_id']); echo "<div style='text-align: " . $menuCustomFormInfo['textalign'] . "'> " . $menuCustomFormInfo['prefix'] . "<a href='" . $MAIN_ROOT . "customform.php?pID=" . $menuCustomFormInfo['custompage_id'] . "' target='" . $menuCustomFormInfo['linktarget'] . "'>" . $customFormObj->get_info_filtered("name") . "</a></div>"; break; case "custompage": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuCustomPageInfo = $menuItemObj->objCustomPage->get_info(); $customPageObj->select($menuCustomPageInfo['custompage_id']); echo "<div style='text-align: " . $menuCustomPageInfo['textalign'] . "'> " . $menuCustomPageInfo['prefix'] . "<a href='" . $MAIN_ROOT . "custompage.php?pID=" . $menuCustomPageInfo['custompage_id'] . "' target='" . $menuCustomPageInfo['linktarget'] . "'>" . $customPageObj->get_info_filtered("pagename") . "</a></div>"; break; case "downloads": $menuItemObj->objCustomPage->select($menuItemInfo['itemtype_id']); $menuDownloadLinkInfo = $menuItemObj->objCustomPage->get_info(); $downloadCatObj->select($menuDownloadLinkInfo['custompage_id']); echo "<div style='text-align: " . $menuDownloadLinkInfo['textalign'] . "'> " . $menuDownloadLinkInfo['prefix'] . "<a href='" . $MAIN_ROOT . "downloads/index.php?catID=" . $menuDownloadLinkInfo['custompage_id'] . "' target='" . $menuDownloadLinkInfo['linktarget'] . "'>" . $downloadCatObj->get_info_filtered("name") . "</a></div>"; break; case "customblock": $menuItemObj->objCustomBlock->select($menuItemInfo['itemtype_id']); $menuCustomBlockInfo = $menuItemObj->objCustomBlock->get_info(); $menuCustomBlockInfo['code'] = str_replace("[MAIN_ROOT]", $MAIN_ROOT, $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBER_ID]", $arrLoginInfo['memberID'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBERUSERNAME]", $arrLoginInfo['memberUsername'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[MEMBERRANK]", $arrLoginInfo['memberRank'], $menuCustomBlockInfo['code']); $menuCustomBlockInfo['code'] = str_replace("[PMLINK]", $arrLoginInfo['pmLink'], $menuCustomBlockInfo['code']); echo $menuCustomBlockInfo['code']; break; case "image": $menuItemObj->objImage->select($menuItemInfo['itemtype_id']); $menuImageInfo = $menuItemObj->objImage->get_info(); $checkURL = parse_url($menuItemInfo['imageurl']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuImageInfo['imageurl'] = $MAIN_ROOT . $menuImageInfo['imageurl']; } $dispSetWidth = ""; if ($menuImageInfo['width'] != 0) { $dispSetWidth = "width: " . $menuImageInfo['width'] . "px; "; } $dispSetHeight = ""; if ($menuImageInfo['height'] != 0) { $dispSetHeight = "height: " . $menuImageInfo['height'] . "px; "; } echo "<div style='text-align: " . $menuImageInfo['imagealign'] . "; margin-top: 15px; margin-bottom: 15px'>"; if ($menuImageInfo['link'] != "") { $checkURL = parse_url($menuImageInfo['link']); if (!isset($checkURL['scheme']) || ($checkURL['scheme'] = "")) { $menuImageInfo['link'] = $MAIN_ROOT . $menuImageInfo['link']; } echo "<a href='" . $menuImageInfo['link'] . "' target='" . $menuImageInfo['linktarget'] . "'><img src='" . $menuImageInfo['imageurl'] . "' style='" . $dispSetWidth . $dispSetHeight . "' title='" . $menuItemInfo['name'] . "'></a>"; } else { echo "<img src='" . $menuImageInfo['imageurl'] . "' title='" . $menuItemInfo['name'] . "' style='" . $dispSetWidth . $dispSetHeight . "'>"; } echo "</div>"; break; case "shoutbox": $menuItemObj->objShoutbox->select($menuItemInfo['itemtype_id']); $menuShoutboxInfo = $menuItemObj->objShoutbox->get_info(); if ($menuShoutboxInfo['width'] == 0) { $menuShoutboxInfo['width'] = "145"; } $blnShoutboxWidthPercent = false; if ($menuShoutboxInfo['percentwidth'] == 1) { $blnShoutboxWidthPercent = true; } if ($menuShoutboxInfo['height'] == 0) { $menuShoutboxInfo['height'] = "300"; } $blnShoutboxHeightPercent = false; if ($menuShoutboxInfo['percentheight'] == 1) { $blnShoutboxHeightPercent = true; } $mainShoutboxObj = new Shoutbox($mysqli, "news", "news_id"); $newShoutBoxID = uniqid("mainShoutBox_"); $arrShoutBoxIDs[] = $newShoutBoxID; $mainShoutboxObj->strDivID = $newShoutBoxID; $mainShoutboxObj->intDispWidth = $setShoutBoxWidth; $mainShoutboxObj->intDispHeight = $setShoutBoxHeight; $mainShoutboxObj->strEditLink = $shoutBoxEditLink; $mainShoutboxObj->strDeleteLink = $shoutBoxDeleteLink; $mainShoutboxObj->strPostLink = $shoutBoxPostLink; echo $mainShoutboxObj->dispShoutbox($menuShoutboxInfo['width'], $menuShoutboxInfo['height'], $blnShoutboxWidthPercent, $menuShoutboxInfo['textboxwidth'], $blnShoutboxHeightPercent); echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "').animate({\n\t\t\t\t\t\t\t\t\t\tscrollTop:\$('#" . $newShoutBoxID . "')[0].scrollHeight\n\t\t\t\t\t\t\t\t\t}, 1000);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_message').keypress(function(eventObj) {\n\t\t\t\t\t\t\t\t\tif(eventObj.which == 13) {\n\t\t\t\t\t\t\t\t\t\tif(\$('#" . $newShoutBoxID . "_message').val() != \"\") {\n\t\t\t\t\t\t\t\t\t\t\t\$('#" . $newShoutBoxID . "_postShoutbox input[type=button]').click();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\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\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t\t"; break; case "newestmembers": $dispNewMembers = unserialize(SPECIAL_MENU_ITEM); echo $dispNewMembers['newmembers']; break; case "forumactivity": $dispNewMembers = unserialize(SPECIAL_MENU_ITEM); echo $dispNewMembers['forumactivity']; break; case "login": echo constant("LOGIN_BOX"); break; case "poll": $pollObj->select($menuItemInfo['itemtype_id']); $memberObj->select($_SESSION['btUsername']); $pollObj->dispPollMenu($memberObj); break; } } echo "<br>"; } echo "</div>"; }
public function displayShoutbox() { $shoutboxInfo = $this->menuItemObj->objShoutbox->get_info(); $shoutboxInfo['width'] = $shoutboxInfo['width'] <= 0 ? $this->defaultShoutboxWidth : $shoutboxInfo['width']; $blnShoutboxWidthPercent = $shoutboxInfo['percentwidth'] ? true : false; $shoutboxInfo['height'] = $shoutboxInfo['height'] <= 0 ? $this->defaultShoutboxHeight : $shoutboxInfo['height']; $blnShoutboxHeightPercent = $shoutboxInfo['percentheight'] ? true : false; $shoutboxObj = new Shoutbox($this->MySQL, "news", "news_id"); $newShoutboxID = uniqid("mainShoutBox_"); $this->data['shoutboxIDs'][] = $newShoutboxID; $shoutboxObj->strDivID = $newShoutboxID; $this->arrShoutBoxIDs[] = $newShoutboxID; $shoutboxObj->prepareLinks($this->memberObj); echo $shoutboxObj->dispShoutbox($shoutboxInfo['width'], $shoutboxInfo['height'], $blnShoutboxWidthPercent, $shoutboxInfo['textboxwidth'], $blnShoutboxHeightPercent); echo $shoutboxObj->getShoutboxJS(); }
if ($squadObj->select($_GET['sID']) && $squadObj->memberHasAccess($memberInfo['member_id'], "postshoutbox")) { $squadInfo = $squadObj->get_info(); $squadNewsObj = new Basic($mysqli, "squadnews", "squadnews_id"); $arrColumns = array("member_id", "squad_id", "dateposted", "newspost", "newstype"); $arrValues = array($memberInfo['member_id'], $squadInfo['squad_id'], time(), $_POST['message'], 3); $squadNewsObj->addNew($arrColumns, $arrValues); if ($squadObj->memberHasAccess($memberInfo['member_id'], "manageshoutbox")) { $blnManageShoutbox = true; } } } $squadMemberList = $squadObj->getMemberList(); $blnShowShoutBox = false; if (in_array($memberInfo['member_id'], $squadMemberList) && $squadInfo['privateshoutbox'] == 1) { $blnShowShoutBox = true; } elseif ($squadInfo['privateshoutbox'] == 0) { $blnShowShoutBox = true; } if ($blnShowShoutBox) { $shoutboxObj = new Shoutbox($mysqli, "squadnews", "squadnews_id"); $shoutboxObj->strDivID = "squadsShoutbox"; $shoutboxObj->intDispWidth = 205; $shoutboxObj->intDispHeight = 400; $shoutboxObj->blnUpdateShoutbox = true; $shoutboxObj->strSQLSort = " AND squad_id ='" . $squadInfo['squad_id'] . "'"; if ($blnManageShoutbox) { $shoutboxObj->strEditLink = $MAIN_ROOT . "members/squads/managesquad.php?&pID=ManageShoutbox&sID=" . $squadInfo['squad_id'] . "&nID="; $shoutboxObj->strDeleteLink = $MAIN_ROOT . "members/squads/include/deleteshoutpost.php?sID=" . $squadInfo['squad_id']; } echo $shoutboxObj->dispShoutbox(); }
$shoutboxObj->strSQLSort = " AND squad_id ='" . $squadInfo['squad_id'] . "'"; if ($blnPost) { $shoutboxObj->strPostLink = $MAIN_ROOT . "members/squads/include/postshoutbox.php?sID=" . $squadInfo['squad_id']; } if ($blnManageShoutbox) { $shoutboxObj->strEditLink = $MAIN_ROOT . "members/squads/managesquad.php?pID=ManageShoutbox&sID=" . $squadInfo['squad_id'] . "&nID="; $shoutboxObj->strDeleteLink = $MAIN_ROOT . "members/squads/include/deleteshoutpost.php?sID=" . $squadInfo['squad_id']; } $breadcrumbObj->setTitle($squadInfo['name']); $breadcrumbObj->addCrumb("Home", $MAIN_ROOT); $breadcrumbObj->addCrumb("Squads", $MAIN_ROOT . "squads"); $breadcrumbObj->addCrumb($squadInfo['name']); include $prevFolder . "include/breadcrumb.php"; echo "\t\n\t\t<div class='squadContainer'>\n\t\t\n\t\t\t<div class='squadLeftColumn'>\n\t\t\t\t<img src='" . $squadInfo['logourl'] . "' class='squadLogo'>\n\t\t\t\t\n\t\t\t\t<div class='squadInfoTitle'>SQUAD NEWS</div>\n\t\t\t\t<div class='squadInfoBox'>\n\t\t\t\t\t<div class='squadNews'>\n\t\t\t\t\t\t" . $dispSquadNews . "\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='squadInfoTitle'>MEMBERS</div>\n\t\t\t\t<div class='squadInfoBox'>\n\t\t\t\t\t\n\t\t\t\t\t<table class='formTable' style='border-spacing: 0px'>\n\t\t\t\t\t\t" . $dispMemberList . "\n\t\t\t\t\t</table>\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>\n\t\t\n\t\t\t<div class='squadRightColumn'>\n\t\t\t\t<div class='squadInfoTitle' style='margin-top: 0px'>SQUAD INFORMATION</div>\n\t\t\t\t<div class='squadInfoBox'>\n\t\t\t\t\t<b>About the Squad:</b><br>\n\t\t\t\t\t" . nl2br($squadInfo['description']) . "\n\t\t\t\t\t<div class='dottedLine' style='margin: 5px 0px'></div>\n\t\t\t\t\t<b>Squad Founder:</b><br>\n\t\t\t\t\t" . $dispFounderLink . "<br><br>\n\t\t\t\t\t\n\t\t\t\t\t<b>Date Founded:</b><br>" . getPreciseTime($squadInfo['datecreated']) . "<br><br>\n\t\t\t\t\t\n\t\t\t\t\t<b>Recruiting:</b> " . $dispRecruitingStatus . "<br><br>\n\t\t\t\t\t\n\t\t\t\t\t<b>Total Members:</b> " . $squadObj->countMembers() . "<br><br>\n\t\t\t\t\t\n\t\t\t\t\t"; if ($squadInfo['website'] != "") { echo "\n\t\t\t\t\t\t\t<b>Website:</b> <a href='" . $squadInfo['website'] . "' target='_blank'>View Site</a><br><br>\n\t\t\t\t\t\t"; } if (in_array($memberInfo['member_id'], $squadMemberList)) { echo "\n\n\t\t\t\t\t\t<div class='dottedLine' style='margin: 5px 0px'></div>\n\t\t\t\t\t\t<p align='center' class='largeFont main'><b><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $consoleObj->findConsoleIDByName("View Your Squads") . "&select=" . $squadInfo['squad_id'] . "'>Manage Squad</a></b></p>\n\t\t\t\t\t"; } else { echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<div class='dottedLine' style='margin: 5px 0px'></div>\n\t\t\t\t\t\t<p align='center' class='largeFont main'><b><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $consoleObj->findConsoleIDByName("Apply to a Squad") . "&select=" . $squadInfo['squad_id'] . "'>Apply to this Squad</a></b></p>\n\t\t\t\t\t"; } echo "\n\t\t\t\t\t\n\t\t\t\t</div>\n\t\t\t\t"; $dispShoutbox = "\n\t\t\t\t<div class='squadInfoTitle'>SHOUTBOX</div>\n\t\t\t\t<div class='squadInfoBox'>\n\t\t\t\t\t" . $shoutboxObj->dispShoutbox("", "", true) . "\n\t\t\t\t</div>\n\t\t\t"; if ($squadInfo['privateshoutbox'] == 0 && in_array($memberInfo['member_id'], $squadMemberList)) { echo $dispShoutbox; } elseif ($squadInfo['privateshoutbox'] == 1) { echo $dispShoutbox; } echo "\n\t\t\t\t<div class='squadInfoTitle'>RANKINGS</div>\n\t\t\t\t<div class='squadInfoBox'>\n\t\t\t\t\t\n\t\t\t\t\t" . $dispSquadRanks . "\n\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\n\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\t\n\t\t\t\t\$('#squadsShoutbox').animate({\n\t\t\t\tscrollTop:\$('#squadsShoutbox')[0].scrollHeight\n\t\t\t}, 1000);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t\t\n\t\t\tfunction reloadSquadsShoutbox() {\n\t\t\t\t\$(document).ready(function() {\n\n\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/squads/include/reloadshoutbox.php', { sID: '" . $squadInfo['squad_id'] . "' }, function(data) {\n\n\t\t\t\t\t\t\$('#squadsShoutbox').html(data);\n\t\n\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t});\n\n\t\t\t\t\n\t\t\t\tsetTimeout('reloadSquadsShoutbox()', 20000);\n\t\t\t}\n\n\n\t\t\tsetTimeout('reloadSquadsShoutbox()', 20000);\n\t\t\n\t\t</script>\n"; include $prevFolder . "themes/" . $THEME . "/_footer.php";