Ejemplo n.º 1
0
         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']) {
             $counter = 1;
             $result = $mysqli->query("DELETE FROM " . $dbprefix . "profileoptions_select WHERE profileoption_id = '" . $profileOptionInfo['profileoption_id'] . "'");
             foreach ($_SESSION['btProfileCache'] as $selectValue) {
                 $profileOptionObj->addNewSelectValue($selectValue, $counter);
                 $counter++;
             }
         }
         $profileOptionObj->resortOrder();
         $newProfileInfo = $profileOptionObj->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 Edited Profile Option: <b>" . $newProfileInfo['name'] . "</b>!\n\t\t\t\t</p>\n\t\t\t</div>\n\t\n\t\t\t<script type='text/javascript'>\n\t\t\t\tpopupDialog('Edit Profile Option', '" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "', 'successBox');\n\t\t\t</script>\n\t\t\t";
     } else {
         $countErrors++;
         $dispError .= "&nbsp;&nbsp;&nbsp;<b>&middot;</b> Unable to save information to the database!  Please contact the website administrator.<br>";
     }
Ejemplo 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";
    }
}