<a class="race-parent" href="./"><?php 
echo WoW_Locale::GetString('template_game_races_title');
?>
</a>
	      <span class="clear"><!-- --></span>
				<h4><?php 
echo WoW_Locale::GetString('character_race_' . $race['id']);
?>
</h4>
			</div>	<span class="clear"><!-- --></span>
			<div class="faction-req">
        <span class="group <?php 
echo WoW_Utils::GetFactionId($race['id']) == FACTION_ALLIANCE ? 'alliance' : 'horde';
?>
"><?php 
echo WoW_Locale::GetString('faction_' . (WoW_Utils::GetFactionId($race['id']) == FACTION_ALLIANCE ? 'alliance' : 'horde'));
?>
</span>
        <?php 
if ($race['expansion'] > EXPANSION_CLASSIC) {
    echo '<span class="req ' . ($race['expansion'] == EXPANSION_BC ? 'bc' : ($race['expansion'] == EXPANSION_WRATH ? 'wrath' : 'cataclysm')) . '">' . WoW_Locale::GetString('template_zone_expansion_required') . ' ' . WoW_Locale::GetString('template_expansion_' . $race['expansion']) . '</span>';
}
?>
      </div>
	    <span class="clear"><!-- --></span>
			<div class="left-col">
				<div class="story-highlight"><?php 
echo $race['story'];
?>
</div>
				<div class="story-main"><?php 
<div id="left-results">
    <?php 
