Esempio n. 1
0
     $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 {
         if ($_POST['beforeafter'] == "before" || $_POST['beforeafter'] == "after") {
             $intNewSortNum = $profileOptionObj->makeRoom($_POST['beforeafter']);
         } else {
             $countErrors++;
             $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> You selected an invalid profile option order.<br>";
         }
     }
 }
 if ($countErrors == 0) {
     if ($_POST['optiontype'] != "select") {
         $_POST['optiontype'] = "input";
     }
     $arrColumnNames = array("profilecategory_id", "name", "optiontype", "sortnum");
     $arrColumnValues = array($_POST['optioncategory'], $_POST['optionname'], $_POST['optiontype'], $intNewSortNum);
     $profileOptionObj->select($profileOptionInfo['profileoption_id']);
     if ($profileOptionObj->update($arrColumnNames, $arrColumnValues)) {
         if ($_POST['optiontype'] == "select" && $_SESSION['btProfileCacheRefresh']) {
Esempio n. 2
0
$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)) {
                $profileOptionObj->select($_POST['oID']);
                $profileOptionObj->update(array("sortnum"), array($newSpot));
            }
            $profileOptionObj->resortOrder();
        }
        include "main.php";
    }
}