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); } } $arrComponents = array_merge($arrComponents, $arrCustomOptions);
$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]; } } } } $profileCatInfo = $profileCatObj->get_info_filtered(); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "profileoptions WHERE profilecategory_id = '" . $profileCatInfo['profilecategory_id'] . "'" . $addSQL . " ORDER BY sortnum"); while ($row = $result->fetch_assoc()) { $strSelect = ""; if ($row['profileoption_id'] == $selectedOption) { $strSelect = "selected"; } $dispOptions .= "<option value='" . $row['profileoption_id'] . "' " . $strSelect . ">" . filterText($row['name']) . "</option>"; } if ($result->num_rows == 0) { $dispOptions = "<option value='first'>(no other profile options)</option>"; } echo $dispOptions; } }
<?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>"; }