Esempio n. 1
0
 public function addNew($arrColumns, $arrValues)
 {
     $returnVal = false;
     $addNew = parent::addNew($arrColumns, $arrValues);
     if ($addNew) {
         $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "forum_topicseen WHERE forumtopic_id = '" . $this->arrObjInfo['forumtopic_id'] . "'");
         $this->MySQL->query("OPTIMIZE TABLE `" . $this->MySQL->get_tablePrefix() . "forum_topicseen`");
         $returnVal = true;
     }
     return $returnVal;
 }
Esempio n. 2
0
 public function setMemberProfile()
 {
     $arrProfileValues = $this->getAppValues(true);
     if (count($arrProfileValues) > 0) {
         foreach ($arrProfileValues as $componentID => $profileItem) {
             $this->objAppComponent->select($componentID);
             $arrSelectValueID = $this->objAppComponent->getAssociateIDs("ORDER BY componentvalue");
             $this->objAppComponent->appSelectValueObj->select($arrSelectValueID[0]);
             $componentValue = $this->objAppComponent->appSelectValueObj->get_info("componentvalue");
             switch ($componentValue) {
                 case "birthday":
                 case "maingame":
                 case "recruiter":
                     $columnName = $componentValue == "maingame" ? "maingame_id" : $componentValue;
                     $this->objMember->update(array($columnName), array($profileItem['values'][0]));
                     break;
                 case "gamesplayed":
                     $gameMemberObj = new Basic($this->MySQL, "gamesplayed_members", "gamemember_id");
                     foreach ($profileItem['values'] as $gameID) {
                         $gameMemberObj->addNew(array("member_id", "gamesplayed_id"), array($this->objMember->get_info("member_id"), $gameID));
                     }
                     break;
                 default:
                     $this->objMember->setProfileValue($componentValue, $profileItem['values'][0]);
                     break;
             }
         }
     }
 }
