public function realmFirsts() { $locale = isset($_SESSION['armoryLocale']) ? $_SESSION['armoryLocale'] : $this->armoryconfig['defaultLocale']; $achievements_data = $this->cDB->select("\n SELECT\n `character_achievement`.`achievement`,\n `character_achievement`.`date`,\n `character_achievement`.`guid`,\n `characters`.`name` AS `charname`,\n `characters`.`race`,\n `characters`.`class`,\n `characters`.`gender`\n FROM `character_achievement` AS `character_achievement`\n LEFT JOIN `characters` AS `characters` ON `characters`.`guid`=`character_achievement`.`guid`\n WHERE `character_achievement`.`achievement` IN \n (\n 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, \n 467, 1400, 1402, 1404, 1405, 1406, 1407, 1408, 1409, \n 1410, 1411, 1412, 1413, 1414, 1415, 1416, 1417, 1418, \n 1419, 1420, 1421, 1422, 1423, 1424, 1425, 1426, 1427, \n 1463, 3117, 3259, 4078, 4576\n )"); // 3.3.0a IDs if (!$achievements_data) { return false; } $countAch = count($achievements_data); for ($i = 0; $i < $countAch; $i++) { $achievements_data[$i]['name'] = $this->aDB->selectCell("SELECT `name_" . $locale . "` FROM `armory_achievement` WHERE `id`=? LIMIT 1", $achievements_data[$i]['achievement']); $achievements_data[$i]['description'] = $this->aDB->selectCell("SELECT `description_" . $locale . "` FROM `armory_achievement` WHERE `id`=?", $achievements_data[$i]['achievement']); $achievements_data[$i]['icon'] = $this->aDB->selectCell("SELECT `iconname` FROM `armory_achievement` WHERE `id`=?", $achievements_data[$i]['achievement']); $achievements_data[$i]['timestamp'] = date('Y-m-d\\TH:i:s:+00:00', $achievements_data[$i]['date']); $achievements_data[$i]['guildid'] = Characters::GetDataField(PLAYER_GUILDID, $achievements_data[$i]['guid']); if ($achievements_data[$i]['guildid'] > 0) { $achievements_data[$i]['guildname'] = $this->cDB->selectCell("SELECT `name` FROM `guild` WHERE `guildid`=? LIMIT 1", $achievements_data[$i]['guildid']); } unset($achievements_data[$i]['guildid']); } return $achievements_data; }
public function exportPlayersList() { $count = count($this->players); for ($i = 0; $i < $count; $i++) { if ($this->players[$i]['guid'] == $this->captainguid) { $this->players[$i]['captain'] = true; } $this->players[$i]['guildid'] = Characters::GetDataField(PLAYER_GUILDID, $this->players[$i]['guid']); if ($this->players[$i]['guildid'] > 0) { $this->players[$i]['guildname'] = $this->cDB->selectCell("SELECT `name` FROM `guild` WHERE `guildid`=?", $this->players[$i]['guildid']); } unset($this->players[$i]['guildid']); if ($this->players[$i]['played_season'] > 0) { $this->players[$i]['percent_season'] = floor(Utils::GetPercent($this->players[$i]['played_season'], $this->players[$i]['wons_season'])); } else { $this->players[$i]['percent_season'] = 0; } } return $this->players; }
/** * Set $this->guildId of selected player ($this->guid) * @category Guilds class * @example Guilds::extractPlayerGuildId() * @return bool **/ public function extractPlayerGuildId($guid = false) { if ($guid) { $this->guid = $guid; } if (!$this->guid) { return false; } $this->guildId = Characters::GetDataField(PLAYER_GUILDID, $this->guid); if ($this->guildId) { return true; } }