Beispiel #1
0
include_once "../../../../classes/consoleoption.php";
include_once "../../../../classes/profilecategory.php";
include_once "../../../../classes/profileoption.php";
$consoleObj = new ConsoleOption($mysqli);
$member = new Member($mysqli);
$member->select($_SESSION['btUsername']);
$profileCatObj = new ProfileCategory($mysqli);
$profileObj = new ProfileOption($mysqli);
$cID = $consoleObj->findConsoleIDByName("Manage Profile Options");
$consoleObj->select($cID);
$_GET['cID'] = $cID;
if ($member->authorizeLogin($_SESSION['btPassword'])) {
    $memberInfo = $member->get_info_filtered();
    $selectedOption = "";
    $addSQL = "";
    if ($member->hasAccess($consoleObj) && $profileCatObj->select($_POST['catID'])) {
        if ($_POST['oID'] != "" and $profileObj->SELECT($_POST['oID'])) {
            $addSQL = " AND profileoption_id != '" . $_POST['oID'] . "'";
            $profileOptionInfo = $profileObj->get_info_filtered();
            if ($profileOptionInfo['profilecategory_id'] == $_POST['catID']) {
                $arrAssociates = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
                $highestIndex = count($arrAssociates) - 1;
                $arrFlipped = array_flip($arrAssociates);
                if ($highestIndex > 0) {
                    if ($arrFlipped[$_POST['oID']] == $highestIndex) {
                        $temp = $highestIndex - 1;
                        $selectedOption = $arrAssociates[$temp];
                    } else {
                        $temp = $arrFlipped[$_POST['oID']] + 1;
                        $selectedConsole = $arrAssociates[$temp];
                    }
Beispiel #2
0
$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 .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give the profile option a name.<br>";
    }
    // Check Category
    if (!$profileCatObj->select($_POST['optioncategory'])) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid profile category.<br>";
    } else {
        // Check Order
        $arrProfileOptionIDs = $profileCatObj->getAssociateIDs();
        $blnOrderCheck1 = $_POST['optionorder'] == "first" && count($arrProfileOptionIDs) > 1 && $profileOptionInfo['profilecategory_id'] == $_POST['optioncategory'];
        $blnOrderCheck2 = !in_array($_POST['optionorder'], $arrProfileOptionIDs) && $_POST['optionorder'] != "first";
        $blnOrderCheck3 = !$profileOptionObj->select($_POST['optionorder']) && $_POST['optionorder'] != "first";
        $blnOrderCheck4 = $_POST['optionorder'] == "first" && $_POST['optioncategory'] != $profileOptionInfo['profilecategory_id'] && count($arrProfileOptionIDs) > 0;
        if ($blnOrderCheck1 || $blnOrderCheck2 || $blnOrderCheck3 || $blnOrderCheck4) {
            $countErrors++;
            $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid profile option order.<br>";
        } elseif ($_POST['optionorder'] == "first") {
            $intNewSortNum = 1;
        } else {
Beispiel #3
0
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 ($makeMove != "") {
            $newSpot = $profileOptionObj->makeRoom($makeMove);
            if (is_numeric($newSpot)) {
Beispiel #4
0
 * License: http://www.bluethrust.com/license.php
 *
 */
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";
$cID = $_GET['cID'];
$profileCatObj = new ProfileCategory($mysqli);
if (!$profileCatObj->select($_GET['catID'])) {
    die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "members';</script>");
}
$profileCatInfo = $profileCatObj->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 Categories</a> > " . $profileCatInfo['name'] . "\");\n});\n</script>\n";
$dispError = "";
if ($_POST['submit']) {
    $countErrors = 0;
    // Check Cat Name
    if (trim($_POST['catname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must enter a Category Name.<br>";
    }
    // Check Category Order
    $intNewOrderSpot = $profileCatObj->validateOrder($_POST['catorder'], $_POST['beforeafter'], true, $profileCatInfo['ordernum']);
    if ($intNewOrderSpot === false) {
Beispiel #5
0
    $gamesPlayedSection = array("gamesplayedsection" => array("type" => "section", "options" => array("section_title" => "Games Played:"), "sortorder" => $i++));
    $mainGamePlayed = array("maingame" => array("type" => "select", "sortorder" => $i++, "display_name" => "Main Game", "value" => $memberInfo['maingame_id'], "db_name" => "maingame_id", "attributes" => array("class" => "textBox formInput")));
    foreach ($arrGames as $gameID) {
        $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);
    }
        exit;
    }
}
$cID = $_GET['cID'];
include_once $prevFolder . "classes/profilecategory.php";
include_once $prevFolder . "classes/profileoption.php";
$profileCatObj = new ProfileCategory($mysqli);
$profileOptionObj = new ProfileOption($mysqli);
if ($_POST['submit']) {
    // Check Option Name
    if (trim($_POST['optionname']) == "") {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You must give the profile option a name.<br>";
    }
    // Check Category
    if (!$profileCatObj->select($_POST['optioncategory'])) {
        $countErrors++;
        $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</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 .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid profile option order.<br>";
        } elseif ($_POST['optionorder'] == "first") {
            $intNewSortNum = 1;
        } else {
            if ($_POST['beforeafter'] == "before" || $_POST['beforeafter'] == "after") {