Example #1
0
 public function displayCustomPageLink()
 {
     $customPageObj = new Basic($this->MySQL, "custompages", "custompage_id");
     $menuCustomPageInfo = $this->menuItemObj->objCustomPage->get_info();
     $customPageObj->select($menuCustomPageInfo['custompage_id']);
     echo "\n\t\t\t<div style='text-align: " . $menuCustomPageInfo['textalign'] . "'>\n\t\t\t" . $menuCustomPageInfo['prefix'] . "<a href='" . MAIN_ROOT . "custompage.php?pID=" . $menuCustomPageInfo['custompage_id'] . "' target='" . $menuCustomPageInfo['linktarget'] . "'>" . $customPageObj->get_info_filtered("pagename") . "</a>\n\t\t\t</div>\n\t\t\t";
 }
 public function displayCustomPageLink()
 {
     $customPageObj = new Basic($this->MySQL, "custompages", "custompage_id");
     $menuCustomPageInfo = $this->menuItemObj->objCustomPage->get_info();
     $customPageObj->select($menuCustomPageInfo['custompage_id']);
     $menuItemInfo = $customPageObj->get_info_filtered();
     $menuItemInfo['name'] = $menuItemInfo['pagename'];
     $menuCustomPageInfo['link'] = MAIN_ROOT . "custompage.php?pID=" . $menuItemInfo['custompage_id'];
     $this->formatLink($menuItemInfo, $menuCustomPageInfo);
 }
Example #3
0
 function calcStat($gameStatID, $memberObj)
 {
     $calculatedValue = 0;
     $gameStatObj = new Basic($this->MySQL, "gamestats", "gamestats_id");
     if ($gameStatObj->select($gameStatID) && isset($memberObj)) {
         $gameStatInfo = $gameStatObj->get_info_filtered();
         $gameStat1Obj = new Basic($this->MySQL, "gamestats", "gamestats_id");
         $gameStat2Obj = new Basic($this->MySQL, "gamestats", "gamestats_id");
         if ($gameStatInfo['stattype'] == "calculate" && $gameStat1Obj->select($gameStatInfo['firststat_id']) && $gameStat2Obj->select($gameStatInfo['secondstat_id'])) {
             $gameStats1Info = $gameStat1Obj->get_info_filtered();
             $gameStats2Info = $gameStat2Obj->get_info_filtered();
             $gameStat1Type = $gameStats1Info['stattype'];
             $gameStat2Type = $gameStats2Info['stattype'];
             if ($gameStat1Type == "calculate") {
                 $gameStat1Value = $this->calcStat($gameStats1Info['gamestats_id'], $memberObj);
             } else {
                 $gameStat1Value = $memberObj->getGameStatValue($gameStats1Info['gamestats_id']);
             }
             if ($gameStat2Type == "calculate") {
                 $gameStat2Value = $this->calcStat($gameStats2Info['gamestats_id'], $memberObj);
             } else {
                 $gameStat2Value = $memberObj->getGameStatValue($gameStats2Info['gamestats_id']);
             }
             switch ($gameStatInfo['calcop']) {
                 case "div":
                     if ($gameStat2Value == 0) {
                         $gameStat2Value = 1;
                     }
                     $calculatedValue = round($gameStat1Value / $gameStat2Value, $gameStatInfo['decimalspots']);
                     break;
                 case "mul":
                     $calculatedValue = round($gameStat1Value * $gameStat2Value, $gameStatInfo['decimalspots']);
                     break;
                 case "sub":
                     $calculatedValue = round($gameStat1Value - $gameStat2Value, $gameStatInfo['decimalspots']);
                     break;
                 default:
                     $calculatedValue = round($gameStat1Value + $gameStat2Value, $gameStatInfo['decimalspots']);
             }
         }
     }
     return $calculatedValue;
 }
             } else {
                 $addAppForm->errors[] = "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.";
             }
         }
         if (count($addAppForm->errors) > 0) {
             $_POST['saveComponent'] = false;
         }
     }
     if (!$_POST['saveComponent']) {
         if (($appCompInfo['componenttype'] == "select" || $appCompInfo['componenttype'] == "multiselect") && $countErrors == 0) {
             $appSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
             $arrSelectValues = $appComponentObj->getAssociateIDs();
             $tempArr = array();
             foreach ($arrSelectValues as $selectValueID) {
                 $appSelectOptionObj->select($selectValueID);
                 $appSelectValue = $appSelectOptionObj->get_info_filtered("componentvalue");
                 $tempArr[$selectValueID] = $appSelectValue;
             }
             asort($tempArr);
             $_SESSION['btAppComponent']['cOptions'] = $tempArr;
         } elseif ($countErrors == 0) {
             $_SESSION['btAppComponent']['cOptions'] = array();
         }
     }
 } else {
     echo "\n\t\t\t<script type='text/javascript'>\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('#appComponentForm').dialog('close');\n\t\t\t\t});\n\t\t\t</script>\n\t\t";
 }
 $addAppForm->components['name']['value'] = $appCompInfo['name'];
 $addAppForm->components['type']['value'] = $appCompInfo['componenttype'];
 $addAppForm->components['required']['value'] = $appCompInfo['required'];
 $addAppForm->components['tooltip']['value'] = $appCompInfo['tooltip'];
