public function _initTeam() { if (!$this->teamname) { return false; } $arenaInfo = $this->cDB->selectRow("SELECT * FROM `arena_team` WHERE `name`=? LIMIT 1", $this->teamname); $this->arenateamid = $arenaInfo['arenateamid']; $this->captainguid = $arenaInfo['captainguid']; $pattern = 'totalIcons=1&totalIcons=1&startPointX=4&initScale=100&overScale=100&largeIcon=1&iconColor1=%s&iconName1=images/icons/team/pvp-banner-emblem-%d.png&bgColor1=%s&borderColor1=%s&teamUrl1='; $this->teamlogostyle = sprintf($pattern, $arenaInfo['EmblemColor'], $arenaInfo['EmblemStyle'], $arenaInfo['BackgroundColor'], $arenaInfo['BorderColor']); $this->teamfaction = Characters::GetCharacterFaction($this->cDB->selectCell("SELECT `race` FROM `characters` WHERE `guid`=? LIMIT 1", $this->captainguid)); $this->teamtype = $arenaInfo['type']; $this->getTeamStats(); $this->getTeamList(); return true; }
public function SearchCharacters($query, $num = false) { if ($num == true) { $xQuery = $this->cDB->selectPage($charsNum, "\n SELECT `guid`\n FROM `characters`\n WHERE `name` LIKE ? AND `level`>=?", '%' . $query . '%', $this->armoryconfig['minlevel']); return $charsNum; } $xQuery = $this->cDB->select("\n SELECT `guid`, `name`, `race`, `class`, `gender`, `level`\n FROM `characters`\n WHERE `name` LIKE ? AND `level`>=?", '%' . $query . '%', $this->armoryconfig['minlevel']); if ($xQuery) { $countChars = count($xQuery); for ($i = 0; $i < $countChars; $i++) { $xQuery[$i]['faction'] = Characters::GetCharacterFaction($xQuery[$i]['race']); $xQuery[$i]['guild'] = $this->cDB->selectCell("SELECT `name` FROM `guild` WHERE `guildid`=?", Characters::GetDataField(PLAYER_GUILDID, $xQuery[$i]['guid'])); } return $xQuery; } return false; }