*/ if (!isset($member) || substr($_SERVER['PHP_SELF'], -11) != "console.php") { exit; } else { $memberInfo = $member->get_info_filtered(); $consoleObj->select($_GET['cID']); if (!$member->hasAccess($consoleObj)) { exit; } } include_once $prevFolder . "classes/profilecategory.php"; include_once $prevFolder . "classes/profileoption.php"; $cID = $_GET['cID']; $profileOptionObj = new ProfileOption($mysqli); $profileCatObj = new ProfileCategory($mysqli); if (!$profileOptionObj->select($_GET['oID'])) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>"); } $profileOptionInfo = $profileOptionObj->get_info_filtered(); echo "\n\n<script type='text/javascript'>\n\$(document).ready(function() {\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 . "'>Manage Profile Options</a> > " . $profileOptionInfo['name'] . "\");\n});\n</script>\n"; $dispError = ""; if ($_POST['submit']) { // Check Option Name if (trim($_POST['optionname']) == "") { $countErrors++; $dispError .= " <b>·</b> You must give the profile option a name.<br>"; } // Check Category if (!$profileCatObj->select($_POST['optioncategory'])) { $countErrors++; $dispError .= " <b>·</b> You selected an invalid profile category.<br>";
* */ include_once "../../../../_setup.php"; include_once "../../../../classes/member.php"; include_once "../../../../classes/rank.php"; include_once "../../../../classes/consoleoption.php"; include_once "../../../../classes/profileoption.php"; include_once "../../../../classes/profilecategory.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $profileOptionObj = new ProfileOption($mysqli); $profileCatObj = new ProfileCategory($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Profile Options"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $profileOptionObj->select($_POST['oID'])) { define("MEMBERRANK_ID", $memberInfo['rank_id']); if ($_POST['confirm'] == 1) { $profileOptionObj->delete(); include "main.php"; } else { $profileOptionName = $profileOptionObj->get_info_filtered("name"); echo "<p align='center'>Are you sure you want to delete the profile option <b>" . $profileOptionName . "</b>?</p>"; } } elseif (!$profileOptionObj->select($_POST['oID'])) { echo "<p align='center'>Unable find the selected profile option. Please try again or contact the website administrator.</p>"; } }
$gameObj->select($gameID); $mainGameOptions[$gameID] = $gameObj->get_info_filtered("name"); $gamesPlayedOptions["game_" . $gameID] = array("type" => "checkbox", "sortorder" => $i++, "attributes" => array("class" => "textBox formInput", "style" => "margin-left: 10px"), "value" => $member->playsGame($gameID), "options" => array("1" => $gameObj->get_info_filtered("name"))); } $mainGamePlayed['maingame']['options'] = $mainGameOptions; $arrComponents = array_merge($arrComponents, $arrSocialMediaComponents, $arrBirthdayComponents, $gamesPlayedSection, $mainGamePlayed, $gamesPlayedOptions); } // Set up Custom Profile Options $customCount = 1; $arrCustomOptions = array(); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "profilecategory ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $profileCategoryObj->select($row['profilecategory_id']); $arrProfileOptions = $profileCategoryObj->getAssociateIDs("ORDER BY sortnum"); $arrCustomOptions['customsection_' . $customCount] = array("type" => "section", "options" => array("section_title" => $profileCategoryObj->get_info_filtered("name") . ":"), "sortorder" => $i++); $customCount++; foreach ($arrProfileOptions as $profileOptionID) { $profileOptionObj->select($profileOptionID); $profileOptionValue = $member->getProfileValue($profileOptionID, true); $arrSelectOptions = array(); if ($profileOptionObj->isSelectOption()) { $arrSelectOptions = $profileOptionObj->getSelectValues(); $inputType = "select"; } else { $inputType = "text"; } $arrCustomOptions["custom_" . $profileOptionID] = array("display_name" => $profileOptionObj->get_info_filtered("name"), "type" => $inputType, "attributes" => array("class" => "textBox formInput"), "sortorder" => $i++, "options" => $arrSelectOptions, "value" => $profileOptionValue); } } $arrComponents = array_merge($arrComponents, $arrCustomOptions); $setupFormArgs = array("name" => "console-" . $cID, "components" => $arrComponents, "saveObject" => $member, "saveType" => "update", "afterSave" => array("saveCustomValues"), "saveMessage" => "Successfully Saved Profile Information!", "attributes" => array("action" => $MAIN_ROOT . "members/console.php?cID=" . $cID, "method" => "post"), "description" => "Use the form below to edit your profile.");
include_once "../../../../classes/member.php"; include_once "../../../../classes/rank.php"; include_once "../../../../classes/consoleoption.php"; include_once "../../../../classes/profileoption.php"; include_once "../../../../classes/profilecategory.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $profileOptionObj = new ProfileOption($mysqli); $profileCatObj = new ProfileCategory($mysqli); $cID = $consoleObj->findConsoleIDByName("Manage Profile Options"); $consoleObj->select($cID); $_GET['cID'] = $cID; if ($member->authorizeLogin($_SESSION['btPassword'])) { $memberInfo = $member->get_info_filtered(); if ($member->hasAccess($consoleObj) && $profileOptionObj->select($_POST['oID'])) { define('MEMBERRANK_ID', $memberInfo['rank_id']); $profileOptionInfo = $profileOptionObj->get_info(); $profileCatObj->select($profileOptionInfo['profilecategory_id']); $arrAssociates = $profileCatObj->getAssociateIDs("ORDER BY sortnum"); array_unshift($arrAssociates, ""); unset($arrAssociates[0]); $intSortNum = $profileOptionInfo['sortnum']; $moveUp = $intSortNum - 1; $moveDown = $intSortNum + 1; $makeMove = ""; if ($_POST['oDir'] == "up" and $profileOptionObj->select($arrAssociates[$moveUp])) { $makeMove = "before"; } elseif ($_POST['oDir'] == "down" and $profileOptionObj->select($arrAssociates[$moveDown])) { $makeMove = "after"; }
if ($_POST['submit']) { // Check Option Name if (trim($_POST['optionname']) == "") { $countErrors++; $dispError .= " <b>·</b> You must give the profile option a name.<br>"; } // Check Category if (!$profileCatObj->select($_POST['optioncategory'])) { $countErrors++; $dispError .= " <b>·</b> You selected an invalid profile category.<br>"; } else { // Check Order $arrProfileOptionIDs = $profileCatObj->getAssociateIDs(); $blnOrderCheck1 = $_POST['optionorder'] == "first" && count($arrProfileOptionIDs) > 0; $blnOrderCheck2 = !in_array($_POST['optionorder'], $arrProfileOptionIDs) && $_POST['optionorder'] != "first"; $blnOrderCheck3 = !$profileOptionObj->select($_POST['optionorder']) && $_POST['optionorder'] != "first"; if ($blnOrderCheck1 || $blnOrderCheck2 || $blnOrderCheck3) { $countErrors++; $dispError .= " <b>·</b> You selected an invalid profile option order.<br>"; } elseif ($_POST['optionorder'] == "first") { $intNewSortNum = 1; } else { if ($_POST['beforeafter'] == "before" || $_POST['beforeafter'] == "after") { $intNewSortNum = $profileOptionObj->makeRoom($_POST['beforeafter']); } else { $countErrors++; $dispError .= " <b>·</b> You selected an invalid profile option order.<br>"; } } } if ($countErrors == 0) {