Example #5
0
include $prevFolder . "_setup.php";
$diplomacyObj = new Basic($mysqli, "diplomacy", "diplomacy_id");
if (!$diplomacyObj->select($_GET['dID'])) {
    echo "\n\t\t<script type='text/javascript'>\n\t\t\twindow.location = '" . $MAIN_ROOT . "diplomacy'\n\t\t</script>\n\t";
    exit;
}
$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();
    }
}
$diplomacyInfo = $diplomacyObj->get_info_filtered();
$diplomacyStatusObj = new BasicOrder($mysqli, "diplomacy_status", "diplomacystatus_id");
$diplomacyStatusObj->select($diplomacyInfo['diplomacystatus_id']);
$statusInfo = $diplomacyStatusObj->get_info_filtered();
if ($statusInfo['imageurl'] == "") {
    $dispStatus = $statusInfo['name'];
} else {
    if (strpos($statusInfo['imageurl'], "http://") === false) {
        $statusInfo['imageurl'] = "../" . $statusInfo['imageurl'];
    }
    $dispImgWidth = "";
    $dispImgHeight = "";
    if ($statusInfo['imagewidth'] != 0) {
        $dispImgWidth = " width = '" . $statusInfo['imagewidth'] . "' ";
    }
    if ($statusInfo['imageheight'] != 0) {
Example #6
0
 if ($newGame->addNew($arrColumns, $arrValues)) {
     $newGameInfo = $newGame->get_info_filtered();
     // Try adding stats
     $showErrorMessage = "";
     $newStat = new Basic($mysqli, "gamestats", "gamestats_id");
     $arrColumns = array("name", "stattype", "ordernum", "decimalspots", "gamesplayed_id", "hidestat", "textinput");
     $arrSavedStats = array();
     // First insert all stats so we can get their actual database ids
     // After we add them, save the info array to a separate array
     foreach ($_SESSION['btStatCache'] as $key => $statInfo) {
         $arrValues = array($statInfo['statName'], $statInfo['statType'], $key, $statInfo['rounding'], $newGameInfo['gamesplayed_id'], $statInfo['hideStat'], $statInfo['textInput']);
         if (!$newStat->addNew($arrColumns, $arrValues)) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;<b>&middot;</b> " . filterText($statInfo['statName']) . "<br>";
         } else {
             $arrSavedStats[] = $newStat->get_info_filtered();
         }
     }
     /*
      * 	1. Make sure that all of the game stats were successfully inserted into the db
      *  2. For each stat that was an auto-calculated stat, we need to update the firststat and secondstat IDs
      *  3. We can identify the correct $arrSavedStat index by accessing the stat order which is stored in
      *     $_SESSION[btStatCache][key][firstStat] and $_SESSION[btStatCache][key][secondStat]
      */
     if ($countErrors == 0) {
         $arrColumns = array("firststat_id", "secondstat_id", "calcop");
         foreach ($arrSavedStats as $key => $statInfo) {
             if ($statInfo['stattype'] == "calculate") {
                 $intFirstStatOrder = $_SESSION['btStatCache'][$key]['firstStat'];
                 $intFirstStatID = $arrSavedStats[$intFirstStatOrder]['gamestats_id'];
                 $intSecondStatOrder = $_SESSION['btStatCache'][$key]['secondStat'];
Example #7
0
<?php

if (!defined("SHOW_PROFILE_MAIN")) {
    exit;
}
// SQUADS
$arrSquads = $member->getSquadList();
$squadObj = new Basic($mysqli, "squads", "squad_id");
$dispSquads = "";
foreach ($arrSquads as $squadID) {
    $squadObj->select($squadID);
    $squadInfo = $squadObj->get_info_filtered();
    if ($squadInfo['logourl'] != "") {
        $dispSquads .= "<a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadID . "'><img src='" . $squadInfo['logourl'] . "' class='squadLogo'></a><div class='dottedLine' style='width: 90%; margin-top: 20px; margin-bottom: 20px'></div>";
    } else {
        $dispSquads .= "<span class='largeFont'><b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadID . "'>" . $squadInfo['name'] . "</a></b><div class='dottedLine' style='width: 90%; margin-top: 20px; margin-bottom: 20px'></div>";
    }
}
if ($dispSquads != "") {
    echo "\n\t\t\t<div class='formTitle' style='text-align: center; margin-top: 20px'>Squads</div>\n\t\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='main' align='center'>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t" . $dispSquads . "\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t";
}
Example #8
0
         $arrColumns = array("newspost", "lasteditmember_id", "lasteditdate");
         $arrValues = array($_POST['message'], $memberInfo['member_id'], $time);
         if ($squadNewsObj->update($arrColumns, $arrValues)) {
             $_POST['cancel'] = true;
         } else {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to database! Please contact the website administrator.<br>";
         }
     }
     if ($countErrors > 0) {
         $_POST = filterArray($_POST);
         $_POST['submit'] = false;
     }
 }
 if (!$_POST['submit'] && !$_POST['cancel']) {
     $squadNewsInfo = $squadNewsObj->get_info_filtered();
     if ($dispError != "") {
         echo "\n\t\t\t\t<div class='errorDiv'>\n\t\t\t\t<strong>Unable to edit shoutbox post because the following errors occurred:</strong><br><br>\n\t\t\t\t{$dispError}\n\t\t\t\t</div>\n\t\t\t\t";
     }
     echo "\n\t\t\t\n\t\t\t\t\t<table class='formTable'>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='formLabel' valign='top'>Message:</td>\n\t\t\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t\t\t<textarea rows='10' cols='55' class='textBox' id='message_" . $squadNewsInfo['squadnews_id'] . "'>" . $squadNewsInfo['newspost'] . "</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='main' align='center' colspan='2'><br><br>\n\t\t\t\t\t\t\t\t<input type='button' onclick=\"saveNewsPost('" . $squadNewsInfo['squad_id'] . "', '" . $squadNewsInfo['squadnews_id'] . "')\" value='Save' class='submitButton' style='width: 90px'><br><br>\n\t\t\t\t\t\t\t\t<a href='javascript:void(0)' onclick=\"cancelEdit('" . $squadNewsInfo['squad_id'] . "', '" . $squadNewsInfo['squadnews_id'] . "')\">Cancel</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t</form>\n\t\t\t\n\t\t\t";
 }
 if ($_POST['cancel']) {
     $squadNewsInfo = $squadNewsObj->get_info_filtered();
     $member->select($squadNewsInfo['member_id']);
     $squadMemberInfo = $member->get_info_filtered();
     if ($squadMemberInfo['avatar'] == "") {
         $squadMemberInfo['avatar'] = $MAIN_ROOT . "themes/" . $THEME . "/images/defaultavatar.png";
     }
     $dispLastEdit = "";
     if ($member->select($squadNewsInfo['lasteditmember_id'])) {
         $dispLastEditTime = getPreciseTime($squadNewsInfo['lasteditdate']);
Example #9
0
        $selectCat = $downloadCatInfo['ordernum'] + 1;
        $afterSelected = "selected";
    } else {
        $selectCat = $downloadCatInfo['ordernum'] - 1;
    }
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory WHERE downloadcategory_id != '" . $downloadCatInfo['downloadcategory_id'] . "' ORDER BY ordernum DESC");
    while ($row = $result->fetch_assoc()) {
        $strSelected = "";
        if ($selectCat == $row['ordernum']) {
            $strSelected = "selected";
        }
        $catOrderOptions .= "<option value='" . $row['downloadcategory_id'] . "' " . $strSelected . ">" . filterText($row['name']) . "</option>";
        $countCategories++;
    }
    if ($countCategories == 0) {
        $catOrderOptions = "<option value='first'>(no other categories)</option>";
    }
    $arrDownloadExts = $downloadCatObj->getExtensions();
    $arrDispDLExts = array();
    foreach ($arrDownloadExts as $extID) {
        $downloadExtensionObj->select($extID);
        $arrDispDLExts[] = $downloadExtensionObj->get_info_filtered("extension");
    }
    $dispDownloadExts = implode(", ", $arrDispDLExts);
    echo "\n\t\n\t\t<form action='console.php?cID=" . $cID . "&catID=" . $_GET['catID'] . "&action=edit' method='post' enctype='multipart/form-data'>\n\t\t\t<div class='formDiv'>\n\t\t";
    if ($dispError != "") {
        echo "\n\t\t<div class='errorDiv'>\n\t\t<strong>Unable to edit download category because the following errors occurred:</strong><br><br>\n\t\t{$dispError}\n\t\t</div>\n\t\t";
    }
    $selectAccessType = $downloadCatInfo['accesstype'] == 1 ? " selected" : "";
    echo "\n\t\t\t\tUse the form below to edit the selected download category.<br><br>\n\t\t\t\t\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Category Name:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' name='catname' class='textBox' value = '" . $downloadCatInfo['name'] . "' style='width: 250px'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Category Order:</td>\n\t\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t\t<select name='beforeafter' class='textBox'><option value='before'>Before</option><option value='after' " . $afterSelected . ">After</option></select><br>\n\t\t\t\t\t\t\t<select name='catorder' class='textBox'>" . $catOrderOptions . "</select>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Extensions: <a href='javascript:void(0)' onmouseover=\"showToolTip('Enter the acceptable extensions for downloads in this category.  Separate multiple extensions with a comma (,).')\" onmouseout='hideToolTip()'>(?)</a></td>\n\t\t\t\t\t\t<td class='main'><input type='text' name='catexts' class='textBox' value='" . $dispDownloadExts . "' style='width: 250px'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Access Type:</td>\n\t\t\t\t\t\t<td class='main'><select name='accesstype' class='textBox'><option value='0'>Everyone</option><option value='1'" . $selectAccessType . ">Members Only</option></select></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='main' colspan='2' align='center'>\n\t\t\t\t\t\t\t<br><br>\n\t\t\t\t\t\t\t<input type='submit' name='submit' value='Edit Download Category' class='submitButton' style='width: 175px'><br><br>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t</form>\n\t\n\t";
}
Example #10
0
$downloadObj = new Download($mysqli);
$downloadCatObj = new DownloadCategory($mysqli);
$downloadExtObj = new Basic($mysqli, "download_extensions", "extension_id");
$cID = $_GET['cID'];
$dispError = "";
$countErrors = 0;
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory WHERE specialkey = '' ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    $arrDownloadCat[] = $row['downloadcategory_id'];
    $dispSelected = isset($_GET['catID']) && $_GET['catID'] == $row['downloadcategory_id'] ? " selected" : "";
    $downloadcatoptions .= "<option value='" . $row['downloadcategory_id'] . "'" . $dispSelected . ">" . $row['name'] . "</option>";
    $downloadCatObj->select($row['downloadcategory_id']);
    $arrExtensions = array();
    foreach ($downloadCatObj->getExtensions() as $downloadExtID) {
        $downloadExtObj->select($downloadExtID);
        $arrExtensions[] = $downloadExtObj->get_info_filtered("extension");
    }
    $dispExtensions = implode(", ", $arrExtensions);
    $downloadCatJS .= "arrCatExtension[" . $row['downloadcategory_id'] . "] = '" . $dispExtensions . "';\n\t";
}
if (count($arrDownloadCat) == 0) {
    echo "\n\t\t<div style='display: none' id='errorBox'>\n\t\t\t<p align='center'>\n\t\t\t\tA download category must be added before adding downloads!\n\t\t\t</p>\n\t\t</div>\n\t\t\n\t\t<script type='text/javascript'>\n\t\t\tpopupDialog('Add Download', '" . $MAIN_ROOT . "members', 'errorBox');\n\t\t</script>\n\t";
    exit;
}
if ($_POST['submit']) {
    // Check Name
    if (trim($_POST['title']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give your download a title.<br>";
    }
    // Check Section
Example #11
0
    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);
    $forumCatID = $boardObj->get_info("forumcategory_id");
    $forumCatObj->select($forumCatID);
    if ($forumCatObj->get_info_filtered("name") != $catName) {
        $catName = $forumCatObj->get_info_filtered("name");
        $catKey = "category_" . $forumCatID;
        $forumBoardOptions[$catKey] = "<b>" . $catName . "</b>";
        $nonSelectableItems[] = $catKey;
    }
    if (($member->hasAccess($consoleObj) || $boardObj->memberIsMod($memberInfo['member_id'])) && $id != $topicInfo['forumboard_id']) {
        $spacing = str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $boardObj->calcBoardDepth());
        $forumBoardOptions[$id] = $spacing . $boardObj->get_info_filtered("name");
    }
}
$i = 0;
$arrComponents = array("selecteditem" => array("type" => "custom", "display_name" => "Selected Topic", "sortorder" => $i++, "html" => "<div class='formInput'><b>" . $postInfo['title'] . "</b></div>"), "moveto" => array("type" => "select", "attributes" => array("class" => "formInput textBox"), "display_name" => "Move To", "validate" => array("RESTRICT_TO_OPTIONS"), "options" => $forumBoardOptions, "sortorder" => $i++, "db_name" => "forumboard_id", "non_selectable_items" => $nonSelectableItems), "postredirect" => array("type" => "checkbox", "attributes" => array("id" => "postRedirect", "class" => "formInput", "checked" => "checked"), "value" => 1, "display_name" => "Post a Redirect", "sortorder" => $i++), "postredirect_top" => array("type" => "custom", "sortorder" => $i++, "html" => "<div id='postRedirectSection'>"), "postredirect_desc" => array("type" => "textarea", "sortorder" => $i++, "attributes" => array("class" => "formInput textBox", "rows" => "5", "cols" => "40"), "display_name" => "Redirect Description", "tooltip" => "Let users know why the topic is being moved.", "value" => "This topic has been moved to [BOARD].\n\n[TOPIC_LINK]"), "postredirect_bottom" => array("type" => "custom", "sortorder" => $i++, "html" => "</div>"), "submit" => array("type" => "submit", "value" => "Move Topic", "sortorder" => $i++, "attributes" => array("class" => "submitButton formSubmitButton")));
$setupFormArgs = array("name" => "console-" . $cID, "components" => $arrComponents, "description" => "Use the form below to move the selected topic.", "saveObject" => $boardObj->objTopic, "saveMessage" => "Successfully Moved Topic!", "saveType" => "update", "saveLink" => $MAIN_ROOT . "forum/viewtopic.php?tID=" . $topicInfo['forumtopic_id'], "attributes" => array("action" => $MAIN_ROOT . "members/console.php?cID=" . $cID . "&topicID=" . $topicInfo['forumtopic_id'], "method" => "post"), "afterSave" => array("post_topic_redirect"));
function post_topic_redirect()
{
Example #12
0
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$diplomacyRequestsCID = $consoleObj->findConsoleIDByName("View Diplomacy Requests");
$consoleObj->select($diplomacyRequestsCID);
$diplomacyRequestObj = new Basic($mysqli, "diplomacy_request", "diplomacyrequest_id");
if ($member->authorizeLogin($_SESSION['btPassword']) && $diplomacyRequestObj->select($_POST['reqID']) && $member->hasAccess($consoleObj)) {
    $diplomacyRequestInfo = $diplomacyRequestObj->get_info_filtered();
    if (isset($_POST['confirmDecline'])) {
        // Send E-mail Confirmation
        $emailTo = $diplomacyRequestInfo['email'];
        $emailFrom = "*****@*****.**";
        $emailSubject = $websiteInfo['clanname'] . " - Diplomacy Request: Declined";
        $emailMessage = "\nHi " . $diplomacyRequestInfo['name'] . ",\n\n\n\t\t\nYour diplomacy request has been declined.\n\n\n-" . $websiteInfo['clanname'];
        //mail($emailTo, $emailSubject, $emailMessage, "From: ".$emailFrom);
        $diplomacyRequestObj->delete();
        include "diplomacyrequests.php";
        $member->logAction("Declined " . $diplomacyRequestInfo['clanname'] . "'s diplomacy request.");
    } else {
        echo "\n\t\t\t<div id='confirmDialogBox' style='display: none'>\n\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\tAre you sure you want to decline <b>" . $diplomacyRequestInfo['clanname'] . "'s</b> diplomacy request?\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<script type='text/javascript'>\n\t\t\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\$('#confirmDialogBox').dialog({\n\t\t\t\t\t\n\t\t\t\t\t\ttitle: 'Decline Diplomacy Request',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'Yes': function() {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/diplomacy/include/declinerequest.php', { reqID: " . $_POST['reqID'] . ", confirmDecline: 1 }, function(data) {\n\t\t\t\t\t\t\t\t\t\$('#diplomacyRequests').fadeOut(250);\n\t\t\t\t\t\t\t\t\t\$('#diplomacyRequests').html(data);\n\t\t\t\t\t\t\t\t\t\$('#diplomacyRequests').fadeIn(250);\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\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'Cancel': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\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\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\n\t\t\t</script>\n\t\t\n\t\t";
    }
}
Example #13
0
    $memberInfo = $member->get_info();
    $consoleObj->select($_GET['cID']);
    if (!$member->hasAccess($consoleObj)) {
        exit;
    }
}
if (!$member->requestedIA()) {
    $i = 1;
    $arrComponents = array("reason" => array("display_name" => "Reason", "type" => "textarea", "tooltip" => "Leave a reason and for how long you will be inactive for a better chance of being approved.", "attributes" => array("class" => "textBox formInput", "style" => "width: 35%", "rows" => "4"), "db_name" => "reason", "sortorder" => $i++), "submit" => array("value" => "Send Request", "attributes" => array("class" => "submitButton formSubmitButton"), "sortorder" => $i++, "type" => "submit"));
    $requestIAObj = new Basic($mysqli, "iarequest", "iarequest_id");
    $setupFormArgs = array("name" => "console-" . $cID, "components" => $arrComponents, "saveObject" => $requestIAObj, "saveType" => "add", "saveAdditional" => array("member_id" => $memberInfo['member_id'], "requestdate" => time()), "saveMessage" => "Inactive Request Sent!", "attributes" => array("action" => $MAIN_ROOT . "members/console.php?cID=" . $cID, "method" => "post"), "description" => "Use the form below to request to be inactive.  When inactive, you will be able to log in, however you will not have access to any console options.  A higher ranking member will have to approve your request before your status is set to inactive.");
} else {
    // Already requested to be inactive
    $iaRequestObj = new Basic($mysqli, "iarequest", "iarequest_id");
    $iaRequestObj->select($member->requestedIA(true));
    $requestInfo = $iaRequestObj->get_info_filtered();
    $dispRequestStatus = "<span class='pendingFont'>Pending</span>";
    $dispSendMessages = " You may send additional messages using the form below.";
    if ($requestInfo['requeststatus'] == 1) {
        $member->select($requestInfo['reviewer_id']);
        $dispRequestStatus = "<span class='allowText'>Approved</span> by " . $member->getMemberLink() . " - " . getPreciseTime($requestInfo['reviewdate']);
        $member->select($memberInfo['member_id']);
        $dispSendMessages = "  A higher ranking member must delete the request before you can issue another request.";
    } elseif ($requestInfo['requeststatus'] == 2) {
        $member->select($requestInfo['reviewer_id']);
        $dispRequestStatus = "<span class='denyText'>Denied</span> by " . $member->getMemberLink() . " - " . getPreciseTime($requestInfo['reviewdate']);
        $member->select($memberInfo['member_id']);
        $dispSendMessages = "  A higher ranking member must delete the request before you can issue another one.";
    }
    $i = 1;
    $arrComponents = array("requestinfosection" => array("type" => "section", "sortorder" => $i++, "options" => array("section_title" => "Request Information:")), "requestdate" => array("display_name" => "Request Date", "type" => "custom", "html" => "<div class='formInput'>" . getPreciseTime($requestInfo['requestdate']) . "</div>", "sortorder" => $i++), "status" => array("display_name" => "Status", "type" => "custom", "html" => "<div class='formInput'>" . $dispRequestStatus . "</div>", "sortorder" => $i++), "reason" => array("display_name" => "Reason", "type" => "custom", "html" => "<div class='formInput'>" . nl2br($requestInfo['reason']) . "</div>", "sortorder" => $i++), "messagessection" => array("type" => "section", "sortorder" => $i++, "options" => array("section_title" => "Messages:")), "messages" => array("type" => "custom", "sortorder" => $i++, "html" => "<div id='loadingSpiral' style='display: none'><p align='center' class='main'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral2.gif'><br>Loading</p></div><div id='iaMessages'></div>"));
 */
if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") {
    include_once "../../../../_setup.php";
    include_once "../../../../classes/member.php";
    include_once "../../../../classes/basicorder.php";
    $consoleObj = new ConsoleOption($mysqli);
    $member = new Member($mysqli);
    $member->select($_SESSION['btUsername']);
    $cID = $consoleObj->findConsoleIDByName("View Member Applications");
    $consoleObj->select($cID);
    if (!$member->authorizeLogin($_SESSION['btPassword']) || !$member->hasAccess($consoleObj)) {
        exit;
    }
}
$diplomacyStatusObj = new Basic($mysqli, "diplomacy_status", "diplomacystatus_id");
$addClanCID = $consoleObj->findConsoleIDByName("Diplomacy: Add a Clan");
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "diplomacy_request WHERE confirmemail = '1'");
while ($row = $result->fetch_assoc()) {
    $row = filterArray($row);
    foreach ($row as $key => $value) {
        if ($value == "") {
            $row[$key] = "Not Set";
        }
    }
    $diplomacyStatusObj->select($row['diplomacystatus_id']);
    $dispRequestStatus = $diplomacyStatusObj->get_info_filtered("name");
    echo "\n\t\t<div class='dottedBox' style='margin-top: 20px; width: 90%; margin-left: auto; margin-right: auto;'>\n\t\t\t<table class='formTable' style='width: 95%'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Submitted By:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $row['name'] . " (<a href='mailto:" . $row['email'] . "'>" . $row['email'] . "</a>)</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel'>Date Submitted:</td>\n\t\t\t\t\t<td class='main'>" . getPreciseTime($row['dateadded']) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Clan Name:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $row['clanname'] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Clan Leaders:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $row['leaders'] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Requested Status:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $dispRequestStatus . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Clan Tag:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $row['clantag'] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Games Played:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . $row['gamesplayed'] . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Website:</td>\n\t\t\t\t\t<td class='main' valign='top'><a href='" . $row['website'] . "' target='_blank'>" . $row['website'] . "</a></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Clan Size:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . ucfirst($row['clansize']) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='formLabel' valign='top'>Message:</td>\n\t\t\t\t\t<td class='main' valign='top'>" . nl2br($row['message']) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class='main' align='center' colspan='2'>\n\t\t\t\t\t\t<br>\n\t\t\t\t\t\t<b><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $addClanCID . "&reqID=" . $row['diplomacyrequest_id'] . "'>Add Clan</a></b> - <b><a href='javascript:void(0)' onclick=\"declineRequest('" . $row['diplomacyrequest_id'] . "')\">Decline</a></b>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\n\t\t</div>\n\t";
}
if ($result->num_rows == 0) {
    echo "\n\t\t<div class='shadedBox' style='width: 400px; margin-top: 50px; margin-left: auto; margin-right: auto'>\n\t\t\t<p class='main' align='center'>\n\t\t\t\t<i>There are currently no diplomacy requests.</i>\n\t\t\t</p>\n\t\t</div>\n\t";
}
Example #15
0
 * Author: Bluethrust Web Development
 * E-mail: support@bluethrust.com
 * Website: http://www.bluethrust.com
 *
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../../_setup.php";
include_once "../../../../classes/member.php";
include_once "../../../../classes/consoleoption.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Custom Form Pages");
$consoleObj->select($cID);
$customPageObj = new Basic($mysqli, "custompages", "custompage_id");
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $customPageObj->select($_POST['cpID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $customPageInfo = $customPageObj->get_info_filtered();
        if ($_POST['confirm'] == "1") {
            $customPageObj->delete();
            include "main.php";
        } else {
            echo "<p align='center'>Are you sure you want to delete the custom page <b>" . $customPageInfo['pagename'] . "</b>?";
        }
    } elseif (!$customPageObj->select($_POST['cpID'])) {
        echo "<p align='center'>Unable find the selected custom page.  Please try again or contact the website administrator.</p>";
    }
}
Example #16
0
<?php