$searchResults = WoW_Search::GetSearchResults('wowguild');
if (is_array($searchResults)) {
    foreach ($searchResults as $guild) {
        echo sprintf('
    <div class="search-result">
        <div class="">
            <div class="result-title">
                <a href="%s/wow/%s/guild/%s/%s/" class="search-title">&lt;%s&gt;</a>
            </div>
            <div class="search-content">
                <div class="info">%s / %s</div>
            </div>
            <div class="search-results-url"> /wow/guild/%s/%s/</div>
        </div>
        <div class="clear"></div>
    </div>', WoW::GetWoWPath(), WoW_Locale::GetLocale(), $guild['realmName'], $guild['name'], $guild['name'], $guild['realmName'], WoW_Locale::GetString(WoW_Utils::GetFactionId($guild['raceId']) == FACTION_ALLIANCE ? 'faction_alliance' : 'faction_horde'), $guild['realmName'], $guild['name']);
    }
}
?>
</div>
Esempio n. 3
0
 /**
  * Loads all characters from world DBs
  * 
  * @access   public
  * @static   WoW_Account::LoadCharactersFromWorld()
  * @category Account Manager Class
  * @return   void
  **/
 private static function LoadCharactersFromWorld()
 {
     $db = null;
     $chars_data = array();
     self::$characters_data = array();
     $index = 0;
     $account_ids = array();
     $count = count(self::$myGamesList);
     if ($count == 0) {
         return false;
     }
     for ($i = 0; $i < $count; ++$i) {
         $account_ids[] = self::$myGamesList[$i]['account_id'];
     }
     foreach (WoWConfig::$Realms as $realm_info) {
         $db = DB::ConnectToDB(DB_CHARACTERS, $realm_info['id']);
         $chars_data = DB::Characters()->select("\n                SELECT\n                `characters`.`guid`,\n                `characters`.`account`,\n                `characters`.`name`,\n                `characters`.`class`,\n                `characters`.`race`,\n                `characters`.`gender`,\n                `characters`.`level`,\n                `guild_member`.`guildid` AS `guildId`,\n                `guild`.`name` AS `guildName`\n                FROM `characters` AS `characters`\n                LEFT JOIN `guild_member` AS `guild_member` ON `guild_member`.`guid`=`characters`.`guid`\n                LEFT JOIN `guild` AS `guild` ON `guild`.`guildid`=`guild_member`.`guildid`\n                WHERE `account` IN (%s)", $account_ids);
         if (!$chars_data) {
             continue;
         }
         foreach ($chars_data as $char) {
             $status = WoW::GetRealmStatus($realm_info['id']);
             $tmp_char_data = array('account' => $char['account'], 'index' => $index, 'guid' => $char['guid'], 'name' => $char['name'], 'class' => $char['class'], 'class_text' => WoW_Locale::GetString('character_class_' . $char['class'], $char['gender']), 'class_key' => Data_Classes::$classes[$char['class']]['key'], 'race' => $char['race'], 'race_text' => WoW_Locale::GetString('character_race_' . $char['race'], $char['gender']), 'race_key' => Data_Races::$races[$char['race']]['key'], 'gender' => $char['gender'], 'level' => $char['level'], 'realmName' => $realm_info['name'], 'realmId' => $realm_info['id'], 'isActive' => 0, 'faction' => WoW_Utils::GetFactionId($char['race']), 'faction_text' => WoW_Utils::GetFactionId($char['race']) == FACTION_ALLIANCE ? 'alliance' : 'horde', 'guildId' => $char['guildId'], 'guildName' => $char['guildName'], 'guildUrl' => sprintf('%s/wow/%s/guild/%s/%s/', WoW::GetWoWPath(), WoW_Locale::GetLocale(), urlencode($realm_info['name']), urlencode($char['guildName'])), 'url' => sprintf('%s/wow/%s/character/%s/%s/', WoW::GetWoWPath(), WoW_Locale::GetLocale(), urlencode($realm_info['name']), urlencode($char['name'])), 'realmStatus' => isset($status[0], $status[0]['status']) ? $status[0]['status'] : 'down');
             self::$characters_data[] = $tmp_char_data;
             ++$index;
         }
     }
 }
                <?php 
$race_masks = array('RACE_MASK_DRAENEI', 'RACE_MASK_DWARF', 'RACE_MASK_GNOME', 'RACE_MASK_HUMAN', 'RACE_MASK_NIGHTELF', 'RACE_MASK_WORGEN', 'RACE_MASK_BLOODELF', 'RACE_MASK_GOBLIN', 'RACE_MASK_ORC', 'RACE_MASK_TAUREN', 'RACE_MASK_TROLL', 'RACE_MASK_UNDEAD');
foreach ($race_masks as $mask) {
    if ($class['races_flag'] & constant($mask)) {
        $race_key = strtolower(substr($mask, 10));
        $race_id = WoW_Utils::GetRaceIDByKey($race_key);
        if ($race_id == 0) {
            continue;
        }
        echo '<li>
								<a href="../race/' . $race_key . '">
									<span class="icon-frame frame-36" style="background-image: url(http://eu.media.blizzard.com/wow/icons/36/race_' . $race_key . '_female.jpg);">
										<span class="frame"></span>
									</span>
									<span class="list-title">' . WoW_Locale::GetString('character_race_' . $race_id) . '
                                    <span class="list-faction ' . (WoW_Utils::GetFactionId($race_id) == FACTION_ALLIANCE ? 'alliance' : 'horde') . '">' . WoW_Locale::GetString('faction_' . (WoW_Utils::GetFactionId($race_id) == FACTION_ALLIANCE ? 'alliance' : 'horde')) . '</span></span>
								</a>
							</li>';
    }
}
?>
              </ul>
              <span class="clear"><!-- --></span>
              <span class="clear"><!-- --></span>
            </div>
          </div>
        </div>
        <table class="media-frame">
          <tr>
            <td class="tl"></td>
            <td class="tm"></td>
 private static function LoadGuildMembers()
 {
     if (!self::IsCorrect()) {
         WoW_Log::WriteError('%s : guild was not found.', __METHOD__);
         return false;
     }
     $members = DB::Characters()->select("\n            SELECT\n            `guild_member`.`guid`,\n            `guild_member`.`rank` AS `rankID`,\n            `guild_rank`.`rname` AS `rankName`,\n            `characters`.`name`,\n            `characters`.`race` AS `raceID`,\n            `characters`.`class` AS `classID`,\n            `characters`.`gender` AS `genderID`,\n            `characters`.`level`\n            FROM `guild_member` AS `guild_member`\n            JOIN `guild_rank` AS `guild_rank` ON `guild_rank`.`rid`=`guild_member`.`rank` AND `guild_rank`.`guildid`=%d\n            JOIN `characters` AS `characters` ON `characters`.`guid`=`guild_member`.`guid`\n            WHERE `guild_member`.`guildid`=%d\n        ", self::GetGuildID(), self::GetGuildID());
     if (!$members) {
         WoW_Log::WriteError('%s : unable to find any member of guild %s (GUILDID: %d). Guild is empty?', __METHOD__, self::GetGuildName(), self::GetGuildID());
         return false;
     }
     $roster = array();
     foreach ($members as $member) {
         $member['race_text'] = WoW_Locale::GetString('character_race_' . $member['raceID']);
         $member['class_text'] = WoW_Locale::GetString('character_class_' . $member['classID']);
         $member['url'] = sprintf('%s/wow/%s/character/%s/%s/', WoW::GetWoWPath(), WoW_Locale::GetLocale(), self::GetGuildRealmName(), $member['name']);
         $achievement_ids = DB::Characters()->select("SELECT `achievement` FROM `character_achievement` WHERE `guid` = %d", $member['guid']);
         if (is_array($achievement_ids)) {
             $ids = array();
             foreach ($achievement_ids as $ach) {
                 $ids[] = $ach['achievement'];
             }
             if (is_array($ids)) {
                 $member['achievement_points'] = DB::WoW()->selectCell("SELECT SUM(`points`) FROM `DBPREFIX_achievement` WHERE `id` IN (%s)", $ids);
             } else {
                 $member['achievement_points'] = 0;
             }
         } else {
             $member['achievement_points'] = 0;
         }
         $roster[] = $member;
     }
     self::$guild_roster = $roster;
     unset($roster);
     // Set faction
     self::$guild_factionID = WoW_Utils::GetFactionId(self::GetMemberInfo(0, 'raceID'));
     return true;
 }
Esempio n. 6
0
 private function LoadTrinity(&$team)
 {
     $team = DB::Characters()->selectRow("\n        SELECT\n        `a`.*,\n        `b`.`race`\n        FROM `arena_team` AS `a`\n        LEFT JOIN `characters` AS `b` ON `b`.`guid` = `a`.`captainguid`\n        WHERE `a`.`arenaTeamId` = %d", $this->m_teamId);
     if (!$team) {
         WoW_Log::WriteError('%s : team "%s" (%d) was not found in DB!', __METHOD__, $this->m_teamName, $this->m_teamId);
         return false;
     }
     // Fill class field
     $this->m_teamName = $team['name'];
     $this->m_teamId = $team['arenaTeamId'];
     $this->m_teamCaptain = $team['captainGuid'];
     $this->m_teamEmblem = array('bgColor' => $team['backgroundColor'], 'eStyle' => $team['emblemStyle'], 'eColor' => $team['emblemColor'], 'bStyle' => $team['borderStyle'], 'bColor' => $team['borderColor']);
     $this->m_teamFaction = WoW_Utils::GetFactionId($team['race']);
     $this->m_teamStats = array('rating' => $team['rating'], 'games_week' => $team['weekGames'], 'games_season' => $team['seasonGames'], 'wins_week' => $team['weekWins'], 'wins_season' => $team['seasonWins'], 'loses_week' => $team['weekGames'] - $team['weekWins'], 'loses_season' => $team['seasonGames'] - $team['seasonWins'], 'rank' => $team['rank']);
     $this->m_teamType = $team['type'];
     // Load member list
     $members = DB::Characters()->select("\n        SELECT\n        `a`.`weekGames`,\n        `a`.`weekWins`,\n        `a`.`seasonGames`,\n        `a`.`seasonWins`,\n        (`a`.`weekGames` - `a`.`weekWins`) AS `loses_week`,\n        (`a`.`seasonGames` - `a`.`seasonWins`) AS `loses_season`,\n        `a`.`personalRating`,\n        `b`.`guid`,\n        `b`.`name`,\n        `b`.`class`,\n        `b`.`race`,\n        `b`.`gender`,\n        `b`.`level`\n        FROM `arena_team_member` AS `a`\n        LEFT JOIN `characters` AS `b` ON `b`.`guid` = `a`.`guid`\n        WHERE `a`.`arenateamid` = %d", $this->m_teamId);
     if (!$members) {
         WoW_Log::WriteError('%s : team "%s" (%d) has empty member list', __METHOD__, $this->m_teamName, $this->m_teamId);
         return false;
     }
     foreach ($members as $member) {
         $this->m_teamMembers[] = array('guid' => $member['guid'], 'name' => $member['name'], 'classId' => $member['class'], 'class_text' => WoW_Locale::GetString('character_class_' . $member['class'], $member['gender']), 'raceId' => $member['race'], 'race_text' => WoW_Locale::GetString('character_race_' . $member['race'], $member['gender']), 'factionId' => WoW_Utils::GetFactionId($member['race']), 'faction_text' => WoW_Utils::GetFactionId($member['race']) == FACTION_ALLIANCE ? 'alliance' : 'horde', 'genderId' => $member['gender'], 'level' => $member['level'], 'url' => sprintf('%s/wow/%s/character/%s/%s/', WoW::GetWoWPath(), WoW_Locale::GetLocale(), $this->GetTeamRealmName(), $member['name']), 'gamesWeek' => $member['weekGames'], 'winsWeek' => $member['weekWins'], 'losesWeek' => $member['loses_week'], 'gamesSeason' => $member['seasonGames'], 'winsSeason' => $member['seasonWins'], 'losesSeason' => $member['loses_season'], 'personalRating' => $member['personalRating'], 'teamId' => $this->m_teamId, 'matchMakerRating' => DB::Characters()->selectCell("SELECT `matchMakerRating` FROM `character_arena_stats` WHERE `guid` = %d AND `slot` = %d", $member['guid'], $this->m_teamType));
     }
     unset($members, $member, $team);
     // Loaded successfully
     return true;
 }
 private static function HandlePvPData()
 {
     $active = true;
     $pvp = array();
     foreach (self::$pvp_data as $team) {
         if (!isset($pvp[$team['type']])) {
             $pvp[$team['type']] = array('data' => array(), 'members' => array());
             $pvp[$team['type']]['data'] = array('id' => $team['arenateamid'], 'name' => $team['name'], 'url' => sprintf('%s/wow/arena/%s/%dv%d/%s/', WoW::GetWoWPath(), self::GetRealmName(), $team['type'], $team['type'], $team['name']), 'captain' => $team['captainguid'], 'type' => $team['type'], 'type_text' => sprintf('%dv%d', $team['type'], $team['type']), 'active' => $active, 'faction' => WoW_Utils::GetFactionId($team['race']), 'BGColor' => dechex($team['BackgroundColor'] - 255), 'EStyle' => $team['EmblemStyle'], 'EColor' => dechex($team['EmblemColor'] - 255), 'BStyle' => $team['BorderStyle'], 'BColor' => dechex($team['BorderColor'] - 255), 'rating' => $team['rating'], 'games_week' => $team['games_week'], 'wins_week' => $team['wins_week'], 'lost_week' => $team['lost_week'], 'games_season' => $team['games_season'], 'wins_season' => $team['wins_season'], 'lost_season' => $team['lost_season'], 'personal_rating' => 0, 'rank' => $team['rank']);
             $active = false;
         }
         $pvp[$team['type']]['members'][] = array('guid' => $team['guid'], 'name' => $team['charName'], 'race' => $team['race'], 'class' => $team['class'], 'gender' => $team['gender'], 'level' => $team['level'], 'url' => sprintf('%s/wow/%s/character/%s/%s/', WoW::GetWoWPath(), WoW_Locale::GetLocale(), self::GetRealmName(), $team['charName']), 'played_week' => $team['played_week'], 'wons_week' => $team['wons_week'], 'played_season' => $team['played_season'], 'lost_week' => $team['lost_week_personal'], 'played_season' => $team['played_season'], 'wons_season' => $team['wons_season'], 'lost_season' => $team['lost_season_personal'], 'personal_rating' => $team['personal_rating']);
         if ($team['guid'] == self::GetGUID()) {
             $pvp[$team['type']]['data']['personal_rating'] = $team['personal_rating'];
         }
     }
     self::$pvp_data = $pvp;
     self::$next_pvp = 2;
     unset($pvp, $team);
     return true;
 }