Beispiel #1
0
$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
} 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 .= "&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();
Beispiel #3
0
        $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.");
Beispiel #4
0
 *
 */
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>";
    }
}
<?php

if (!defined("SHOW_PROFILE_MAIN")) {
    exit;
}
// CUSTOM PROFILE OPTIONS
$profileCatObj = new ProfileCategory($mysqli);
$profileOptionObj = new ProfileOption($mysqli);
$member->select($memberInfo['member_id']);
$result = $mysqli->query("SELECT * FROM " . $dbprefix . "profilecategory ORDER BY ordernum DESC");
while ($row = $result->fetch_assoc()) {
    $profileCatObj->select($row['profilecategory_id']);
    $arrProfileOptions = $profileCatObj->getAssociateIDs("ORDER BY sortnum");
    echo "\n\t\t<div class='formTitle' style='text-align: center; margin-top: 20px'>" . $profileCatObj->get_info_filtered("name") . "</div>\n\t\t<table class='profileTable' style='border-top-width: 0px'>\n\t";
    foreach ($arrProfileOptions as $profileOptionID) {
        $profileOptionObj->select($profileOptionID);
        echo "\n\t\t\n\t\t<tr>\n\t\t\t<td class='profileLabel alternateBGColor' valign='top'>" . $profileOptionObj->get_info_filtered("name") . ":</td>\n\t\t\t<td class='main' style='padding-left: 10px' valign='top'>" . $member->getProfileValue($profileOptionID) . "</td>\n\t\t</tr>\n\t\t\n\t\t";
    }
    echo "</table>";
}