private function saveRank($playerId, $tournamentId, $score, $oRank) { if ($oRank instanceof Doctrine_Record) { $oRank->score = $score; $oRank->save(); } else { $rank = new Rank(); $rank->Players_id = $playerId; $rank->Tournaments_id = $tournamentId; $rank->score = $score; $rank->save(); } }
public function addMember() { $rankObj = new Rank($this->MySQL); $rankObj->selectByOrder(2); $newMemRank = $rankObj->get_info("rank_id"); $appInfo = $this->get_info(); $arrColumns = array("username", "password", "password2", "rank_id", "email", "datejoined", "lastlogin", "lastseen"); $arrValues = array($appInfo['username'], $appInfo['password'], $appInfo['password2'], $newMemRank, $appInfo['email'], time(), time(), time()); if ($this->objMember->addNew($arrColumns, $arrValues)) { $this->setMemberProfile(); $returnVal = $this->update(array("memberadded"), array(1)); $this->notifyNewMember(); } return $returnVal; }
/** * Singleton Pattern * * Auto Create Object Instance. * */ public static function getInstance() { if (null === self::$_objInstance) { self::$_objInstance = new Rank(); } return self::$_objInstance; }
/** * @param $division_structure * @return string */ private function getDivisionLeaders($division_structure) { $division_leaders = Division::findDivisionLeaders($this->game_id); foreach ($division_leaders as $division_leader) { $aod_url = Member::createAODlink(['member_id' => $division_leader->member_id, 'rank' => Rank::convert($division_leader->rank_id)->abbr, 'forum_name' => $division_leader->forum_name]); $division_structure .= property_exists($division_leader, 'position_desc') ? "{$aod_url} - {$division_leader->position_desc}\r\n" : "{$aod_url}\r\n"; } return $division_structure; }
public function revokeRank($rank) { if (is_array($rank)) { $revokeReason = $rank['reason']; $rank = Rank::findOrFail($rank['model']->id); } if ($rank->count() && empty($rank->revoked_at)) { $this->getRankPivotBuilder($rank->id)->update(['revoke_reason' => $revokeReason, 'revoked_at' => Carbon::now()]); } }
/** * Create view */ private function createView() { $this->oView->addData('titre', Language::translate('PERMISSIONS_ADMIN_TABLE_TITLE')); $oTable = new TableGenerator(); $oTable->setId(md5('Access')); $aRanks = Rank::getRanks(); $oTable->addColumn(''); foreach ($aRanks as $oRank) { $oTable->addColumn($oRank->getName()); } $aModules = Permission::getModules(); foreach ($aModules as $iId => $sName) { $aBuffer = array(); $aBuffer[] = $sName; foreach ($aRanks as $oRank) { if ($oRank->checkAccess($sName)) { $sIcon = 'fa-check'; $sStyle = 'success'; $sNewValue = 'false'; } else { $sIcon = 'fa-times'; $sStyle = 'danger'; $sNewValue = 'true'; } $oLabel = new View('minibutton'); $oLabel->addData('icon', $sIcon); $oLabel->addData('style', $sStyle); $oLabel->addData('link', 'index.php?p=adminpermissions&m=' . $iId . '&r=' . $oRank->getId() . '&v=' . $sNewValue); $oLabel->create(); $aBuffer[] = $oLabel->getCode(); } $oTable->addLine($aBuffer); } $oTable->setBottom(''); $oTable->create(); $this->oView->addData('content', $oTable->getCode()); $this->oView->Create(); }
} elseif ($memberInfo['promotepower'] == -1) { $rankInfo['promotepower'] = 0; } $cID = $_GET['cID']; $dispError = ""; $countErrors = 0; if ($memberInfo['rank_id'] == 1) { $maxOrderNum = $mysqli->query("SELECT MAX(ordernum) FROM " . $dbprefix . "ranks WHERE rank_id != '1'"); $arrMaxOrderNum = $maxOrderNum->fetch_array(MYSQLI_NUM); if ($maxOrderNum->num_rows > 0) { $result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE ordernum = '" . $arrMaxOrderNum[0] . "'"); $row = $result->fetch_assoc(); $rankInfo['promotepower'] = $row['rank_id']; } } $rankObj = new Rank($mysqli); if ($_POST['submit']) { $rankObj->select($rankInfo['promotepower']); $maxRankInfo = $rankObj->get_info_filtered(); if ($rankInfo['rank_id'] == 1) { $maxRankInfo['ordernum'] += 1; } $arrRanks = array(); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "ranks WHERE ordernum <= '" . $maxRankInfo['ordernum'] . "' AND rank_id != '1' ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $arrRanks[] = $row['rank_id']; if ($maxRankInfo['ordernum'] > $row['ordernum']) { $arrMemRanks[] = $row['rank_id']; } } // Check Member
/** * Créer la Popup d'ajout d'un utilisateur * @param \Rank $p_aRanks Rangs possibles * @return string */ private function createAddPopup($p_aRanks) { $oPopupAdd = new View('popup'); $oPopupAdd->addData('id', 'adduser'); $oPopupAdd->addData('buttonstyle', 'btn-success'); $oPopupAdd->addData('buttonicon', 'fa-plus'); $oPopupAdd->addData('buttontext', 'Ajouter'); $oPopupAdd->addData('title', 'Ajouter un utilisateur'); $oFormAdd = new FormGenerator(); $oFormAdd->setAction('index.php?p=adminusers'); $oFormAdd->addInput('Identifiant', 'login', true, false, 'text', 'Identifiant ...'); $oFormAdd->addInput('Password', 'password', true, false, 'password', 'Password ...'); $oFormAdd->addInput('Confirmation', 'confirmation', true, false, 'password', 'Confirmation ...'); $oFormAdd->addInput('Email', 'mail', true, false, 'text', 'Email ...'); $oFormAdd->addSelect('Rang', 'rank', $p_aRanks, Rank::getDefaultRank()->getId()); $oFormAdd->create(); $oPopupAdd->addData('content', $oFormAdd->getCode()); $oPopupAdd->create(); return $oPopupAdd->getCode(); }
function thankyouAction() { $this->view->activeTab = 'Polls'; $this->view->title = $this->view->title = $this->view->translate("Wildfire") . " - " . $this->view->translate("Thanks_For_Poll"); $consumer = $this->_currentUser; $id = (int) $this->_request->getParam('survey', 0); $profileSurveyModel = new ProfileSurvey(); $profileSurvey = $profileSurveyModel->fetchRow("i2_survey_id =" . $id . " or " . "i2_survey_id_en =" . $id); // $this->view->point = $profileSurvey->points; //check history to prevent multiple participation $db = Zend_Registry::get('db'); $select1 = $db->select(); $select1->from("poll_participation", "count(*)"); $select1->where("poll_participation.poll_id = ?", $profileSurvey->id); $select1->where("poll_participation.consumer_id = ?", $consumer->id); $participationCount = $db->fetchOne($select1); if ($participationCount == 0) { // check ws $indicate2Connect = new Indicate2_Connect(); $ids = array($id); $wsResult = $indicate2Connect->getAnswerSetCount($consumer->email, $ids); // Zend_Debug::dump($wsResult."------------".$profileSurvey->points);die; if ($wsResult > 0) { // add poll participation $currentTime = date("Y-m-d H:i:s"); $pollParticipationModel = new PollParticipation(); $pollParticipation = $pollParticipationModel->createRow(); $pollParticipation->poll_id = $profileSurvey->id; $pollParticipation->consumer_id = $consumer->id; $pollParticipation->date = $currentTime; $pollParticipation->save(); // add points $pointRecordModel = new RewardPointTransactionRecord(); $point = $pointRecordModel->createRow(); $point->consumer_id = $consumer->id; $point->transaction_id = 3; $point->date = $currentTime; $point->point_amount = $profileSurvey->points; $point->save(); //2011-05-13 change the rank of consumer $rankModel = new Rank(); $rankModel->changeConsumerRank($consumer->id); $this->view->point = $point->point_amount; } else { // add poll participation $currentTime = date("Y-m-d H:i:s"); $pollParticipationModel = new PollParticipation(); $pollParticipation = $pollParticipationModel->createRow(); $pollParticipation->poll_id = $profileSurvey->id; $pollParticipation->consumer_id = $consumer->id; $pollParticipation->date = $currentTime; $pollParticipation->save(); // add points $pointRecordModel = new RewardPointTransactionRecord(); $point = $pointRecordModel->createRow(); $point->consumer_id = $consumer->id; $point->transaction_id = 3; $point->date = $currentTime; $point->point_amount = $profileSurvey->points; $point->save(); //2011-05-13 change the rank of consumer $rankModel = new Rank(); $rankModel->changeConsumerRank($consumer->id); $this->view->point = $point->point_amount; } } }
// Classes needed for index.php $ipbanObj = new Basic($mysqli, "ipban", "ipaddress"); if ($ipbanObj->select($IP_ADDRESS, false)) { $ipbanInfo = $ipbanObj->get_info(); if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>"); } else { $ipbanObj->delete(); } } // Start Page $PAGE_NAME = "Members - "; $dispBreadCrumb = ""; include $prevFolder . "themes/" . $THEME . "/_header.php"; $member = new Member($mysqli); $rankObj = new Rank($mysqli); // Disable Members for Inactivity if ($websiteInfo['maxdsl'] != 0) { $maxDSLTime = time() - $websiteInfo['maxdsl'] * 86400; $time = time(); $result = $mysqli->query("UPDATE " . $dbprefix . "members SET disabled = '1', disableddate = '" . $time . "' WHERE disabled = '0' AND rank_id != '1' AND onia = '0' AND lastlogin <= '" . $maxDSLTime . "'"); $result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "members WHERE disableddate = '" . $time . "'"); while ($row = $result->fetch_assoc()) { $arrLogColumns = array("member_id", "logdate", "message"); $arrLogValues = array($row['member_id'], $time, "Disabled due to inactivity."); $logObj->addNew($arrLogColumns, $arrLogValues); } } // Disable members who fail to be promoted for auto-disable ranks $arrRanks = array(); $result = $mysqli->query("SELECT rank_id FROM " . $dbprefix . "ranks WHERE autodisable != '0'");
if ($memberObj->hasAccess($consoleOptionObj)) { $shoutBoxPostLink = $MAIN_ROOT . "members/include/news/include/postshoutbox.php"; } $arrSpecialMenuItems = array(); // TOP PLAYERS $arrSpecialMenuItems['top-players'] = " <b>·</b> <a href='" . $MAIN_ROOT . "top-players/recruiters.php'>Recruiters</a><br>"; $hpGameObj = new Game($mysqli); $arrGames = $hpGameObj->getGameList(); foreach ($arrGames as $gameID) { $hpGameObj->select($gameID); $arrSpecialMenuItems['top-players'] .= " <b>·</b> <a href='" . $MAIN_ROOT . "top-players/game.php?gID=" . $gameID . "'>" . $hpGameObj->get_info_filtered("name") . "</a><br>"; } // NEWEST MEMBERS $arrSpecialMenuItems['newmembers'] = "<div style='margin-left: 3px; margin-right: 3px; margin-top: 5px; margin-bottom: 20px'>"; $menuMemberObj = new Member($mysqli); $menuMemberRankObj = new Rank($mysqli); $counter = 0; $result = $mysqli->query("SELECT member_id FROM " . $dbprefix . "members WHERE rank_id != '1' ORDER BY datejoined DESC LIMIT 5"); while ($row = $result->fetch_assoc()) { $addCSS = ""; if ($counter == 0) { $addCSS = " alternateBGColor"; $counter = 1; } else { $counter = 0; } $arrSpecialMenuItems['newmembers'] .= "<div class='dottedLine " . $addCSS . "' style='padding: 5px 5px'>"; $menuMemberObj->select($row['member_id']); $newestMemberInfo = $menuMemberObj->get_info_filtered(); $checkURL = parse_url($newestMemberInfo['profilepic']); if ((!isset($checkURL['scheme']) || $checkURL['scheme'] == "") && $newestMemberInfo['profilepic'] != "") {
public function next() { $rank = Rank::getRandomRank(); $card = new Card($rank); return $card; }
echo $memberInfo->forum_name; ?> </li> </ul> <div class='page-header vertical-align'> <div class='col-xs-1 hidden-sm hidden-xs'> <?php echo Member::avatar($memberInfo->member_id, 'large'); ?> </div> <div class='col-xs-5'> <h2> <strong><?php echo Rank::convert($memberInfo->rank_id)->abbr . " " . $memberInfo->forum_name; ?> </strong> <span class="games_played"> <?php if (count($gamesPlayed)) { $gamesPlayed = arrayToObject($gamesPlayed); ?> <?php foreach ($gamesPlayed as $game) { ?> <?php $img = "assets/images/game_icons/16x16/{$game->short_name}.png"; ?> <?php if (file_exists($img)) {
function add_hierarchy_entry(&$row, $parent_hierarchy_entry_id, $ancestry, $branch_kingdom) { self::debug_iterations("Inserting taxon"); self::commit_iterations("Taxa", 500); if ($this->archive_validator->has_error_by_line('http://rs.tdwg.org/dwc/terms/taxon', $row['archive_file_location'], $row['archive_line_number'])) { write_to_resource_harvesting_log("ERROR: add_hierarchy_entry: has_error_by_line" . ",file_location:" . $row['archive_file_location'] . ",line_number:" . $row['archive_line_number']); return false; } // make sure this taxon has a name, otherwise skip this branch $scientific_name = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/scientificName']); $authorship = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/scientificNameAuthorship']); $kingdom = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/kingdom']); $genus = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/genus']); $rank_label = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonRank']); // COL exception if (strtolower($kingdom) == 'viruses') { if (substr($scientific_name, -1) == ":") { $scientific_name = substr($scientific_name, 0, -1); } if (preg_match("/^(.*) ICTV\$/i", $scientific_name, $arr)) { $scientific_name = $arr[1]; } } // COL exception if (strtolower($kingdom) == 'viruses' && $genus && strtolower($rank_label) != 'genus') { if (stripos($scientific_name, $genus) == 0) { $scientific_name = ucfirst(trim(substr($scientific_name, strlen($genus)))); } } else { if ($authorship && stripos($scientific_name, $authorship) === false) { $scientific_name = trim($scientific_name . " " . $authorship); } } if (!$scientific_name) { return false; } $taxon_id = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonID']); if (!$taxon_id) { $taxon_id = @self::field_decode($row['http://purl.org/dc/terms/identifier']); } if (!$taxon_id) { debug("ERROR - no taxon ID for {$scientific_name}, skipping"); return false; } if (isset($this->taxon_ids_inserted[$taxon_id])) { // this taxon_id has already been inserted meaning this tree has a loop in it - so stop debug("ERROR - taxon ID ({$taxon_id}) for {$scientific_name} already inserted; LOOP?"); return false; } $scientific_name = ucfirst($scientific_name); $name = Name::find_or_create_by_string($scientific_name); if (@(!$name->id)) { debug("ERROR - Failed to insert name: {$scientific_name}"); return false; } $phylum = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/phylum']); $class = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/class']); $order = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/order']); $family = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/family']); $rank = Rank::find_or_create_by_translated_label($rank_label); $dataset_id = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/datasetID']); $taxonomic_status = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonomicStatus']); $source_url = @self::field_decode($row['http://rs.tdwg.org/ac/terms/furtherInformationURL']); if (!$source_url) { $source_url = @self::field_decode($row['http://purl.org/dc/terms/source']); } if (!$source_url) { $source_url = @self::field_decode($row['http://purl.org/dc/terms/references']); } if (!$source_url) { $source_url = @self::field_decode($row['http://purl.org/dc/terms/isReferencedBy']); } if (isset($row['http://rs.tdwg.org/dwc/terms/taxonRemarks'])) { $taxon_remarks = @self::field_decode($row['http://rs.tdwg.org/dwc/terms/taxonRemarks']); } else { $taxon_remarks = NULL; } if (!$taxon_remarks && strtolower($taxonomic_status) == 'provisionally accepted name') { $taxon_remarks = "provisionally accepted name"; } // TODO: This block is somewhat confusing. Clearly, it's clearing the // rank that's currently being read, but shouldn't it also clear all of // the ranks below that? if (strtolower($rank_label) == 'kingdom') { $kingdom = null; } if (strtolower($rank_label) == 'phylum') { $phylum = null; } if (strtolower($rank_label) == 'class') { $class = null; } if (strtolower($rank_label) == 'order') { $order = null; } if (strtolower($rank_label) == 'family') { $family = null; } if (strtolower($rank_label) == 'genus') { $genus = null; } // these are the taxa using the adjacency list format if (!$parent_hierarchy_entry_id && ($kingdom || $phylum || $class || $order || $family || $genus)) { $params = array("identifier" => $taxon_id, "source_url" => $source_url, "kingdom" => ucfirst($kingdom), "phylum" => ucfirst($phylum), "class" => ucfirst($class), "order" => ucfirst($order), "family" => ucfirst($family), "genus" => ucfirst($genus), "scientificName" => ucfirst($scientific_name), "name" => $name, "rank" => $rank, "taxon_remarks" => $taxon_remarks); $hierarchy_entry = HierarchyEntry::create_entries_for_taxon($params, $this->harvest_event->resource->hierarchy_id); if (@(!$hierarchy_entry->id)) { debug("ERROR - unable to insert hierarchy entry for {$scientific_name}"); return; } // NOTE: This is NOT adding a hierarchy entry, but a // harvest_event_hierarchy_entry: // TODO: I am not sure this adds entries for ancestors! $this->harvest_event->add_hierarchy_entry($hierarchy_entry, 'inserted'); $this->taxon_ids_inserted[$taxon_id] = array('hierarchy_entry_id' => $hierarchy_entry->id, 'taxon_concept_id' => $hierarchy_entry->taxon_concept_id, 'source_url' => $source_url); self::compress_array($this->taxon_ids_inserted[$taxon_id]); } else { $params = array("identifier" => $taxon_id, "source_url" => $source_url, "name_id" => $name->id, "parent_id" => $parent_hierarchy_entry_id, "hierarchy_id" => $this->harvest_event->resource->hierarchy_id, "rank" => $rank, "ancestry" => $ancestry, "taxon_remarks" => $taxon_remarks); $hierarchy_entry = HierarchyEntry::find_or_create_by_array($params); if (@(!$hierarchy_entry->id)) { return; } $this->harvest_event->add_hierarchy_entry($hierarchy_entry, 'inserted'); $this->taxon_ids_inserted[$taxon_id] = array('hierarchy_entry_id' => $hierarchy_entry->id, 'taxon_concept_id' => $hierarchy_entry->taxon_concept_id, 'source_url' => $source_url); self::compress_array($this->taxon_ids_inserted[$taxon_id]); } if (!isset($this->entry_references_deleted[$hierarchy_entry->id])) { $hierarchy_entry->delete_refs(); $this->entry_references_deleted[$hierarchy_entry->id] = true; } if (!isset($this->entry_vernacular_names_deleted[$hierarchy_entry->id])) { $this->mysqli->delete("DELETE FROM synonyms WHERE hierarchy_entry_id={$hierarchy_entry->id} AND hierarchy_entry_id={$hierarchy_entry->id} AND hierarchy_id=" . $this->harvest_event->resource->hierarchy_id . " AND language_id!=0 AND language_id!=" . Language::find_or_create_for_parser('scientific name')->id); $this->entry_vernacular_names_deleted[$hierarchy_entry->id] = true; } if (!isset($this->entry_synonyms_deleted[$hierarchy_entry->id])) { $hierarchy_entry->delete_synonyms(); $this->entry_synonyms_deleted[$hierarchy_entry->id] = true; } if ($name_published_in = @$row['http://rs.tdwg.org/dwc/terms/namePublishedIn']) { $individual_references = explode("||", $name_published_in); foreach ($individual_references as $reference_string) { $reference = Reference::find_or_create_by_full_reference(trim($reference_string)); if (@$reference->id) { $hierarchy_entry->add_reference($reference->id); $this->mysqli->query("UPDATE refs SET published=1, visibility_id=" . Visibility::visible()->id . " WHERE id={$reference->id}"); } } } // keep track of reference foreign keys self::append_foreign_keys_from_row($row, 'http://eol.org/schema/reference/referenceID', $this->taxon_reference_ids, $hierarchy_entry->id); if (isset($this->synonyms[$taxon_id])) { foreach ($this->synonyms[$taxon_id] as $synonym_row) { self::uncompress_array($synonym_row); $synonym_scientific_name = @self::field_decode($synonym_row['http://rs.tdwg.org/dwc/terms/scientificName']); $synonym_authorship = @self::field_decode($synonym_row['http://rs.tdwg.org/dwc/terms/scientificNameAuthorship']); if ($synonym_authorship && stripos($synonym_scientific_name, $synonym_authorship) === false) { $synonym_scientific_name = trim($synonym_scientific_name . " " . $synonym_authorship); } if (!$synonym_scientific_name) { continue; } $synonym_taxon_id = @self::field_decode($synonym_row['http://rs.tdwg.org/dwc/terms/taxonID']); if (!$synonym_taxon_id) { $taxon_id = @self::field_decode($synonym_row['http://purl.org/dc/terms/identifier']); } if (!$synonym_taxon_id) { continue; } $synonym_name = Name::find_or_create_by_string(ucfirst($synonym_scientific_name)); if (@(!$synonym_name->id)) { continue; } $taxonomic_status = @self::field_decode($synonym_row['http://rs.tdwg.org/dwc/terms/taxonomicStatus']) ?: 'synonym'; if (isset($synonym_row['http://rs.tdwg.org/dwc/terms/taxonRemarks'])) { $taxon_remarks = @self::field_decode($synonym_row['http://rs.tdwg.org/dwc/terms/taxonRemarks']); } else { $taxon_remarks = NULL; } $synonym_relation = SynonymRelation::find_or_create_by_translated_label($taxonomic_status); $hierarchy_entry->add_synonym($synonym_name->id, @$synonym_relation->id ?: 0, 0, 0, 0, 0, $taxon_remarks); } unset($this->synonyms[$taxon_id]); } // COL exception if ($dataset_id && isset($this->dataset_metadata[$dataset_id]) && ($metadata = $this->dataset_metadata[$dataset_id])) { $hierarchy_entry->delete_agents(); $agent_name = $metadata['title']; if ($editors = $metadata['editors']) { $agent_name .= " by {$editors}"; } $params = array("full_name" => $agent_name, "agent_role" => AgentRole::find_or_create_by_translated_label('Source')); $agent = Agent::find_or_create($params); $hierarchy_entry->add_agent($agent->id, @$a['agent_role']->id ?: 0, 0); $reference = Reference::find_or_create(array("full_reference" => $metadata['citation'])); $this->mysqli->insert("INSERT IGNORE INTO hierarchy_entries_refs (hierarchy_entry_id, ref_id) VALUES ({$hierarchy_entry->id}, {$reference->id})"); $this->mysqli->query("UPDATE refs SET published=1, visibility_id=" . Visibility::visible()->id . " WHERE id={$reference->id}"); } $parameters = array('archive_table_definition' => (object) array('row_type' => 'http://rs.tdwg.org/dwc/terms/Taxon')); $this->insert_data($row, $parameters); if (isset($this->children[$taxon_id])) { // set the ancestry for its children if ($ancestry) { $this_ancestry = $ancestry . "|" . $name->id; } else { $this_ancestry = $name->id; } foreach ($this->children[$taxon_id] as &$row) { self::uncompress_array($row); $this->add_hierarchy_entry($row, $hierarchy_entry->id, $this_ancestry, $branch_kingdom); } unset($this->children[$taxon_id]); } unset($hierarchy_entry); unset($row); }
// Classes needed for index.php $ipbanObj = new Basic($mysqli, "ipban", "ipaddress"); if ($ipbanObj->select($IP_ADDRESS, false)) { $ipbanInfo = $ipbanObj->get_info(); if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>"); } else { $ipbanObj->delete(); } } // Start Page $PAGE_NAME = "Ranks - "; $dispBreadCrumb = ""; include $prevFolder . "themes/" . $THEME . "/_header.php"; $member = new Member($mysqli); $rankObj = new Rank($mysqli); $rankCatObj = new RankCategory($mysqli); $breadcrumbObj->setTitle("Ranks"); $breadcrumbObj->addCrumb("Home", $MAIN_ROOT); $breadcrumbObj->addCrumb("Ranks"); include $prevFolder . "include/breadcrumb.php"; ?> <table id='rankPageTable' class='formTable' style='width: 75%; margin-left: auto; margin-right: auto'> <?php $result = $mysqli->query("SELECT rankcategory_id FROM " . $dbprefix . "rankcategory WHERE hidecat = '0' ORDER BY ordernum DESC"); while ($row = $result->fetch_assoc()) { $rankCatObj->select($row['rankcategory_id']); $rankCatInfo = $rankCatObj->get_info_filtered(); if ($rankCatInfo['useimage'] == 1 && $rankCatInfo['imageurl'] != "") {
<?php foreach ($squads as $squad) { ?> <?php $leader = Member::findById($squad->leader_id); ?> <?php $platoon = Platoon::findById($squad->platoon_id); ?> <option value='<?php echo $squad->id; ?> '><?php echo $squad->leader_id != 0 ? Rank::convert($leader->rank_id)->abbr . " " . ucwords($leader->forum_name) : "TBA (Squad #{$squad->id})"; ?> - <?php echo $platoon->name; ?> </option> <?php } ?> <?php } ?> <option value='0' selected>None (Division Leader)</option>
} // Check Auto Days if ($_POST['autodays'] != "") { if (!is_numeric($_POST['autodays']) or is_numeric($_POST['autodays']) and $_POST['autodays'] < 0) { $countErrors++; $dispError .= " <b>·</b> Auto days must either be blank or a positive numeric value.<br>"; } } if ($_POST['autodisable'] != "") { if (!is_numeric($_POST['autodisable']) or is_numeric($_POST['autodisable']) and $_POST['autodisable'] < 0) { $countErrors++; $dispError .= " <b>·</b> Auto disable must either be blank or a positive numeric value.<br>"; } } // Check Rank Order and Promote Power $checkRankObj = new Rank($mysqli); if ($_POST['rankorder'] == $rankInfo['rank_id']) { // Hack attempt $countErrors++; $dispError .= " <b>·</b> You selected an invalid rank order. (possible hack attempt?)<br>"; } //Check if rank selected for rank order is an actual rank if ($checkRankObj->select($_POST['rankorder'])) { $checkRankInfo = $checkRankObj->get_info(); if ($_POST['beforeafter'] == "before") { $intTempRankOrder = $checkRankInfo['ordernum'] + 1; } else { $intTempRankOrder = $checkRankInfo['ordernum'] - 1; } // If the rank order is the same do nothing keep it the same // If its not the same make room for the new order and then resort ordernum
<?php require_once dirname(__FILE__) . '/features/classes/Servants.php'; require_once dirname(__FILE__) . '/features/classes/Rank.php'; $servantsObj = new Servants(); $servantsObj->connect(); $servantsObj->fetch_servants(); $rankObj = new Rank(); $rankObj->connect(); $rankObj->fetch_rank(); ?> <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <meta name="Description" content="Strona jednego z najstarszych polskich klanów Diablo. Zrzeszamy graczy serii Diablo od 2000 roku. Od 2012 roku nasza działalność skupia się na scenie Diablo 3!"/> <meta name="Keywords" content="Diablo, Diablo 3, Diablo3, Diablo III, Klan, Clan, AZM, Clan AZM, Klan AZM, Słudzy Azmodana, Azmodan, forum, PvP, d3cl, "/> <link rel="stylesheet" href="style.css" type="text/css"/> <title>Słudzy Azmodana =AZM= klan Diablo 3</title> <script type='text/javascript' src='jquery-1.10.js'></script> <script src='nprogress.js'></script> <link rel="stylesheet" type="text/css" media="all" href="nprogress.css"/> <script> // NProgress.start(); </script> </head> <body> <div id="tabela">
'></input> <div class="form-group"> <select name="leader_id" class="form-control"> <?php if (count((array) $leaders)) { ?> <?php foreach ($leaders as $leader) { ?> <option value="<?php echo $leader->id; ?> "><?php echo Rank::convert($leader->rank_id)->abbr . " " . ucwords($leader->forum_name); ?> </option> <?php } ?> <?php } ?> <option value="0">None</option> </select> </div> </div>
public function generate() { // header $division_structure = "[table='align:center,width: {$this->info_width}']"; $division_structure .= "[tr][td]"; // banner $division_structure .= "[center][img]http://puu.sh/kGjU9/4f331d1a99.jpg[/img][/center]\r\n"; /** * ------division leaders----- */ $division_structure .= "\r\n\r\n[center][size=5][color={$this->div_name_color}][b][i][u]Division Leaders[/u][/i][/b][/color][/size][/center]\r\n"; $division_structure .= "[center][size=4]"; $division_leaders = Division::findDivisionLeaders($this->game_id); foreach ($division_leaders as $player) { $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name; $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name, 'color' => $this->division_leaders_color)); $division_structure .= "{$aod_url} - {$player->position_desc}\r\n"; } $division_structure .= "[/size][/center]\r\n\r\n"; /** * -----general sergeants----- */ $division_structure .= "[center][size=3][color={$this->platoon_pos_color}]General Sergeants[/color]\r\n"; $general_sergeants = Division::findGeneralSergeants($this->game_id); foreach ($general_sergeants as $player) { $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name; $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name)); $division_structure .= "{$aod_url}\r\n"; } $division_structure .= "[/size][/center]"; $division_structure .= "[/td][/tr][/table]"; /** * ---------platoons---------- */ $division_structure .= "\r\n\r\n[table='align:center,width: {$this->players_width}']"; $platoons = $this->platoons; $i = 1; foreach ($platoons as $platoon) { $countMembers = Platoon::countPlatoon($platoon->id); if ($i == 1) { $division_structure .= "[tr]"; $division_structure .= "[td]"; } else { $division_structure .= "[td]"; } $division_structure .= "[size=5]{$platoon->name}[/size]\r\n\r\n"; // Legion Commander $player = Member::findByMemberId($platoon->leader_id); // is a Legion Commander assigned? if ($platoon->leader_id != 0) { $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name; $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name, 'color' => $this->platoon_leaders_color)); $division_structure .= "[size=3][color={$this->platoon_pos_color}]Legion Commander[/color]\r\n{$aod_url}[/size]\r\n\r\n"; } else { $division_structure .= "[size=3][color={$this->platoon_pos_color}]Legion Commander[/color]\r\n[color={$this->platoon_leaders_color}]TBA[/color][/size]\r\n\r\n"; } // Regimental Leaders $squads = Squad::findAll($this->game_id, $platoon->id); foreach ($squads as $squad) { if ($squad->leader_id != 0) { $squad_leader = Member::findById($squad->leader_id); $player_name = Rank::convert($squad_leader->rank_id)->abbr . " " . $squad_leader->forum_name; $aod_url = Member::createAODlink(array('member_id' => $squad_leader->member_id, 'forum_name' => $player_name, 'color' => $this->squad_leaders_color)); $division_structure .= "[size=3][color={$this->platoon_pos_color}]Regimental Leader[/color]\r\n{$aod_url}[/size]\r\n\r\n"; $division_structure .= "[size=1]"; // direct recruits $recruits = arrayToObject(Member::findRecruits($squad_leader->member_id, $squad_leader->platoon_id, $squad->id, true)); if (count((array) $recruits)) { $division_structure .= "[list=1]"; foreach ($recruits as $player) { $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name; $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name)); $division_structure .= "[*]{$aod_url}\r\n"; } $division_structure .= "[/list]"; } } else { $division_structure .= "[size=3][color={$this->platoon_pos_color}]Regimental Leader[/color]\r\n[color={$this->squad_leaders_color}]TBA[/color][/size]\r\n"; $division_structure .= "[size=1]"; } $division_structure .= "\r\n"; // squad members $squadMembers = arrayToObject(Squad::findSquadMembers($squad->id, true, $squad_leader->member_id)); if (count((array) $squadMembers)) { foreach ($squadMembers as $player) { $player_name = Rank::convert($player->rank_id)->abbr . " " . $player->forum_name; $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => $player_name)); $division_structure .= "{$aod_url}\r\n"; } } $division_structure .= "[/size]\r\n"; } $division_structure .= "\r\n\r\n"; if ($i % $this->num_columns == 0) { $division_structure .= "[/td][/tr][tr]"; } $division_structure .= "[/td]"; $i++; } // end last platoon $division_structure .= "[/tr][/table]\r\n\r\n"; /** * --------part timers-------- */ $i = 1; // header $division_structure .= "\r\n[table='align:center,width: {$this->info_width}']"; $division_structure .= "[tr][td]\r\n[center][size=3][color={$this->platoon_pos_color}][b]Part Time Members[/b][/color][/size][/center][/td][/tr]"; $division_structure .= "[/table]\r\n\r\n"; // players $division_structure .= "[table='align:center,width: {$this->info_width}']"; $division_structure .= "[tr][td]"; $partTimers = PartTime::find_all($this->game_id); foreach ($partTimers as $player) { if ($i % 20 == 0) { $division_structure .= "[/td][td]"; } $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => "AOD_" . $player->forum_name)); $division_structure .= "{$aod_url}\r\n"; $i++; } $division_structure .= "[/td]"; $division_structure .= "[/tr][/table]\r\n\r\n"; /** * -----------LOAS------------ */ if (count((array) LeaveOfAbsence::find_all($this->game_id))) { $i = 1; // header $division_structure .= "\r\n[table='align:center,width: {$this->info_width}']"; $division_structure .= "[tr][td]\r\n[center][size=3][color={$this->platoon_pos_color}][b]Leaves of Absence[/b][/color][/size][/center][/td][/tr]"; $division_structure .= "[/table]\r\n\r\n"; // players $division_structure .= "[table='align:center,width: {$this->info_width}']"; $loas = LeaveOfAbsence::find_all($this->game_id); foreach ($loas as $player) { $date_end = strtotime($player->date_end) < strtotime('now') ? "[COLOR='#FF0000']Expired " . formatTime(strtotime($player->date_end)) . "[/COLOR]" : date("M d, Y", strtotime($player->date_end)); $profile = Member::findByMemberId($player->member_id); $aod_url = Member::createAODlink(array('member_id' => $player->member_id, 'forum_name' => "AOD_" . $profile->forum_name)); $division_structure .= "[tr][td]{$aod_url}[/td][td]{$date_end}[/td][td]{$player->reason}[/td][/tr]"; $i++; } $division_structure .= "[/table]"; } $this->content = $division_structure; }
$memberObj->update(array("loggedin"), array(1)); } $actualPageNameLoc = strrpos($PAGE_NAME, " - "); $actualPageName = substr($PAGE_NAME, 0, $actualPageNameLoc); if ($PAGE_NAME == "") { $actualPageName = "Home Page"; } $lastSeenLink = "<a href='" . $dispHTTP . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] . "'>" . $actualPageName . "</a>"; $arrUpdateColLastSeen = array("lastseen", "lastseenlink"); $arrUpdateValLastSeen = array(time(), $lastSeenLink); if (time() - $memberInfo['lastlogin'] > 3600) { $arrUpdateColLastSeen[] = "lastlogin"; $arrUpdateValLastSeen[] = time(); } $memberObj->update($arrUpdateColLastSeen, $arrUpdateValLastSeen); $rankObj = new Rank($mysqli); $rankObj->select($memberInfo['rank_id']); $rankInfo = $rankObj->get_info(); $memberRank = $rankInfo['name']; $consoleOptionObj = new ConsoleOption($mysqli); // Members Only Tagger $dispMembersOnlyTagger = ""; if (isset($_SESSION['btMembersOnlyTagger']) && $_SESSION['btMembersOnlyTagger'] == 1 && substr($_SERVER['PHP_SELF'], -11) != "console.php") { $pageTaggerURL = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $taggerCID = $consoleOptionObj->findConsoleIDByName("Member's Only Pages"); if ($taggerObj->select($pageTaggerURL, false)) { $pageTagStatus = "<span class='pendingFont'>Member's Only</span>"; $dispTagOrUntag = "Untag"; } else { $pageTagStatus = "<span class='publicNewsColor'>Public</span>"; $dispTagOrUntag = "Tag";
function get_privileges() { $returnArr = array(); $filterArray = array(); $rankObj = new Rank($this->MySQL); if ($this->intTableKeyValue != "") { $rankObj->select($this->arrObjInfo['rank_id']); $arrPrivileges = $rankObj->get_privileges(); $result = $this->MySQL->query("SELECT * FROM " . $this->MySQL->get_tablePrefix() . "console_members WHERE member_id = '" . $this->intTableKeyValue . "'"); while ($row = $result->fetch_assoc()) { if ($row['allowdeny'] == 1 && !in_array($row['console_id'], $arrPrivileges)) { $arrPrivileges[] = $row['console_id']; } elseif ($row['allowdeny'] == 0 && in_array($row['console_id'], $arrPrivileges)) { $key = array_search($row['console_id'], $arrPrivileges); $arrPrivileges[$key] = 0; } } } return $arrPrivileges; }
include_once "../../../classes/consoleoption.php"; $consoleObj = new ConsoleOption($mysqli); $member = new Member($mysqli); $member->select($_SESSION['btUsername']); $cID = $consoleObj->findConsoleIDByName("Private Messages"); $consoleObj->select($cID); if ($member->authorizeLogin($_SESSION['btPassword']) && $member->hasAccess($consoleObj)) { $memberInfo = $member->get_info_filtered(); $searchTerm = $mysqli->real_escape_string($_GET['term']); $pmSessionID = $_GET['pmsessionid']; $filterMembers = "('')"; $checkFilterList = implode("", $_SESSION['btComposeList'][$pmSessionID]['member']); if (is_numeric($checkFilterList)) { $filterMembers = "('" . implode("','", $_SESSION['btComposeList'][$pmSessionID]['member']) . "')"; } $rankObj = new Rank($mysqli); $result = $mysqli->query("SELECT " . $dbprefix . "members.*, " . $dbprefix . "ranks.name FROM " . $dbprefix . "members, " . $dbprefix . "ranks WHERE " . $dbprefix . "members.disabled = '0' AND " . $dbprefix . "members.rank_id = " . $dbprefix . "ranks.rank_id AND " . $dbprefix . "members.username LIKE '" . $searchTerm . "%' AND " . $dbprefix . "members.member_id NOT IN " . $filterMembers . " ORDER BY " . $dbprefix . "members.username"); while ($row = $result->fetch_assoc()) { $rankObj->select($row['rank_id']); $displayName = $rankObj->get_info_filtered("name") . " " . filterText($row['username']); $arrComposeList[] = array("id" => "member_" . $row['member_id'], "value" => $displayName); } $arrQuery['rankcategory']['query'] = "SELECT * FROM " . $dbprefix . "rankcategory WHERE name LIKE '" . $searchTerm . "%' AND rankcategory_id NOT IN "; $arrQuery['rankcategory']['orderby'] = " ORDER BY ordernum DESC"; $arrQuery['rankcategory']['id'] = "rankcategory_id"; $arrQuery['rankcategory']['append'] = " - Category"; $arrQuery['rank']['query'] = "SELECT * FROM " . $dbprefix . "ranks WHERE name LIKE '" . $searchTerm . "%' AND rank_id != '1' AND rank_id NOT IN "; $arrQuery['rank']['orderby'] = " ORDER BY ordernum DESC"; $arrQuery['rank']['id'] = "rank_id"; $arrQuery['rank']['append'] = " - Rank"; $arrQuery['squad']['query'] = "SELECT " . $dbprefix . "squads.* FROM " . $dbprefix . "squads, " . $dbprefix . "squads_members WHERE " . $dbprefix . "squads.squad_id = " . $dbprefix . "squads_members.squad_id AND " . $dbprefix . "squads_members.member_id = '" . $memberInfo['member_id'] . "' AND " . $dbprefix . "squads.name LIKE '" . $searchTerm . "%' AND " . $dbprefix . "squads.squad_id NOT IN ";
public static function getRank($model) { $total = $model->point->total; $lowerLimit = 0; $rank = null; foreach (Rank::model()->findAll() as $rank) { if ($total >= $lowerLimit and $total < $rank->max_point) { break; } else { $lowerLimit = $rank->max_point; continue; } } return strtolower($rank->name); }
// Classes needed for index.php $ipbanObj = new Basic($mysqli, "ipban", "ipaddress"); if ($ipbanObj->select($IP_ADDRESS, false)) { $ipbanInfo = $ipbanObj->get_info(); if (time() < $ipbanInfo['exptime'] or $ipbanInfo['exptime'] == 0) { die("<script type='text/javascript'>window.location = '" . $MAIN_ROOT . "banned.php';</script>"); } else { $ipbanObj->delete(); } } // Start Page $PAGE_NAME = "Inactive Members - "; $dispBreadCrumb = ""; include $prevFolder . "themes/" . $THEME . "/_header.php"; $member = new Member($mysqli); $rankObj = new Rank($mysqli); $gameObj = new Game($mysqli); ?> <div class='breadCrumbTitle'>Inactive Members</div> <div class='breadCrumb' style='padding-top: 0px; margin-top: 0px'> <a href='<?php echo $MAIN_ROOT; ?> '>Home</a> > Inactive Members </div> <table class='formTable'> <tr> <td class='formTitle'>Rank:</td> <td class='formTitle'>Username:</td> <td class='formTitle'>Main Game:</td>
$checkMember = $member->select($_SESSION['btUsername']); $LOGIN_FAIL = true; if ($checkMember) { if ($member->authorizeLogin($_SESSION['btPassword'])) { $LOGIN_FAIL = false; $memberInfo = $member->get_info(); $_SESSION['lastConsoleCategory'] = array("catID" => $consoleInfo['consolecategory_id'], "exptime" => time() + 300); // Check for IA if ($memberInfo['onia'] == 1 && $cID != $consoleObj->findConsoleIDByName("Cancel IA")) { $cancelIACID = $consoleObj->findConsoleIDByName("Cancel IA"); echo "\n\t\t\t\n\t\t\t\t<div id='iaMessage' style='display: none'>\n\t\t\t\t\t<p class='main' align='center'>You are currently Inactive!<br><br>While inactive, you do not have access to console options.<br><br><a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cancelIACID . "'><b>Click Here</b></a> to become active again!</p>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tpopupDialog('Inactive Member', '" . $MAIN_ROOT . "members', 'iaMessage');\n\t\t\t\t</script>\n\t\t\t"; exit; } $memberRankID = $memberInfo['rank_id']; define("MEMBERRANK_ID", $memberRankID); $memberRank = new Rank($mysqli); $memberRank->select($memberRankID); $rankPrivileges = $memberRank->get_privileges(); if ($member->hasAccess($consoleObj) || $consoleInfo['pagetitle'] == "Manage Forum Posts" && !isset($_GET['noaccess'])) { //$getClanInfo = $mysqli->query("SELECT * FROM ".$dbprefix."websiteinfo WHERE websiteinfo_id = '1'"); $arrClanInfo = $websiteInfo; //$getClanInfo->fetch_assoc(); // Console Security define("PREVENT_HACK", $arrClanInfo['preventhack']); include $prevFolder . "include/breadcrumb.php"; if (isset($_GET['action']) && $_GET['action'] == "edit") { echo "\n\t\t\t\t<p align='right' style='margin-bottom: 10px; margin-right: 20px;'>« <a href='" . $MAIN_ROOT . "members/console.php?cID=" . $cID . "'>Go Back</a></p>\n\t\t\t\t"; } elseif (!isset($_GET['action'])) { echo "\n\t\t\t\t<p align='right' style='margin-bottom: 20px; margin-right: 20px;'>« <a href='" . $MAIN_ROOT . "members/index.php?select=" . $consoleInfo['consolecategory_id'] . "' id='consoleTopBackButton'>Go Back</a></p>\n\t\t\t\t"; } if (substr($consoleInfo['filename'], 0, strlen("../")) != "../") {
<table class='table table-striped table-hover'> <?php $i = 1; ?> <?php foreach ($monthly as $player) { ?> <tr data-id='<?php echo $player->member_id; ?> '><td class='text-center text-muted'><small><?php echo $i; $i++; ?> </small></td><td><?php echo Rank::convert($player->rank_id)->abbr; ?> <?php echo $player->forum_name; ?> </td><td><strong><?php echo $player->aod_games; ?> </strong></td></tr> <?php } ?> </table> </div> </div>
exit('ERREUR: Permissions insuffisantes.'); } $userManager = new User(); $NbUsers = $userManager->rowCount(); if (isset($_['id']) && $NbUsers > 1) { $userManager->delete(array('id' => $_['id'])); Functions::goback("setting", "user"); } else { Functions::goback("setting", "user", "&error=Impossible de supprimer le dernier utilisateur."); } break; case 'access_delete_rank': if (!$myUser->can('configuration', 'd')) { exit('ERREUR: Permissions insuffisantes.'); } $rankManager = new Rank(); $Nbrank = $rankManager->rowCount(); if (isset($_['id']) && $Nbrank > 1) { $rankManager->delete(array('id' => $_['id'])); Functions::goback("setting", "access"); header('location:setting.php?section=access'); } else { Functions::goback("setting", "access", "&error=Impossible de supprimer le dernier rang."); } break; case 'access_add_rank': $right_toverify = isset($_['id']) ? 'u' : 'c'; if (!$myUser->can('configuration', $right_toverify)) { exit('ERREUR: Permissions insuffisantes.'); } $rank = new Rank();
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Rank the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Rank::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }
} } else { if (trim($_POST['rankimageurl']) == "") { $countErrors++; $dispError .= " <b>·</b> You must include a rank image.<br>"; } else { $rankImgURL = $_POST['rankimageurl']; } } } if ($countErrors > 0) { $_POST = filterArray($_POST); $_POST['submit'] = false; } else { // EVERYTHING IS OK $newRank = new Rank($mysqli); $arrColumns = array("rankcategory_id", "name", "description", "imageurl", "ordernum", "autodays", "hiderank", "promotepower", "autodisable", "color", "imagewidth", "imageheight"); $arrValues = array($_POST['rankcat'], $_POST['rankname'], $_POST['rankdesc'], $rankImgURL, $intNewRankOrderNum, isset($_POST['autodays']) ? $_POST['autodays'] : 0, isset($_POST['hiderank']) ? $_POST['hiderank'] : 0, isset($_POST['promoterank']) ? $_POST['promoterank'] : 0, isset($_POST['autodisable']) ? $_POST['autodisable'] : 0, $_POST['rankcolor'], $_POST['rankimagewidth'], $_POST['rankimageheight']); if ($newRank->addNew($arrColumns, $arrValues)) { // Added Rank! Now give the rank its privileges $newRankInfo = $newRank->get_info_filtered(); // If maximum rank is set to "(this rank)", set the promotepower to the new rank's rank_id if ($_POST['promoterank'] == -1) { $newRank->update(array("promotepower"), array($newRankInfo['rank_id'])); } $arrColumns = array("rank_id", "console_id"); $privObj = new Basic($mysqli, "rank_privileges", "privilege_id"); $result = $mysqli->query("SELECT * FROM " . $dbprefix . "console ORDER BY sortnum"); $rankOptions = ""; while ($row = $result->fetch_assoc()) { $strPostVarName = "consoleid_" . $row['console_id'];