$countErrors++; $dispError .= " <b>·</b> Scores must be a numeric value.<br>"; } // Check Outcome if ($_POST['outcome'] != 0 && $_POST['outcome'] != 1 && $_POST['outcome'] != 2) { $countErrors++; $dispError .= " <b>·</b> You selected an invalid outcome.<br>"; } // Check Replay Upload if ($_FILES['uploadreplay']['name'] != "") { $uploadReplayObj = new BTUpload($_FILES['uploadreplay'], "replay_", "../../downloads/replays/", array(".zip")); if (!$uploadReplayObj->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to upload the replay. Please make sure the file extension is .zip and that the file size is not too big.<br>"; } else { $matchReplayURL = $MAIN_ROOT . "downloads/replays/" . $uploadReplayObj->getUploadedFileName(); } } else { $matchReplayURL = $_POST['replayurl']; } if ($countErrors == 0) { // Swap players if team 2 is changing if ($matchInfo['team2_id'] != $_POST['playertwo'] && $_POST['playertwo'] != 0) { $playerTwoMatch = $tournamentObj->getMatches($matchInfo['round'], $_POST['playertwo']); $tournamentObj->objMatch->select($playerTwoMatch[0]); $playerTwoMatchInfo = $tournamentObj->objMatch->get_info(); if ($_POST['playertwo'] == $playerTwoMatchInfo['team1_id']) { $arrColumns = array("team1_id"); } else { $arrColumns = array("team2_id"); }
if ($_POST['autodisable'] != "") { if (!is_numeric($_POST['autodisable']) or is_numeric($_POST['autodisable']) and $_POST['autodisable'] < 0) { $countErrors++; $dispError .= " <b>·</b> Auto disable must either be blank or a positive numeric value.<br>"; } } // If everything is ok, try uploading the image if ($countErrors == 0) { // Check Rank Image File if ($_FILES['rankimagefile']['name'] != "") { $uploadFile = new BTUpload($_FILES['rankimagefile'], "rank_", "../images/ranks/", array(".jpg", ".png", ".gif", ".bmp")); if (!$uploadFile->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to upload rank image file. Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>"; } else { $rankImgURL = "images/ranks/" . $uploadFile->getUploadedFileName(); } } else { if (trim($_POST['rankimageurl']) == "") { $countErrors++; $dispError .= " <b>·</b> You must include a rank image.<br>"; } else { $rankImgURL = $_POST['rankimageurl']; } } } if ($countErrors > 0) { $_POST = filterArray($_POST); $_POST['submit'] = false; } else { // EVERYTHING IS OK
$intGameOrderNum = $gameObj->makeRoom($_POST['beforeafter']); if (!is_numeric($intGameOrderNum)) { $countErrors++; $dispError .= " <b>·</b> The selected an invalid display order. (game position)<br>"; } } } if ($countErrors == 0) { // No Errors! Check game image, if it needs to be uploaded, try uploading. if ($_FILES['gameimagefile']['name'] != "") { $btUploadObj = new BTUpload($_FILES['gameimagefile'], "game_", "../images/gamesplayed/", array(".jpg", ".png", ".bmp", ".gif")); if (!$btUploadObj->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to upload games image file. Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>"; } else { $gameImageURL = "images/gamesplayed/" . $btUploadObj->getUploadedFileName(); } } elseif (trim($_POST['gameimageurl']) != "") { $gameImageURL = $_POST['gameimageurl']; } else { $countErrors++; $dispError .= " <b>·</b> You must include an image for the game.<br>"; } } if ($countErrors == 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();
if ($_POST['hidecategory'] != "1") { $_POST['hidecategory'] = 0; } if ($_POST['headertype'] == "customcode") { $headerImageURL = $_POST['headercustomcode']; } elseif ($_POST['headertype'] == "customformat") { $headerImageURL = $_POST['wysiwygHTML']; } if ($countErrors == 0) { if ($_POST['headertype'] == "image" && $_FILES['headerimagefile']['name'] != "") { $btUploadObj = new BTUpload($_FILES['headerimagefile'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif")); } elseif ($_POST['headertype'] == "image") { $btUploadObj = new BTUpload($_POST['headerimageurl'], "menuheader_", "../images/menu/", array(".jpg", ".png", ".bmp", ".gif"), 4, true); } if ($_POST['headertype'] == "image" && $btUploadObj->uploadFile()) { $headerImageURL = "images/menu/" . $btUploadObj->getUploadedFileName(); } elseif ($_POST['headertype'] == "image") { $countErrors++; $dispError .= " <b>·</b> Unable to upload selected image. Make sure it's the correct file extension and not too big.<br>"; } } if ($countErrors == 0) { $arrColumns = array("section", "name", "sortnum", "headertype", "headercode", "accesstype", "hide"); $arrValues = array($_POST['section'], $_POST['categoryname'], $intNewOrderNum, $_POST['headertype'], $headerImageURL, $_POST['accesstype'], $_POST['hidecategory']); if ($menuCatObj->addNew($arrColumns, $arrValues)) { $menuCatInfo = $menuCatObj->get_info_filtered(); 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 Menu Category: <b>" . $menuCatInfo['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 Menu Category', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t</script>\n\t\t\t"; } } if ($countErrors > 0) { $_POST = filterArray($_POST);
$intNewCatOrderNum = 1; } } $strCatImageURL = ""; // Check Image if (isset($_POST['useimage']) && $_POST['useimage'] == 1) { // Use Image Selected, check for no errors if ($countErrors == 0) { if ($_FILES['catimagefile']['name'] != "") { // Image File Selected.... Upload it $uploadFile = new BTUpload($_FILES['catimagefile'], "rankcat_", "../images/ranks/", array(".jpg", ".png", ".gif", ".bmp")); if (!$uploadFile->uploadFile()) { $countErrors++; $dispError .= "<b>·</b> Unable to upload category image file. Please make sure the file extension is either .jpg, .png, .gif or .bmp<br>"; } else { $strCatImageURL = "images/ranks/" . $uploadFile->getUploadedFileName(); } } elseif ($_POST['catimageurl'] != "") { $strCatImageURL = $_POST['catimageurl']; } else { $strCatImageURL = $rankCatInfo['imageurl']; } } if ($strCatImageURL == "") { $_POST['useimage'] = 0; } } if ($countErrors == 0) { // No errors... Add to DB $arrColumns = array("name", "imageurl", "ordernum", "hidecat", "useimage", "description", "imagewidth", "imageheight", "color"); $arrValues = array($_POST['catname'], $strCatImageURL, $intNewCatOrderNum, $_POST['hidecat'], $_POST['useimage'], $_POST['catdesc'], $_POST['catimagewidth'], $_POST['catimageheight'], $_POST['rankcolor']);
// If no errors, check for image upload and try to upload the image if ($_FILES['statusimagefile']['name'] != "") { $uploadImg = new BTUpload($_FILES['statusimagefile'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp")); if (!$uploadImg->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to upload status image. Please make sure the file size is not too big and it has an acceptable file extension.<br>"; } else { $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName(); } } else { $uploadImg = new BTUpload($_POST['statusimageurl'], "status_", "../images/diplomacy/", array(".jpg", ".png", ".gif", ".bmp"), 4, true); if (!$uploadImg->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to download status image from remote url. You may need to first download the image and upload normally.<br>"; } else { $statusImageURL = "images/diplomacy/" . $uploadImg->getUploadedFileName(); } //$statusImageURL = $_POST['statusimageurl']; } // If there are still no errors after uploading the image, add to db if ($countErrors == 0) { $arrColumns = array("name", "imageurl", "imagewidth", "imageheight", "ordernum"); $arrValues = array($_POST['statusname'], $statusImageURL, $_POST['imagewidth'], $_POST['imageheight'], $intNewOrderNum); if ($diplomacyStatusObj->addNew($arrColumns, $arrValues)) { echo "\n\t\t\t\t\n\t\t\t\t\t<div style='display: none' id='successBox'>\n\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\tSuccessfully added the " . $diplomacyStatusObj->get_info_filtered("name") . " status to the diplomacy page!\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\tpopupDialog('Add New Diplomacy Status', '" . $MAIN_ROOT . "members', 'successBox');\n\t\t\t\t\t</script>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t"; $member->logAction("Added the " . $_POST['statusname'] . " status to the diplomacy page."); } else { $countErrors++; $dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>"; } }
} include_once "../../classes/btupload.php"; echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\n\$('#breadCrumbTitle').html(\"Edit Squad Profile\");\n\$('#breadCrumb').html(\"<a href='" . $MAIN_ROOT . "'>Home</a> > <a href='" . $MAIN_ROOT . "members'>My Account</a> > <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "&select=" . $squadInfo['squad_id'] . "'>" . $consoleTitle . "</a> > <b>" . $squadInfo['name'] . ":</b> Edit Squad Profile\");\n});\n</script>\n"; if ($_POST['submit']) { // Check Squad Name if (trim($_POST['squadname']) == "") { $countErrors++; $dispError .= " <b>·</b> You must enter a squad name.<br>"; } if ($_FILES['uploadlogo']['name'] != "") { $uploadLogoObj = new BTUpload($_FILES['uploadlogo'], "squad_", "../../images/squads/", array(".png", ".jpg", ".gif", ".bmp")); if (!$uploadLogoObj->uploadFile()) { $countErrors++; $dispError .= " <b>·</b> Unable to upload the squad logo. Please make sure the file extension is either .jpg, .png, .gif or .bmp and that the file size is not too big.<br>"; } else { $logoImageURL = $MAIN_ROOT . "images/squads/" . $uploadLogoObj->getUploadedFileName(); } } else { $logoImageURL = $_POST['logourl']; } if ($countErrors == 0) { if ($_POST['recruiting'] != 0) { $_POST['recruiting'] = 1; } if ($_POST['shoutbox'] != 0) { $_POST['shoutbox'] = 1; } $time = time(); $arrColumns = array("name", "description", "logourl", "recruitingstatus", "privateshoutbox", "website"); $arrValues = array($_POST['squadname'], $_POST['squaddesc'], $logoImageURL, $_POST['recruiting'], $_POST['shoutbox'], $_POST['squadsite']); if ($squadObj->update($arrColumns, $arrValues)) {
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\t\$(document).ready(function() {\n\t\t\t\t\n\t\t\t\t\t\$('#acoBan').dialog({\n\t\t\t\t\t\ttitle: 'Banned!',\n\t\t\t\t\t\tmodal: true,\n\t\t\t\t\t\tresizable: false,\n\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\tzIndex: 9999,\n\t\t\t\t\t\tbuttons: {\n\t\t\t\t\t\t\t'OK': function() {\n\t\t\t\t\t\t\t\t\$(this).dialog('close');\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbeforeClose: function() {\n\t\t\t\t\t\t\twindow.location = '" . $MAIN_ROOT . "banned.php';\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\$('.ui-dialog :button').blur();\n\t\t\t\t});\n\t\t\t</script>\n\t\t\t\n\t\t\t"; } $countErrors++; $dispError .= " <b>·</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>"; } $consoleFileURL = ""; if ($countErrors == 0 && $_FILES['consolefile']['name'] != "") { // No Errors Try uploading Console File $newFileName = strtolower(str_replace(" ", "", $_POST['pagetitle'])) . "_"; $btUpload = new BTUpload($_FILES['consolefile'], $newFileName, "include/customconsole/", array(".php")); if ($btUpload->uploadFile()) { $consoleFileURL = "customconsole/" . $btUpload->getUploadedFileName(); } else { $countErrors++; $dispError .= " <b>·</b> Unable to upload console option. Please make sure the filesize is not too big and filetype is php.<br>"; } } if ($_POST['hideoption'] != 1) { $_POST['hideoption'] = 0; } if ($countErrors == 0) { // Still no errors after Uploading ---> Update DB $consoleObj->select($_GET['cnID']); $arrColumns = array("consolecategory_id", "pagetitle", "sortnum", "hide"); $arrValues = array($_POST['consolecat'], $_POST['pagetitle'], $intNewSortNum, $_POST['hideoption']); if ($consoleFileURL != "") { $arrColumns[] = "filename";