Esempio n. 1
0
 public function displayMenuItem()
 {
     global $hooksObj;
     $this->menuItemInfo['itemtype'] = $this->menuItemInfo['itemtype'] == "customcode" || $this->menuItemInfo['itemtype'] == "customformat" ? "customblock" : $this->menuItemInfo['itemtype'];
     switch ($this->menuItemInfo['itemtype']) {
         case "link":
             $this->menuItemObj->objLink->select($this->menuItemInfo['itemtype_id']);
             $this->displayLink();
             break;
         case "top-players":
             $this->displayTopPlayers();
             break;
         case "customform":
             $this->menuItemObj->objCustomPage->select($this->menuItemInfo['itemtype_id']);
             $this->displayCustomFormLink();
             break;
         case "custompage":
             $this->menuItemObj->objCustomPage->select($this->menuItemInfo['itemtype_id']);
             $this->displayCustomPageLink();
             break;
         case "downloads":
             $this->menuItemObj->objCustomPage->select($this->menuItemInfo['itemtype_id']);
             $this->displayDownloadPageLink();
             break;
         case "customblock":
             $this->menuItemObj->objCustomBlock->select($this->menuItemInfo['itemtype_id']);
             $this->displayCustomCodeBlock();
             break;
         case "image":
             $this->menuItemObj->objImage->select($this->menuItemInfo['itemtype_id']);
             $this->displayImage();
             break;
         case "shoutbox":
             $this->menuItemObj->objShoutbox->select($this->menuItemInfo['itemtype_id']);
             $this->displayShoutbox();
             $arrShoutBoxIDs = $theme->data['shoutboxIDs'];
             break;
         case "newestmembers":
             $this->displayNewMembers();
             break;
         case "forumactivity":
             $this->displayForumActivity();
             break;
         case "login":
             $this->displayLogin();
             break;
         case "poll":
             $pollObj = new Poll($this->MySQL);
             $pollObj->select($this->menuItemInfo['itemtype_id']);
             $pollObj->dispPollMenu($this->memberObj);
             break;
         default:
             $GLOBALS['menu_item_info'] = $this->menuItemInfo;
             $hooksObj->run("menu_item");
             unset($GLOBALS['menu_item_info']);
             break;
     }
 }
Esempio n. 2
0
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'] . "'>&nbsp;&nbsp;" . $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'] . "'>&nbsp;&nbsp;" . $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'] . "'>&nbsp;&nbsp;" . $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'] . "'>&nbsp;&nbsp;" . $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>";
}
Esempio n. 3
0
<?php

// Config File
$prevFolder = "../";
include $prevFolder . "_setup.php";
include_once $prevFolder . "classes/member.php";
include_once $prevFolder . "classes/poll.php";
$consoleObj = new ConsoleOption($mysqli);
$pollObj = new Poll($mysqli);
$member = new Member($mysqli);
if (!$member->select($_SESSION['btUsername']) || !$member->authorizeLogin($_SESSION['btPassword'])) {
    $member = new Member($mysqli);
}
if ($pollObj->select($_POST['pID'])) {
    echo "<div class='shadedBox' style='margin: 20px auto; max-width: 200px; width: 40%;'>";
    $pollObj->dispPollMenu($member);
    echo "</div>";
}