if (!defined("SHOW_PROFILE_MAIN")) {
    exit;
}
// GAMES PLAYED
$gameObj = new Game($mysqli);
$gameStatObj = new Basic($mysqli, "gamestats", "gamestats_id");
$dispGamesPlayed = "";
$arrGames = $gameObj->getGameList();
foreach ($arrGames as $gameID) {
    if ($member->playsGame($gameID)) {
        $gameObj->select($gameID);
        $dispGameStats = "";
        $arrGameStats = $gameObj->getAssociateIDs("ORDER BY ordernum");
        foreach ($arrGameStats as $gameStatID) {
            $gameStatObj->select($gameStatID);
            if ($gameStatObj->get_info_filtered("hidestat") == 0) {
                if ($gameStatObj->get_info_filtered("stattype") == "calculate") {
                    $dispGameStats .= "<b>" . $gameStatObj->get_info_filtered("name") . ":</b> " . $gameObj->calcStat($gameStatID, $member) . "<br>";
                } else {
                    $dispGameStats .= "<b>" . $gameStatObj->get_info_filtered("name") . ":</b> " . $member->getGameStatValue($gameStatID) . "<br>";
                }
            }
        }
        $dispGamesPlayed .= "\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td class='profileLabel alternateBGColor' valign='top'>\n\t\t\t\t\t\t\t\t" . $gameObj->get_info_filtered("name") . ":\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class='main' style='padding-left: 10px' valign='top'>\n\t\t\t\t\t\t\t\t" . $dispGameStats . "<br>\t\t\t\t\t\t\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t";
    }
}
if ($dispGamesPlayed != "") {
    echo "\n\n\t\t\t\t\t<div class='formTitle' style='text-align: center; margin-top: 20px'>Game Statistics</div>\n\t\t\t\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t\t\t\t\t" . $dispGamesPlayed . "</table>";
}
Example #17
0
$arrPrivileges = $memberRank->get_privileges();
$arrConsoleCats = array();
$consoleSettingObj = new ConsoleOption($mysqli);
foreach ($arrPrivileges as $consoleOptionID) {
    $consoleSettingObj->select($consoleOptionID);
    $consoleCatID = $consoleSettingObj->get_info("consolecategory_id");
    if (!in_array($consoleCatID, $arrConsoleCats)) {
        $consoleCatSettingObj->select($consoleCatID);
        $consoleCatOrder = $consoleCatSettingObj->get_info("ordernum");
        $arrConsoleCats[$consoleCatOrder] = $consoleCatID;
    }
}
krsort($arrConsoleCats);
foreach ($arrConsoleCats as $value) {
    $consoleCatSettingObj->select($value);
    $defaultConsoleOptions[$value] = $consoleCatSettingObj->get_info_filtered("name");
}
// Setup Notification Settings Options
$notificationOptions = array("Show notification with sound", "Show notification without sound", "Don't show notifications");
// Setup Forum Settings Options
$forumPostsPerPage = array(10 => 10, 25 => 25, 50 => 50, 75 => 75, 100 => 100);
// Setup Birthday
$maxBirthdayYear = date("Y") - 8;
$maxDate = mktime(0, 0, 0, 12, 31, $maxBirthdayYear);
$maxBirthdayDate = "new Date(" . date("Y", $maxDate) . ",12,31)";
$defaultBirthdayDate = "";
if ($memberInfo['birthday'] != 0) {
    $bdayDate = new DateTime();
    $bdayDate->setTimestamp($memberInfo['birthday']);
    $bdayDate->setTimezone(new DateTimeZone("UTC"));
    $dispBirthdayDate = $bdayDate->format("M j, Y");
Example #18
0
 function getMemberLink($args = array("color" => true))
 {
     global $MAIN_ROOT;
     $returnVal = "";
     if ($this->intTableKeyValue != "" && is_numeric($this->intTableKeyValue)) {
         $memberRank = new Rank($this->MySQL);
         $memberRankCat = new Basic($this->MySQL, "rankcategory", "rankcategory_id");
         $memberInfo = $this->get_info_filtered();
         $memberRank->select($memberInfo['rank_id']);
         $rankInfo = $memberRank->get_info_filtered();
         $memberRankCat->select($rankInfo['rankcategory_id']);
         $memberColor = $memberRankCat->get_info_filtered("color");
         if ($args['color']) {
             $returnVal = "<span style='color: " . $rankInfo['color'] . "'><a href='" . $MAIN_ROOT . "profile.php?mID=" . $memberInfo['member_id'] . "' style='color: " . $memberColor . "' title='" . $memberInfo['username'] . "'>" . $memberInfo['username'] . "</a></span>";
         } else {
             $returnVal = "<a href='" . MAIN_ROOT . "profile.php?mID=" . $this->intTableKeyValue . "'>" . $memberInfo['username'] . "</a>";
         }
         if ($args['wrapper'] === false) {
             $returnVal = MAIN_ROOT . "profile.php?mID=" . $this->intTableKeyValue;
         }
     }
     return $returnVal;
 }
Example #19
0
include $prevFolder . "themes/" . $THEME . "/_header.php";
$member = new Member($mysqli);
$breadcrumbObj->setTitle("Top Players: " . $gameInfo['name']);
$breadcrumbObj->addCrumb("Home", $MAIN_ROOT);
$breadcrumbObj->addCrumb("Top Players: " . $gameInfo['name']);
include $prevFolder . "include/breadcrumb.php";
$gameStatObj = new Basic($mysqli, "gamestats", "gamestats_id");
$arrGameStats = $gameObj->getAssociateIDs("ORDER BY ordernum");
if (count($arrGameStats) > 0) {
    if (isset($_GET['sID']) && in_array($_GET['sID'], $arrGameStats) && $gameStatObj->select($_GET['sID'])) {
        $gameStatObj->select($_GET['sID']);
    } else {
        $gameStatObj->select($arrGameStats[0]);
        $_GET['sID'] = $arrGameStats[0];
    }
    $gameStatInfo = $gameStatObj->get_info_filtered();
    $arrMemberList = $gameObj->getMembersWhoPlayThisGame();
    $arrTopPlayers = array();
    foreach ($arrMemberList as $memberID) {
        $member->select($memberID);
        if ($gameStatInfo['stattype'] == "calculate") {
            $arrTopPlayers[$memberID] = $gameObj->calcStat($_GET['sID'], $member);
        } else {
            $arrTopPlayers[$memberID] = $member->getGameStatValue($_GET['sID']);
        }
    }
    if ($_GET['sort'] != "up") {
        $dispSort = "<a href='" . $MAIN_ROOT . "top-players/game.php?gID=" . $_GET['gID'] . "&sID=" . $_GET['sID'] . "&sort=up'><img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/downarrow.png'></a>";
        $_GET['sort'] = "down";
        arsort($arrTopPlayers);
    } else {
Example #20
0
<?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 "../../../../_setup.php";
include_once "../../../../classes/member.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$manageClanCID = $consoleObj->findConsoleIDByName("Diplomacy: Manage Clans");
$consoleObj->select($manageClanCID);
$diplomacyClanObj = new Basic($mysqli, "diplomacy", "diplomacy_id");
if ($member->authorizeLogin($_SESSION['btPassword']) && $diplomacyClanObj->select($_POST['dClanID']) && $member->hasAccess($consoleObj)) {
    $dClanName = $diplomacyClanObj->get_info_filtered("clanname");
    if (isset($_POST['confirmDelete'])) {
        $diplomacyClanObj->delete();
        $member->logAction("Deleted " . $dClanName . " from the diplomacy page.");
        include "main_manageclans.php";
    } else {
        echo "<p class='main' align='center'>Are you sure you want to delete " . $dClanName . " from the diplomacy page?</p>";
    }
}
Example #21
0
                }
            }
        }
    }
}
// Setup Form
$i = 1;
$arrComponents = array();
foreach ($arrGames as $gameID) {
    $gameObj->select($gameID);
    $arrGameStats = $gameObj->getAssociateIDs("ORDER BY ordernum");
    if ($member->playsGame($gameID) && count($arrGameStats) > 0) {
        $arrComponents['customsection_' . $gameID] = array("type" => "section", "options" => array("section_title" => $gameObj->get_info_filtered("name")), "sortorder" => $i++);
        foreach ($arrGameStats as $gameStatsID) {
            $gameStatsObj->select($gameStatsID);
            $gameStatsInfo = $gameStatsObj->get_info_filtered();
            if ($gameStatsInfo['stattype'] == "input") {
                $textBoxWidth = array("style" => "width: 5%");
                $blnText = false;
                if ($gameStatsInfo['textinput'] == 1) {
                    $textBoxWidth = array();
                    $blnText = true;
                }
                $gameStatValue = $member->getGameStatValue($gameStatsID, $blnText);
                $arrComponents['stat_' . $gameStatsID] = array("display_name" => $gameStatsInfo['name'], "attributes" => array_merge(array("class" => "formInput textBox"), $textBoxWidth), "value" => $gameStatValue, "sortorder" => $i++);
            }
        }
    }
}
$additionalNote = "";
if ($i == 1) {
Example #22
0
 * License: http://www.bluethrust.com/license.php
 *
 */
include_once "../../../_setup.php";
include_once "../../../classes/member.php";
include_once "../../../classes/rank.php";
include_once "../../../classes/news.php";
// Start Page
$consoleObj = new ConsoleOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage News");
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$memberInfo = $member->get_info_filtered();
$commentObj = new Basic($mysqli, "comments", "comment_id");
$newsObj = new News($mysqli);
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj) && $commentObj->select($_POST['commentID'])) {
    $commentInfo = $commentObj->get_info_filtered();
    $newsObj->select($commentInfo['news_id']);
    $newsInfo = $newsObj->get_info_filtered();
    $member->select($commentInfo['member_id']);
    $posterInfo = $member->get_info_filtered();
    $logMessage = "Deleted comment by " . $member->getMemberLink() . " on news post: <b><a href='" . $MAIN_ROOT . "news/viewpost.php?nID=" . $newsInfo['news_id'] . "'>" . $newsInfo['postsubject'] . "</a></b>";
    $member->select($memberInfo['member_id']);
    $member->logAction($logMessage);
    $commentObj->delete();
    $arrComments = $newsObj->getComments();
    $commentCount = $newsObj->countComments();
}
include "../../../news/comments.php";
echo "\n\t<script type='text/javascript'>\n\t\t\$(document).ready(function() {\n\t\t\t\$('#commentCount').html('" . $commentCount . "');\n\t\t});\n\t</script>\n";
Example #23
0
    if (!in_array($_POST['status'], $allowedStatuses) || !$diplomacyStatusObj->select($_POST['status'])) {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid status.<br>";
        $countErrors++;
    }
    // Check Clan Size
    $allowedSizes = array("large", "medium", "small");
    if (!in_array($_POST['clansize'], $allowedSizes)) {
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid clan size.<br>";
        $countErrors++;
    }
    if ($countErrors == 0) {
        $arrColumns = array("clanname", "diplomacystatus_id", "website", "clansize", "clantag", "skill", "gamesplayed", "extrainfo", "leaders");
        $arrValues = array($_POST['clanname'], $_POST['status'], $_POST['website'], $_POST['clansize'], $_POST['tag'], $_POST['skill'], $_POST['gamesplayed'], $_POST['extrainfo'], $_POST['leaders']);
        if ($diplomacyClanObj->update($arrColumns, $arrValues)) {
            echo "\n\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully edited " . $diplomacyClanObj->get_info_filtered("clanname") . "'s information!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Edit Clan', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
            $member->logAction("Edited " . $_POST['clanname'] . " diplomacy page information.  Set status to " . $diplomacyStatusObj->get_info_filtered("name"));
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.<br>";
        }
    }
    if ($countErrors > 0) {
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    echo "<div class='formDiv'>";
    if ($dispError != "") {
        echo "\n\t\t<div class='errorDiv'>\n\t\t<strong>Unable to edit clan information because the following errors occurred:</strong><br><br>\n\t\t{$dispError}\n\t\t</div>\n\t\t";
    }
    echo "\n\t\n\t\t\t<form action='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&dID=" . $_GET['dID'] . "&action=edit' method='post'>\n\t\t\t\tUse the form below to edit " . $diplomacyClanInfo['clanname'] . "'s information for the diplomacy page.<br><br>\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Clan Name:</td>\n\t\t\t\t\t\t<td class='main'><input type='text' name='clanname' value='" . $diplomacyClanInfo['clanname'] . "' class='textBox' style='width: 150px'></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Status:</td>\n\t\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t\t<select name='status' class='textBox'>\n\t\t\t\t\t\t\t";
Example #24
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>";
}
Example #25
0
 if (!in_array($_POST['status'], $allowedStatuses) || !$diplomacyStatusObj->select($_POST['status'])) {
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid status.<br>";
     $countErrors++;
 }
 // Check Clan Size
 $allowedSizes = array("large", "medium", "small");
 if (!in_array($_POST['clansize'], $allowedSizes)) {
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid clan size.<br>";
     $countErrors++;
 }
 if ($countErrors == 0) {
     $diplomacyObj = new Basic($mysqli, "diplomacy", "diplomacy_id");
     $arrColumns = array("member_id", "dateadded", "clanname", "diplomacystatus_id", "website", "clansize", "clantag", "skill", "gamesplayed", "extrainfo", "leaders");
     $arrValues = array($memberInfo['member_id'], time(), $_POST['clanname'], $_POST['status'], $_POST['website'], $_POST['clansize'], $_POST['tag'], $_POST['skill'], $_POST['gamesplayed'], $_POST['extrainfo'], $_POST['leaders']);
     if ($diplomacyObj->addNew($arrColumns, $arrValues)) {
         echo "\n\t\t\t\n\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\tSuccessfully added " . $diplomacyObj->get_info_filtered("clanname") . " to the diplomacy page!\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Add New Clan', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t\n\t\t\t";
         $member->logAction("Added " . $_POST['clanname'] . " to the diplomacy page with " . $diplomacyStatusObj->get_info_filtered("name") . " status.");
         if (isset($_POST['reqID']) && $diplomacyRequestObj->select($_POST['reqID'])) {
             $diplomacyRequestInfo = $diplomacyRequestObj->get_info_filtered();
             $dispStatus = $arrDiplomacyStatus[$_POST['status']];
             // Send E-mail Confirmation
             $emailTo = $diplomacyRequestInfo['email'];
             $emailFrom = "*****@*****.**";
             $emailSubject = $websiteInfo['clanname'] . " - Diplomacy Request: Accepted";
             $emailMessage = "\nHi " . $diplomacyRequestInfo['name'] . ",\n\n\n\t\t\t\t\nYour diplomacy request has been accepted.  Your clan has been given the status of " . $dispStatus . ".\n\n\nThanks,\n\n" . $websiteInfo['clanname'];
             mail($emailTo, $emailSubject, $emailMessage, "From: " . $emailFrom);
             $diplomacyRequestObj->delete();
         }
     } else {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.<br>";