Esempio n. 3
0
 // No errors after adding the image. Add game to database.
 $newGame = new Basic($mysqli, "gamesplayed", "gamesplayed_id");
 $arrColumns = array("name", "imageurl", "imagewidth", "imageheight", "ordernum");
 $arrValues = array($_POST['gamename'], $gameImageURL, $_POST['gameimagewidth'], $_POST['gameimageheight'], $intGameOrderNum);
 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) {
Esempio n. 4
0
}
$cID = $_GET['cID'];
$customPageObj = new Basic($mysqli, "custompages", "custompage_id");
$countErrors = 0;
$dispError = "";
if ($_POST['submit']) {
    if (trim($_POST['pagename']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a page name for your custom page.<br>";
    }
    if ($countErrors == 0) {
        $_POST['wysiwygHTML'] = str_replace("<?", "", $_POST['wysiwygHTML']);
        $_POST['wysiwygHTML'] = str_replace("?>", "", $_POST['wysiwygHTML']);
        $_POST['wysiwygHTML'] = str_replace("&lt;?", "", $_POST['wysiwygHTML']);
        $_POST['wysiwygHTML'] = str_replace("?&gt;", "", $_POST['wysiwygHTML']);
        if ($customPageObj->addNew(array("pagename", "pageinfo"), array($_POST['pagename'], $_POST['wysiwygHTML']))) {
            $intManageCustomPagesID = $consoleObj->findConsoleIDByName("Manage Custom Pages");
            $customPageInfo = $customPageObj->get_info();
            echo "\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 Custom Page: <b>" . $customPageInfo['pagename'] . "</b>!\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 Custom Pages', '" . $MAIN_ROOT . "members/console.php?cID=" . $intManageCustomPagesID . "&cpID=" . $customPageInfo['custompage_id'] . "&action=edit', 'successBox');\n\t\t\t\t</script>\n\t\t\t";
        } else {
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to add custom page.  Please try again!<br>";
            $_POST['submit'] = false;
            $_POST['wysiwygHTML'] = addslashes($_POST['wysiwygHTML']);
        }
    } else {
        $_POST['submit'] = false;
        $_POST['wysiwygHTML'] = addslashes($_POST['wysiwygHTML']);
    }
}
if (!$_POST['submit']) {
    $addMenuItemCID = $consoleObj->findConsoleIDByName("Add Menu Item");
Esempio n. 5
0
 function logAction($message = "")
 {
     $returnVal = false;
     if ($this->intTableKeyValue != "") {
         $logObj = new Basic($this->MySQL, "logs", "log_id");
         $arrColumns = array("member_id", "logdate", "message", "ipaddress");
         $arrValues = array($this->intTableKeyValue, time(), $message, $_SERVER['REMOTE_ADDR']);
         if ($logObj->addNew($arrColumns, $arrValues)) {
             $returnVal = true;
         }
     }
     return $returnVal;
 }
Esempio n. 6
0
$consoleObj->select($cID);
$consoleInfo = $consoleObj->get_info_filtered();
$consoleTitle = $consoleInfo['pagetitle'];
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$squadObj = new Squad($mysqli);
$arrSquadPrivileges = $squadObj->arrSquadPrivileges;
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    $LOGIN_FAIL = false;
    $memberInfo = $member->get_info_filtered();
    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";
Esempio n. 7
0
            $char = strtoupper($value);
        }
        if (is_numeric($char)) {
            unset($arrFonts[1]);
            if ($char == 0) {
                unset($arrFonts[0]);
            } elseif ($char == 3) {
                unset($arrFonts[3]);
            } elseif ($char == 9) {
                unset($arrFonts[2]);
            }
        } elseif (strtolower($char) == "s") {
            unset($arrFonts[3]);
        }
        shuffle($arrFonts);
        $randFontNum = rand(0, count($arrFonts) - 1);
        $randFont = $arrFonts[$randFontNum];
        $randNum2 = rand(0, 8);
        if ($appComponentObj->get_info("componenttype") == "captchaextra") {
            $xCoord = $counter == 0 ? 10 : 55 * $counter;
            imagettftext($im, 70, rand(0, 20), $xCoord, 80, $blackAlpha, $distortFont, $arrDistort[$randNum2]);
        }
        $xCoord = $counter == 0 ? 10 : 55 * $counter;
        imagettftext($im, 50, rand(-5, 5), $xCoord, 70, $black, $randFont, $char);
        $counter++;
        $finalCaptchaText .= $char;
    }
    $captchaObj->addNew(array("appcomponent_id", "ipaddress", "captchatext"), array($appCompInfo['appcomponent_id'], $IP_ADDRESS, strtolower($finalCaptchaText)));
    imagepng($im);
    imagedestroy($im);
}
Esempio n. 8
0
function saveAdditionalPostData()
{
    global $formObj, $blnPostReply, $boardObj, $mysqli, $topicInfo;
    if (!$blnPostReply) {
        // New Topic
        $postInfo = $boardObj->objPost->get_info();
        $arrColumns = array("forumboard_id", "forumpost_id", "lastpost_id");
        $arrValues = array($_GET['bID'], $postInfo['forumpost_id'], $postInfo['forumpost_id']);
        $boardObj->objTopic->addNew($arrColumns, $arrValues);
        $boardObj->objPost->update(array("forumtopic_id"), array($boardObj->objTopic->get_info("forumtopic_id")));
    } else {
        $boardObj->objPost->update(array("forumtopic_id"), array($topicInfo['forumtopic_id']));
        $newReplies = $topicInfo['replies'] + 1;
        $boardObj->objTopic->update(array("replies", "lastpost_id"), array($newReplies, $boardObj->objPost->get_info("forumpost_id")));
    }
    $formObj->saveLink = $boardObj->objPost->getLink();
    $arrDownloadID = checkForAttachments();
    if (is_array($arrDownloadID)) {
        $forumAttachmentObj = new Basic($mysqli, "forum_attachments", "forumattachment_id");
        foreach ($arrDownloadID as $downloadID) {
            $forumAttachmentObj->addNew(array("download_id", "forumpost_id"), array($downloadID, $boardObj->objPost->get_info("forumpost_id")));
        }
    }
}
 $consoleObj = new ConsoleOption($mysqli);
 $member = new Member($mysqli);
 $member->select($_SESSION['btUsername']);
 $cID = $consoleObj->findConsoleIDByName("View Inactive Requests");
 $consoleObj->select($cID);
 if (!$member->authorizeLogin($_SESSION['btPassword']) || !$member->hasAccess($consoleObj)) {
     exit;
 }
 $memberInfo = $member->get_info_filtered();
 $iaRequestObj = new Basic($mysqli, "iarequest", "iarequest_id");
 $checkRequestID = $iaRequestObj->select($_POST['iaRequestID']);
 if ($_POST['action'] == "postmessage" && trim($_POST['message']) != "" && $checkRequestID) {
     $iaRequestMessageObj = new Basic($mysqli, "iarequest_messages", "iamessage_id");
     $arrColumns = array("iarequest_id", "member_id", "messagedate", "message");
     $arrValues = array($iaRequestObj->get_info("iarequest_id"), $memberInfo['member_id'], time(), $_POST['message']);
     $iaRequestMessageObj->addNew($arrColumns, $arrValues);
     echo dispIAMessages($iaRequestObj->get_info("iarequest_id"));
     $requestIACID = $consoleObj->findConsoleIDByName("Inactive Request");
     $member->select($iaRequestObj->get_info("member_id"));
     $member->postNotification("A new message was posted on your inactive request!<br><br><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $requestIACID . "'>View Messages</a>");
     exit;
 } elseif (($_POST['action'] == "approve" || $_POST['action'] == "deny") && $checkRequestID) {
     $requestStatus = $_POST['action'] == "approve" ? 1 : 2;
     $iaRequestObj->update(array("reviewer_id", "reviewdate", "requeststatus"), array($memberInfo['member_id'], time(), $requestStatus));
     if ($requestStatus == 1) {
         $member->select($iaRequestObj->get_info("member_id"));
         $member->update(array("onia", "inactivedate"), array(1, time()));
         $member->postNotification("Your inactive request was approved!");
     } else {
         $member->select($iaRequestObj->get_info("member_id"));
         $member->update(array("onia", "inactivedate"), array(0, 0));
Esempio n. 10
0
     }
     // Check Starting Rank
     if ($squadObj->memberHasAccess($memberInfo['member_id'], "setrank")) {
         if (!$squadObj->objSquadRank->select($_POST['startingrank']) || $_POST['startingrank'] == $intFounderRankID) {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid starting rank!";
         }
     } else {
         $startRankKey = max(array_keys($squadRankList));
         $_POST['startingrank'] = $squadRankList[$startRankKey];
     }
     if ($countErrors == 0) {
         $arrColumns = array("squad_id", "sender_id", "receiver_id", "datesent", "message", "startingrank_id");
         $arrValues = array($squadInfo['squad_id'], $memberInfo['member_id'], $intNewMemberID, time(), $_POST['message'], $_POST['startingrank']);
         $squadInviteObj = new Basic($mysqli, "squadinvites", "squadinvite_id");
         if ($squadInviteObj->addNew($arrColumns, $arrValues)) {
             $intViewSquadInvitesCID = $consoleObj->findConsoleIDByName("View Squad Invitations");
             $member->postNotification("You have received a squad invitation from <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b>!<br><br><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $intViewSquadInvitesCID . "'>Click Here</a> to view your Squad Invitations.");
             echo "\n\t\t\t\t\n\t\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 Sent Squad Invitation to " . $member->getMemberLink() . "!\n\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\tpopupDialog('Send Squad Invite', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t";
         } 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']) {
     $sqlMemberList = "('" . implode("','", $squadMemberList) . "')";
Esempio n. 11
0
    $time = time();
    if ($memberObj->select($username)) {
        if ($memberObj->get_info("email") == $email) {
            $emailvalid = true;
        } else {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Email Address Not Valid.<br>";
        }
    } else {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Username Not Valid.<br>";
    }
    if ($countErrors == 0) {
        $arrayCol = array('username', 'email', 'changekey', 'timeofrq');
        $arrayVal = array($username, $email, $changekey, $time);
        $forgotPassObj->addNew($arrayCol, $arrayVal);
        $subject = 'Your Forgotten Password Request - ' . $CLAN_NAME;
        $message = "\n<html>\n<body>\nHello,<br>\nYou've requested a change in your password on the clan website.<br>\n<br>\nPlease click the following link to continue and follow the instructions on the page it opens:<br>\n--------------------------------------------<br>\n<a href='{$url}?stage=validate&changekey={$changekey}'>{$url}?stage=validate&changekey={$changekey}</a><br>\n<br>\nThanks!\n";
        $headers = 'MIME-Version: 1.0' . "\r\n";
        $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
        $headers .= 'From: ' . $CLAN_NAME . ' <no-reply@' . $siteDomain . '>' . "\r\n";
        mail($email, $subject, $message, $headers);
        echo "\n<div class='formDiv'>\nYour request has been successfully submitted. Please check your email for the link and further instructions.\n</div>\n";
    }
} elseif ($stage == "validate" && $countErrors == 0) {
    $changekey = $mysqli->real_escape_string($_GET['changekey']);
    $forgotPassObj->set_tableKey("changekey");
    if ($forgotPassObj->select($changekey, false)) {
        $dataArr = $forgotPassObj->get_info();
        $rqid = $dataArr['rqid'];
        $username = $dataArr['username'];
Esempio n. 12
0
function saveCustomValues()
{
    global $mysqli, $member, $arrGames, $gameMemberObj, $dbprefix, $memberInfo, $arrSocialMediaInfo;
    // Save Custom Profile Options
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "profileoptions ORDER BY sortnum");
    while ($row = $result->fetch_assoc()) {
        $postVal = "custom_" . $row['profileoption_id'];
        $member->setProfileValue($row['profileoption_id'], $_POST[$postVal]);
    }
    // Save Social Media Info
    foreach ($arrSocialMediaInfo as $socialMediaInfo) {
        $postVal = "socialmedia_" . $socialMediaInfo['social_id'];
        if ($member->objSocial->objSocialMember->selectByMulti(array("member_id" => $memberInfo['member_id'], "social_id" => $socialMediaInfo['social_id']))) {
            $arrColumns = array("value");
            $arrValues = array($_POST[$postVal]);
            $member->objSocial->objSocialMember->update($arrColumns, $arrValues);
        } else {
            $arrColumns = array("social_id", "member_id", "value");
            $arrValues = array($socialMediaInfo['social_id'], $memberInfo['member_id'], $_POST[$postVal]);
            $member->objSocial->objSocialMember->addNew($arrColumns, $arrValues);
        }
    }
    // Save Games Played
    $mysqli->query("DELETE FROM " . $dbprefix . "gamesplayed_members WHERE member_id = '" . $memberInfo['member_id'] . "'");
    $gameMemberObj = new Basic($mysqli, "gamesplayed_members", "gamemember_id");
    foreach ($arrGames as $gameID) {
        $postVal = "game_" . $gameID;
        if ($_POST[$postVal] == 1) {
            $gameMemberObj->addNew(array("member_id", "gamesplayed_id"), array($memberInfo['member_id'], $gameID));
        }
    }
    if (!$member->playsGame($_POST['maingame'])) {
        $gameMemberObj->addNew(array("member_id", "gamesplayed_id"), array($memberInfo['member_id'], $_POST['maingame']));
    }
}
Esempio n. 13
0
 public function addNew($arrColumns, $arrValues)
 {
     $returnVal = false;
     // Do the original stuff
     $result = parent::addNew($arrColumns, $arrValues);
     if ($result && $this->intTableKeyValue != "") {
         // Add the Teams
         $this->arrTeamIDs = array();
         $countErrors = 0;
         $arrSeeds = range(1, $this->arrObjInfo['maxteams']);
         if ($this->arrObjInfo['seedtype'] == 2) {
             shuffle($arrSeeds);
         } elseif ($this->arrObjInfo['seedtype'] == 3) {
             $arrSeeds = array_fill(0, $this->arrObjInfo['maxteams'], 0);
         }
         for ($i = 0; $i < $this->arrObjInfo['maxteams']; $i++) {
             $teamNumber = $i + 1;
             $teamName = "Team " . $teamNumber;
             if (!$this->objTeam->addNew(array("tournament_id", "seed", "name"), array($this->arrObjInfo['tournament_id'], $arrSeeds[$i], $teamName))) {
                 $countErrors++;
             }
             $this->arrTeamIDs[] = $this->objTeam->get_info("tournamentteam_id");
         }
         if ($this->arrObjInfo['seedtype'] == 3) {
             // Pools
             $numOfPools = $this->arrPoolsPerTeams[$this->arrObjInfo['maxteams']];
             $blnPoolsAdded = true;
             // Add the pools
             for ($i = 1; $i <= $numOfPools; $i++) {
                 if (!$this->objTournamentPool->addNew(array("tournament_id"), array($this->arrObjInfo['tournament_id']))) {
                     $blnPoolsAdded = false;
                     $countErrors++;
                 }
             }
             if ($blnPoolsAdded) {
                 $arrPools = $this->getPoolList();
                 $arrTeams = $this->arrTeamIDs;
                 $teamsPerPool = $this->arrObjInfo['maxteams'] / $numOfPools;
                 $poolOffset = 0;
                 shuffle($arrTeams);
                 foreach ($arrPools as $poolID) {
                     $arrPoolTeams[$poolID] = array_slice($arrTeams, $poolOffset, $teamsPerPool);
                     $poolOffset += $teamsPerPool;
                 }
                 $arrNewPoolColumns = array("tournament_id", "pool_id", "team1_id", "team2_id");
                 foreach ($arrPoolTeams as $poolID => $tempTeamArr) {
                     $teamStart = 1;
                     foreach ($tempTeamArr as $teamID) {
                         $team1Index = $teamStart - 1;
                         for ($i = $teamStart; $i < $teamsPerPool; $i++) {
                             $arrNewPoolValues = array($this->intTableKeyValue, $poolID, $tempTeamArr[$team1Index], $tempTeamArr[$i]);
                             $this->objPoolMatch->addNew($arrNewPoolColumns, $arrNewPoolValues);
                         }
                         $teamStart++;
                     }
                 }
             }
         } else {
             // Non-Pools
             $this->resetMatches();
         }
         /*
         	-- OLD MATCH SPOT --
         */
         if ($countErrors == 0) {
             $returnVal = true;
         } else {
             // Unable to add complete tournament - Delete everything with the tournament's ID
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournamentpools_teams WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournamentpools WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournamentplayers WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournamentmatch WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournamentteams WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
             $this->MySQL->query("DELETE FROM " . $this->MySQL->get_tablePrefix() . "tournaments WHERE tournament_id = '" . $this->arrObjInfo['tournament_id'] . "'");
         }
     }
     return $returnVal;
 }
Esempio n. 14
0
    // Check Subject
    if (trim($_POST['subject']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a news subject.<br>";
    }
    // Check Message
    if (trim($_POST['message']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You may not make a blank news post.<br>";
    }
    if ($countErrors == 0) {
        $time = time();
        $arrColumns = array("squad_id", "member_id", "newstype", "dateposted", "postsubject", "newspost");
        $arrValues = array($squadInfo['squad_id'], $memberInfo['member_id'], $_POST['newstype'], $time, $_POST['subject'], $_POST['message']);
        $newsPost = new Basic($mysqli, "squadnews", "squadnews_id");
        if ($newsPost->addNew($arrColumns, $arrValues)) {
            echo "\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 Posted Squad News!\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('Post Squad News', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t";
        } 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']) {
    echo "\n\t\t<form action='managesquad.php?sID=" . $_GET['sID'] . "&pID=PostNews' method='post'>\n\t\t\t<div class='formDiv'>\n\t\t\t\n\t\t\t";
    if ($dispError != "") {
        echo "\n\t\t<div class='errorDiv'>\n\t\t<strong>Unable to post squad news because the following errors occurred:</strong><br><br>\n\t\t{$dispError}\n\t\t</div>\n\t\t";
Esempio n. 15
0
                $checkBoxName = "rankaccess_" . $row['rank_id'];
                if ($_POST[$checkBoxName] == 1) {
                    $arrValues = array($row['rank_id'], $newConsoleInfo['console_id']);
                    $consolePrivObj->addNew($arrColumns, $arrValues);
                }
            }
            $memberConsoleObj = new Basic($mysqli, "console_members", "privilege_id");
            $arrColumns = array("member_id", "console_id", "allowdeny");
            foreach ($_SESSION['btAccessRules'] as $memAccessInfo) {
                if ($memAccessInfo['accessRule'] == "allow") {
                    $intAllowDeny = 1;
                } else {
                    $intAllowDeny = 0;
                }
                if ($member->select($memAccessInfo['mID'])) {
                    $memberConsoleObj->addNew($arrColumns, array($memAccessInfo['mID'], $newConsoleInfo['console_id'], $intAllowDeny));
                }
            }
            $consolePrivObj->addNew(array("rank_id", "console_id"), array("1", $newConsoleInfo['console_id']));
            $consoleObj->resortOrder();
            echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t<p align='center'>\n\t\t\tSuccessfully Edited Console Option: <b>" . $newConsoleInfo['pagetitle'] . "</b>!\n\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\tpopupDialog('Edit Console Option', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t</script>\n\t\t\t";
        }
    } else {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $_SESSION['btAccessRules'] = array();
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console_members WHERE console_id = '" . $consoleInfo['console_id'] . "'");
    while ($row = $result->fetch_assoc()) {
Esempio n. 16
0
         if ($_POST['newComponentRequired'] != 0) {
             $_POST['newComponentRequired'] = 1;
         }
         $arrColumns = array("name", "componenttype", "ordernum", "required", "tooltip");
         $arrValues = array($_POST['newComponentName'], $_POST['newComponentType'], $componentOrderNum, $_POST['newComponentRequired'], $_POST['newComponentTooltip']);
         if ($appComponentObj->addNew($arrColumns, $arrValues)) {
             if ($_POST['newComponentType'] == "select" || $_POST['newComponentType'] == "multiselect") {
                 $appComponentSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
                 $newComponentID = $appComponentObj->get_info("appcomponent_id");
                 foreach ($_SESSION['btAppComponent']['cOptions'] as $optionValue) {
                     $appComponentSelectOptionObj->addNew(array("appcomponent_id", "componentvalue"), array($newComponentID, $optionValue));
                 }
             } elseif ($_POST['newComponentType'] == "profile") {
                 $appComponentSelectOptionObj = new Basic($mysqli, "app_selectvalues", "appselectvalue_id");
                 $newComponentID = $appComponentObj->get_info("appcomponent_id");
                 $appComponentSelectOptionObj->addNew(array("appcomponent_id", "componentvalue"), array($newComponentID, $_POST['profileOptionID']));
             }
             $member->logAction("Added a new member application component.");
             echo "\n\t\t\t\t\t<div id='addAppComponentSuccess' style='display: none'>\n\t\t\t\t\t\t<p class='main' align='center'>\n\t\t\t\t\t\t\tNew Member Application Component Added!<br><br>\n\t\t\t\t\t\t\tClick OK to continue modifying the member application.\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#addAppComponentSuccess').dialog({\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\ttitle: 'Add Application Component',\n\t\t\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\t\t\tzIndex: 99999,\n\t\t\t\t\t\t\t\tshow: 'scale',\n\t\t\t\t\t\t\t\twidth: 450,\n\t\t\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').show();\n\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').fadeOut(250);\n\t\t\t\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/membermanagement/include/appcomponentlist.php', { }, function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').html(data);\n\t\t\t\t\t\t\t\t\t\t\t\$('#loadingSpiral').hide();\n\t\t\t\t\t\t\t\t\t\t\t\$('#appComponentList').fadeIn(250);\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\$('#appComponentForm').dialog('close');\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</script>\n\t\t\t\t\t\n\t\t\t\t";
         } else {
             $addAppForm->errors[] = "nable to save information to the database.  Please contact the website administrator.";
         }
     }
     if (count($addAppForm->errors) == 0) {
         echo "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$('#addAppComponentFormDialog').hide();\n\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
     }
 }
 if (!$_POST['saveComponent']) {
     $_SESSION['btAppComponent']['cOptions'] = array();
 }
 echo "<div id='addAppComponentFormDialog'>";
Esempio n. 17
0
$scrollTop = true;
$consoleObj->select($cID);
if (!$member->hasAccess($consoleObj)) {
    exit;
}
foreach ($_POST as $key => $value) {
    $_POST[$key] = utf8_decode($_POST[$key]);
}
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info();
    // Check Security Code
    if ($_POST['checkadmin'] != constant('ADMIN_KEY')) {
        $result = $mysqli->query("SELECT * FROM " . $dbprefix . "failban WHERE ipaddress = '" . $IP_ADDRESS . "' AND pagename = 'edittheme'");
        $countFails = $result->num_rows;
        $adminKeyFails = $intMaxAttempts - $countFails;
        $failbanObj->addNew(array("ipaddress", "pagename"), array($IP_ADDRESS, "edittheme"));
        if ($adminKeyFails <= 0) {
            $ipbanObj->set_tableKey("ipban_id");
            $ipbanObj->addNew(array("ipaddress"), array($IP_ADDRESS));
            $banMessage = "You have been permanently banned!  If you are the true website admin, you will be able to unban yourself.  If not... GTFO!";
            echo "\n\t\t\t<div id='acoBan' style='display: none'><p align='center'>" . $banMessage . "</p></div>\n\t\t\t<script type='text/javascript'>\n\t\t\t\$(document).ready(function() {\n\t\t\n\t\t\t\$('#acoBan').dialog({\n\t\t\ttitle: 'Banned!',\n\t\t\tmodal: true,\n\t\t\tresizable: false,\n\t\t\twidth: 400,\n\t\t\tzIndex: 9999,\n\t\t\tbuttons: {\n\t\t\t'OK': function() {\n\t\t\t\$(this).dialog('close');\n\t\t}\n\t\t},\n\t\tbeforeClose: function() {\n\t\twindow.location = '" . $MAIN_ROOT . "banned.php';\n\t\t}\n\t\t\n\t\t});\n\t\t\$('.ui-dialog :button').blur();\n\t\t});\n\t\t</script>\n\t\t\n\t\t";
            $scrollTop = false;
        }
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You entered an invalid admin key.  Please check the config file for the correct admin key.  You have " . $adminKeyFails . " more trys before being IP Banned. " . $IP_ADDRESS . "<br>";
    }
    // Update Header
    if (!is_writable("../../../themes/" . $THEME . "/_header.php")) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save header information.<br>";
    } else {
Esempio n. 18
0
 if (!$squadObj->select($_POST['squad'])) {
     $countErrors++;
     $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid squad!<br>";
 } else {
     $outstandingApps = $squadObj->getOutstandingApplications();
     if (in_array($memberInfo['member_id'], $outstandingApps)) {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You have already applied to this squad!  Please wait for a decision to be made before re-applying.<br>";
     }
 }
 if ($countErrors == 0) {
     $squadInfo = $squadObj->get_info_filtered();
     $squadAppObj = new Basic($mysqli, "squadapps", "squadapp_id");
     $arrColumns = array("member_id", "squad_id", "message", "applydate", "status");
     $arrValues = array($memberInfo['member_id'], $_POST['squad'], $_POST['message'], time(), 0);
     if ($squadAppObj->addNew($arrColumns, $arrValues)) {
         $arrRecruiterMembers = $squadObj->getRecruiterMembers();
         foreach ($arrRecruiterMembers as $recruiterID) {
             $member->select($recruiterID);
             $member->postNotification("A new member has applied to join the squad <b><a href='" . $MAIN_ROOT . "squads/profile.php?sID=" . $squadInfo['squad_id'] . "'>" . $squadInfo['name'] . "</a></b>.  <a href='" . $MAIN_ROOT . "members/squads/managesquad.php?sID=" . $squadInfo['squad_id'] . "&pID=AcceptApps'>Click Here</a> to review squad applications.");
         }
         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 Applied to Squad: <b>" . $squadInfo['name'] . "</b>!\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('Apply to a Squad', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t</script>\n\t\t\t\n\t\t\t";
     } 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 = filterArray($_POST);
     $_POST['submit'] = false;
 }
Esempio n. 19
0
        $emailMessage = "\nHi " . $_POST['requestername'] . ",\n\n\n\t\t\t\nYou must confirm your e-mail address before the diplomacy request can go through.  Click the link below.\n\n\n\t\t\t\nhttp://" . $_SERVER['SERVER_NAME'] . $MAIN_ROOT . "diplomacy/confirm-email.php?code=" . $emailCode . "\n\n\t\nThanks,\n\n" . $websiteInfo['clanname'];
        $sendMail = mail($emailTo, $emailSubject, $emailMessage, "From: " . $emailFrom);
        if (!$sendMail) {
            $emailCode = 1;
            $sendMail = true;
        }
        if ($sendMail) {
            $diplomacyRequestObj = new Basic($mysqli, "diplomacy_request", "diplomacyrequest_id");
            $arrColumns = array("ipaddress", "dateadded", "diplomacystatus_id", "email", "name", "clanname", "clantag", "clansize", "gamesplayed", "website", "leaders", "message", "confirmemail");
            $arrValues = array($IP_ADDRESS, time(), $_POST['diplomacystatus'], $_POST['requesteremail'], $_POST['requestername'], $_POST['clanname'], $_POST['clantag'], $_POST['clansize'], $_POST['gamesplayed'], $_POST['website'], $_POST['clanleaders'], $_POST['message'], $emailCode);
            if ($emailCode == 1) {
                $dispConfirmMessage = "A request has been sent to the diplomacy managers.  Please wait while a decision is made.";
            } else {
                $dispConfirmMessage = "Almost Done!  You need to first confirm your e-mail address before the diplomacy request can go through.  Check your spam!";
            }
            if ($diplomacyRequestObj->addNew($arrColumns, $arrValues)) {
                echo "\n\t\t\t\t\t\n\t\t\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\t\t" . $dispConfirmMessage . "\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\t\tpopupDialog('Diplomacy Request', '" . $MAIN_ROOT . "', 'successBox');\n\t\t\t\t\t\t</script>\n\t\t\t\t\t\n\t\t\t\t\t";
            } else {
                $countErrors++;
                $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database.  Please contact the website administrator.<br>";
            }
        } else {
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to send confirmation e-mail.<br>";
            $countErrors++;
        }
    }
    if ($countErrors > 0) {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
Esempio n. 20
0
        if ($newRank->addNew($arrColumns, $arrValues)) {
            // Added Rank! Now give the rank its privileges
            $newRankInfo = $newRank->get_info_filtered();
            // If maximum rank is set to "(this rank)", set the promotepower to the new rank's rank_id
            if ($_POST['promoterank'] == -1) {
                $newRank->update(array("promotepower"), array($newRankInfo['rank_id']));
            }
            $arrColumns = array("rank_id", "console_id");
            $privObj = new Basic($mysqli, "rank_privileges", "privilege_id");
            $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console ORDER BY sortnum");
            $rankOptions = "";
            while ($row = $result->fetch_assoc()) {
                $strPostVarName = "consoleid_" . $row['console_id'];
                if (isset($_POST[$strPostVarName]) && $_POST[$strPostVarName] == 1) {
                    $arrValues = array($newRankInfo['rank_id'], $row['console_id']);
                    $privObj->addNew($arrColumns, $arrValues);
                }
            }
            $manageRanksCID = $consoleObj->findConsoleIDByName("Manage Ranks");
            echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Added New Rank: <b>" . $newRankInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add New Rank', '" . $MAIN_ROOT . "members/console.php?cID=" . $manageRanksCID . "', 'successBox');\n\t\t\t</script>\n\t\t";
        } else {
            $_POST['submit'] = false;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to add new rank.  Please try again.<br>";
        }
    }
}
if (!isset($_POST['submit']) || !$_POST['submit']) {
    $rankCategories = $mysqli->query("SELECT * FROM " . $dbprefix . "rankcategory ORDER BY ordernum");
    $rankCatOptions = "";
    while ($arrRankCat = $rankCategories->fetch_assoc()) {
        $rankCatName = filterText($arrRankCat['name']);
Esempio n. 21
0
            $intNewOrderSpot = 1;
        }
    } else {
        if ($_POST['beforeafter'] != "before" and $_POST['beforeafter'] != "after") {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid category order. (before/after)<br>";
        } else {
            $intNewOrderSpot = $downloadCatObj->makeRoom($_POST['beforeafter']);
        }
    }
    if ($countErrors == 0) {
        $accessKey = $_POST['accesskey'] != 1 ? 0 : 1;
        if ($downloadCatObj->addNew(array("name", "ordernum", "accesstype"), array($_POST['catname'], $intNewOrderSpot, $accessKey))) {
            $downloadCatInfo = $downloadCatObj->get_info_filtered();
            foreach ($arrExtensions as $strExtension) {
                $downloadExtObj->addNew(array("downloadcategory_id", "extension"), array($downloadCatInfo['downloadcategory_id'], trim($strExtension)));
            }
            echo "\n\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\tSuccessfully Added New Download Category: <b>" . $downloadCatInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Add New Download Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t";
        }
    } else {
        $_POST = filterArray($_POST);
        $_POST['submit'] = false;
    }
}
if (!$_POST['submit']) {
    $countCategories = 0;
    $result = $mysqli->query("SELECT * FROM " . $dbprefix . "downloadcategory ORDER BY ordernum DESC");
    while ($row = $result->fetch_assoc()) {
        $catOrderOptions .= "<option value='" . $row['downloadcategory_id'] . "'>" . filterText($row['name']) . "</option>";
        $countCategories++;
    }
Esempio n. 22
0
                $dispMembersOnlyTagger = "\n\t\t\t\t<div id='membersOnlyTagger'>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<div id='membersOnlyLoadingSpiral' style='display: none'>\n\t\t\t\t\t\t<p align='center' class='main'>\n\t\t\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral2.gif'><br>Loading\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t<div id='membersOnlyTaggerHTML'>\n\t\t\t\t\t\t<p align='center' style='margin: 0px; margin-bottom: 15px'><b>Members Only Tagger: " . $actualPageName . "</b></p>\n\t\t\t\t\t\n\t\t\t\t\t\t<p align='center'>Current Status: " . $pageTagStatus . "<br>Return to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $taggerCID . "'>Member's Only Pages</a></p>\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div class='taggerBottomLeft'><a href='javascript:void(0)' onclick='setMembersOnlyTaggerStatus()'>Turn Off</a></div>\n\t\t\t\t\t\t<div class='taggerBottomRight'><a href='javascript:void(0)' onclick='setMembersOnlyPageStatus()'>" . $dispTagOrUntag . " Page</a></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\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\t\t\t\n\t\t\t\t\tfunction setMembersOnlyTaggerStatus() {\n\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/membersonlypagetagger.php', { setTaggerStatus: '1' }, function(data) {\n\t\t\t\t\t\t\t\t\$('#membersOnlyTagger').fadeOut(250);\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}\n\t\t\t\t\t\n\t\t\t\t\tfunction setMembersOnlyPageStatus() {\n\t\t\t\t\t\n\t\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\t\$('#membersOnlyTaggerHTML').hide();\n\t\t\t\t\t\t\t\$('#membersOnlyLoadingSpiral').show();\n\t\t\t\t\t\t\t\$.post('" . $MAIN_ROOT . "members/include/admin/membersonlypagetagger.php', { setPageStatus: '1', pageName: '" . filterText($actualPageName) . "', tagURL: '" . $pageTaggerURL . "' }, function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\$('#membersOnlyTaggerHTML').html(data);\n\t\t\t\t\t\t\t\t\$('#membersOnlyLoadingSpiral').hide();\n\t\t\t\t\t\t\t\t\$('#membersOnlyTaggerHTML').fadeIn(250);\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\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t";
            }
        }
    }
}
if (!defined("LOGGED_IN")) {
    define("LOGGED_IN", false);
}
if ($taggerObj->select($_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'], false) && constant('LOGGED_IN') == false) {
    echo "\n\t\n\t\t<script type='text/javascript'>\n\t\t\n\t\t\twindow.location='" . $MAIN_ROOT . "login.php';\n\t\t\n\t\t</script>\n\t\n\t";
    exit;
}
$hitCountObj = new Basic($mysqli, "hitcounter", "hit_id");
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "hitcounter WHERE ipaddress = '" . $IP_ADDRESS . "'");
if ($result->num_rows > 0) {
    $hitCountRow = $result->fetch_assoc();
    $hitCountObj->select($hitCountRow['hit_id']);
    $updateHits = $hitCountObj->get_info("totalhits") + 1;
    $updateColumns = array("totalhits", "pagename");
    $updateValues = array($updateHits, $PAGE_NAME);
    if (time() > $hitCountObj->get_info("dateposted") + 1800) {
        $updateColumns[] = "dateposted";
        $updateValues[] = time();
    }
    $hitCountObj->update($updateColumns, $updateValues);
} else {
    $hitCountObj->addNew(array("ipaddress", "dateposted", "pagename", "totalhits"), array($IP_ADDRESS, time(), $PAGE_NAME, 1));
}
$blnDisplayNewsTicker = false;
$breadcrumbObj = new BreadCrumb();
$hooksObj->addHook("worldclock-display", "displayDefaultWorldClock");
Esempio n. 23
0
<?php

if (!defined("CONVERT_WEBSITEINFO")) {
    exit;
}
$websiteInfoObj = new Basic($mysqli, "websiteinfo", "websiteinfo_id");
$websiteInfoObj->select(1);
$websiteInfo = $websiteInfoObj->get_info();
$mysqli->query("DROP TABLE " . $_POST['tableprefix'] . "websiteinfo");
$newWebsiteInfoSQL = "CREATE TABLE IF NOT EXISTS `" . $_POST['tableprefix'] . "websiteinfo` (\n  `websiteinfo_id` int(11) NOT NULL AUTO_INCREMENT,\n  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,\n  `value` text COLLATE utf8_unicode_ci NOT NULL,\n  PRIMARY KEY (`websiteinfo_id`),\n  UNIQUE KEY `name` (`name`)\n) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;";
$mysqli->query($newWebsiteInfoSQL);
$skipColumns = array("websiteinfo_id", "name", "value");
foreach ($websiteInfo as $key => $value) {
    if (!in_array($key, $skipColumns)) {
        $websiteInfoObj->addNew(array("name", "value"), array($key, $value));
    }
}
$websiteInfoObj->addNew(array("name", "value"), array("news_postsperpage", 10));
$consoleObj->select($cID);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) {
    if ($_POST['setTaggerStatus'] == 1) {
        if (isset($_SESSION['btMembersOnlyTagger']) && $_SESSION['btMembersOnlyTagger'] == 1) {
            $_SESSION['btMembersOnlyTagger'] = 0;
            echo "\n\t\t\t\n\t\t\t\tThe member's only page tagger is currently <b>off</b>.<br><br>\n\t\t\t\n\t\t\t\t<a href='javascript:void(0)' onclick='setMembersOnlyTaggerStatus()'>Turn On Member's Only Page Tagger</a>\n\t\t\t\n\t\t\t";
        } else {
            $_SESSION['btMembersOnlyTagger'] = 1;
            echo "\n\t\t\t\t\n\t\t\t\tThe member's only page tagger is currently <b>on</b>.<br><br>\n\t\t\t\n\t\t\t\t<a href='javascript:void(0)' onclick='setMembersOnlyTaggerStatus()'>Turn Off Member's Only Page Tagger</a>\n\t\t\t\n\t\t\t";
        }
    } elseif ($_POST['setPageStatus'] == 1 && !isset($_POST['pageID']) && $_SESSION['btMembersOnlyTagger'] == 1) {
        $taggerObj = new Basic($mysqli, "membersonlypage", "pageurl");
        if (!$taggerObj->select($_POST['tagURL'], false)) {
            $taggerObj->addNew(array("pagename", "pageurl", "dateadded"), array($_POST['pageName'], $_POST['tagURL'], time()));
            echo "\n\t\t\t\n\t\t\t\t<p align='center' style='margin: 0px; margin-bottom: 15px'><b>Members Only Tagger: " . $_POST['pageName'] . "</b></p>\n\t\t\t\t\n\t\t\t\t<p align='center'>Current Status: <span class='pendingFont'>Member's Only</span><br>Return to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Member's Only Pages</a></p>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<div class='taggerBottomLeft'><a href='javascript:void(0)' onclick='setMembersOnlyTaggerStatus()'>Turn Off</a></div>\n\t\t\t\t<div class='taggerBottomRight'><a href='javascript:void(0)' onclick='setMembersOnlyPageStatus()'>Untag Page</a></div>\n\t\t\t\t\n\t\t\n\t\t\t";
        } else {
            $taggerObj->delete();
            echo "\n\t\t\t\n\t\t\t\t<p align='center' style='margin: 0px; margin-bottom: 15px'><b>Members Only Tagger: " . $_POST['pageName'] . "</b></p>\n\t\t\t\t\n\t\t\t\t<p align='center'>Current Status: <span class='publicNewsColor'>Public</span><br>Return to <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Member's Only Pages</a></p>\n\t\t\t\n\t\t\t\t\n\t\t\t\t<div class='taggerBottomLeft'><a href='javascript:void(0)' onclick='setMembersOnlyTaggerStatus()'>Turn Off</a></div>\n\t\t\t\t<div class='taggerBottomRight'><a href='javascript:void(0)' onclick='setMembersOnlyPageStatus()'>Tag Page</a></div>\n\t\t\t\t\n\t\t\t\n\t\t\t";
        }
    } elseif ($_POST['setPageStatus'] == 1 && isset($_POST['pageID'])) {
        $taggerObj = new Basic($mysqli, "membersonlypage", "page_id");
        if ($taggerObj->select($_POST['pageID'])) {
            $taggerObj->delete();
            include "membersonlypageslist.php";
        }
    } elseif ($_POST['setSectionStatus'] == 1 && ($_POST['pageID'] == "profile" || $_POST['pageID'] == "forum") && ($_POST['pageStatusValue'] == 1 || $_POST['pageStatusValue'] == 0)) {
        $settingName = "private" . $_POST['pageID'];
        $arrColumn = array("value");
        $arrValue = array($_POST['pageStatusValue']);
Esempio n. 25
0
include_once "../../../../classes/rank.php";
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/consolecategory.php";
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$consoleObj = new ConsoleOption($mysqli);
$consoleCatObj = new ConsoleCategory($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Console Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    if ($member->hasAccess($consoleObj) && $consoleCatObj->select($_POST['cID'])) {
        define('MEMBERRANK_ID', $memberInfo['rank_id']);
        $consoleCatInfo = $consoleCatObj->get_info();
        $arrAssociates = $consoleCatObj->getAssociateIDs("ORDER BY sortnum");
        $resortOrder = false;
        if (count($arrAssociates) > 0) {
            $consoleObj->select($arrAssociates[0]);
            $intSpot = $consoleObj->makeRoom("before");
            $resortOrder = true;
        } else {
            $intSpot = 1;
        }
        $consoleObj->addNew(array("consolecategory_id", "pagetitle", "sep", "sortnum"), array($_POST['cID'], "-separator-", "1", $intSpot));
        $newSepID = $consoleObj->get_info("console_id");
        $rankPrivObj = new Basic($mysqli, "rank_privileges", "privilege_id");
        $rankPrivObj->addNew(array("console_id", "rank_id"), array($newSepID, 1));
        include "main.php";
    }
}