<a href="<?php echo WoW::GetWoWPath(); ?> /wow/game/" rel="np"> <?php WoW_Locale::GetString('template_menu_game'); ?> </a> </li> <li> <a href="<?php echo WoW_Characters::GetURL(); ?> " rel="np"> <?php echo sprintf('%s @ %s', WoW_Characters::GetName(), WoW_Characters::GetRealmName()); ?> </a> </li> <li class="last"> <a href="<?php echo WoW_Characters::GetURL(); ?> feed" rel="np"> <?php echo WoW_Locale::GetString('template_character_feed'); ?> </a> </li> </ol>--> </div>
/** * Checks if active character (WoW_Characters class) is on current account * * @access public * @static WoW_Account::IsAccountCharacter() * @category Account Manager Class * @uses WoW_Characters * @return bool **/ public static function IsAccountCharacter() { if (!self::IsLoggedIn()) { return false; } if (!self::IsCharactersLoaded()) { self::LoadCharacters(); } $name = WoW_Characters::GetName(); $realm = WoW_Characters::GetRealmName(); foreach (self::$characters_data as $char) { if ($char['name'] == $name && $char['realmName'] == $realm) { return true; } } return false; }
public static function GetPageTitle() { switch (WoW_Template::GetPageIndex()) { case 'character_profile_simple': case 'character_profile_advanced': return sprintf('%s @ %s - %s - ', WoW_Characters::GetName(), WoW_Characters::GetRealmName(), WoW_Locale::GetString('template_menu_game')); case 'character_talents': return sprintf('%s - %s - ', WoW_Locale::GetString('template_profile_talents'), WoW_Locale::GetString('template_menu_game')); case 'character_achievements': return sprintf('%s - %s - ', WoW_Locale::GetString('template_profile_achievements'), WoW_Locale::GetString('template_menu_game')); case 'character_reputation': return sprintf('%s - %s - ', WoW_Locale::GetString('template_profile_reputation'), WoW_Locale::GetString('template_menu_game')); case 'character_statistics': return sprintf('%s - %s - ', WoW_Locale::GetString('template_profile_statistics'), WoW_Locale::GetString('template_menu_game')); case 'character_pvp': return sprintf('PvP - %s - ', WoW_Locale::GetString('template_menu_game')); case 'character_feed': return sprintf('%s - %s - ', WoW_Locale::GetString('template_character_feed'), WoW_Locale::GetString('template_menu_game')); case 'item': return sprintf('%s - ', WoW_Template::GetPageData('itemName')); case 'item_list': return sprintf('%s - ', WoW_Template::GetPageData('last-crumb')); case 'guild_page': return sprintf('%s @ %s - ', WoW_Guild::GetGuildName(), WoW_Guild::GetGuildRealmName()); case 'guild_perks': return sprintf('%s - %s - ', WoW_Locale::GetString('template_guild_menu_perks'), WoW_Locale::GetString('template_menu_game')); case 'guild_roster': case 'guild_professions': return sprintf('%s - %s - ', WoW_Locale::GetString('template_guild_menu_roster'), WoW_Locale::GetString('template_menu_game')); case 'search': return WoW_Search::GetSearchQuery() != null ? sprintf('%s - %s - ', WoW_Search::GetSearchQuery(), WoW_Locale::GetString('template_search')) : sprintf('%s - ', WoW_Locale::GetString('template_search')); case 'realm_status': return sprintf('%s - %s - ', WoW_Locale::GetString('template_realm_status'), WoW_Locale::GetString('template_menu_game')); case 'blog': return sprintf('%s - ', WoW_Template::GetPageData('blog_title')); case 'game': return sprintf('%s - ', WoW_Locale::GetString('template_menu_game')); case 'game_guide_what_is_wow': return sprintf('%s - %s - ', WoW_Locale::GetString('template_menu_game_guide_what_is_wow'), WoW_Locale::GetString('template_menu_game')); case 'game_guide_getting_started': return sprintf('%s - %s - ', WoW_Locale::GetString('template_menu_game_guide_getting_started'), WoW_Locale::GetString('template_menu_game')); case 'game_guide_how_to_play': return sprintf('%s - %s - ', WoW_Locale::GetString('template_menu_game_guide_how_to_play'), WoW_Locale::GetString('template_menu_game')); case 'game_guide_playing_together': return sprintf('%s - %s - ', WoW_Locale::GetString('template_menu_game_guide_playing_together'), WoW_Locale::GetString('template_menu_game')); case 'game_guide_late_game': return sprintf('%s - %s - ', WoW_Locale::GetString('template_menu_game_guide_late_game'), WoW_Locale::GetString('template_menu_game')); case 'game_race_index': return sprintf('%s - %s - ', WoW_Locale::GetString('template_game_race_index'), WoW_Locale::GetString('template_menu_game')); case 'game_race': return sprintf('%s - %s - ', WoW_Locale::GetString('character_race_' . WoW_Template::GetPageData('raceId')), WoW_Locale::GetString('template_menu_game')); case 'game_class_index': return sprintf('%s - %s - ', WoW_Locale::GetString('template_game_class_index'), WoW_Locale::GetString('template_menu_game')); case 'game_class': return sprintf('%s - %s - ', WoW_Locale::GetString('character_class_' . WoW_Template::GetPageData('classId')), WoW_Locale::GetString('template_menu_game')); case 'password_reset': return sprintf('%s - Battle.Net', WoW_Locale::GetString('login_help_title')); case 'password_reset_select': case 'password_reset_secred_answer': case 'password_reset_success': case 'password_reset_confirm': case 'password_reset_changed': return sprintf('%s - Battle.Net', WoW_Locale::GetString('template_account_password_reset_title')); case 'dashboard': return sprintf('%s - Battle.Net', WoW_Locale::GetString('expansion_' . WoW_Account::GetExpansion())); case 'landing': switch (WoW_Template::GetPageData('landing')) { case 'what_is': return sprintf('%s - Battle.Net', WoW_Locale::GetString('template_bn_what_is_it_title')); } break; case 'creation_tos': case 'creation_success': case 'account_conversion': case 'management': return WoW_Locale::GetString('template_management_main_title'); //[PH] //[PH] case 'auction_lots': return sprintf('%s - %s - ', WoW_Locale::GetString('template_auction_menu_lots'), WoW_Locale::GetString('template_menu_game')); case 'forum_index': return sprintf('%s - ', WoW_Locale::GetString('template_menu_forums')); case 'forum_category': return sprintf('%s - %s - ', WoW_Template::GetPageData('forum_category_title'), WoW_Locale::GetString('template_menu_forums')); case 'forum_thread': return sprintf('%s - %s - ', WoW_Template::GetPageData('forum_thread_title'), WoW_Locale::GetString('template_menu_forums')); case 'forum_blizztracker': return sprintf('%s - %s - ', WoW_Locale::GetString('template_blizztracker_title'), WoW_Locale::GetString('template_menu_forums')); case 'zones': return sprintf('%s - %s - ', WoW_Locale::GetString('template_game_dungeons_and_raids'), WoW_Locale::GetString('template_menu_game')); case 'zone': return sprintf('%s - %s - ', WoW_Template::GetPageData('zone_name'), WoW_Locale::GetString('template_menu_game')); case 'pvp_arena': return sprintf('PvP - %s - ', WoW_Locale::GetString('template_menu_game')); case 'character_companions_mounts': return sprintf('%s - %s - ', WoW_Locale::GetString('template_profile_' . WoW_Template::GetPageData('category') . 's'), WoW_Locale::GetString('template_menu_game')); case 'shop': return sprintf('%s - ', WoW_Locale::GetString('template_shop_title')); default: return ''; } }
if (WoW_Characters::GetGuildID() > 0) { $guild_str = sprintf('<div class="guild"> <a href="%s?character=%s">%s</a> </div>', WoW_Characters::GetGuildURL(), urlencode(WoW_Characters::GetName()), WoW_Characters::GetGuildName()); } else { $guild_str = null; } echo sprintf('<div class="name"><a href="%s" rel="np">%s</a></div> <div class="under-name color-c%d"> <a href="/wow/game/race/%s" class="race">%s</a>-<a href="/wow/game/class/%s" class="class">%s</a> <span class="level"><strong>%d</strong></span> %s </div> %s <div class="realm"> <span id="profile-info-realm" class="tip" data-battlegroup="%s">%s</span> </div>', WoW_Characters::GetURL(), WoW_Characters::GetName(), WoW_Characters::GetClassID(), WoW_Characters::GetRaceKey(), WoW_Characters::GetRaceName(), WoW_Characters::GetClassKey(), WoW_Characters::GetClassName(), WoW_Characters::GetLevel(), WoW_Locale::GetString('template_lvl'), $guild_str, WoWConfig::$DefaultBGName, WoW_Characters::GetRealmName()); ?> </div> </div> <?php WoW_Template::LoadTemplate('block_profile_menu'); ?> </div> </div> </div> </div> <div class="profile-contents"> <div class="profile-section-header">
public function main() { WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE)); WoW_Template::SetTemplateTheme('wow'); $url_data = WoW::GetUrlData('character'); if (!$url_data) { WoW_Template::SetPageIndex('404'); WoW_Template::SetPageData('page', '404'); WoW_Template::SetPageData('errorProfile', 'template_404'); } else { if ($url_data['action0'] == 'advanced') { // Set "wow.character.summary.view" cookie as "advanced" setcookie('wow.character.summary.view', 'advanced', strtotime('NEXT YEAR'), '/' . WoW::GetWoWPath() . '/character/'); } elseif ($url_data['action0'] == null && (isset($url_data['name']) && isset($url_data['realmName']))) { WoW::RedirectToCorrectProfilePage('simple'); //change to WoW::RedirectTo()? } elseif ($url_data['action0'] == 'simple') { // Set "wow.character.summary.view" cookie as "simple" setcookie('wow.character.summary.view', 'simple', strtotime('NEXT YEAR'), '/' . WoW::GetWoWPath() . '/character/'); } $load_result = WoW_Characters::LoadCharacter($url_data['name'], WoW_Utils::GetRealmIDByName($url_data['realmName']), true, true); if (!WoW_Characters::IsCorrect() || $load_result != 3) { if ($url_data['action0'] == 'tooltip') { exit; } if ($load_result == 2) { WoW_Template::SetPageData('errorProfile', 'template_lowlevel'); } else { WoW_Template::SetPageData('errorProfile', 'template_404'); } WoW_Template::SetPageIndex('404'); WoW_Template::SetPageData('page', '404'); } else { WoW_Achievements::Initialize(); WoW_Template::SetPageData('characterName', WoW_Characters::GetName()); WoW_Template::SetPageData('characterRealmName', WoW_Characters::GetRealmName()); switch ($url_data['action0']) { default: WoW_Template::SetPageIndex('character_profile_simple'); WoW_Template::SetPageData('page', 'character_profile'); WoW_Characters::CalculateStats(true); break; case 'advanced': WoW_Template::SetPageIndex('character_profile_advanced'); WoW_Template::SetPageData('page', 'character_profile'); WoW_Characters::CalculateStats(true); break; /* case 'talent': WoW_Template::SetPageIndex('character_talents'); WoW_Template::SetPageData('page', 'character_talents'); WoW_Template::SetPageData('talents', 'primary'); if($url_data['action1'] == 'secondary') { WoW_Template::SetPageData('talents', 'secondary'); } break; */ /* case 'talent': WoW_Template::SetPageIndex('character_talents'); WoW_Template::SetPageData('page', 'character_talents'); WoW_Template::SetPageData('talents', 'primary'); if($url_data['action1'] == 'secondary') { WoW_Template::SetPageData('talents', 'secondary'); } break; */ case 'tooltip': WoW_Template::LoadTemplate('page_character_tooltip'); exit; break; case 'achievement': for ($i = 2; $i > 0; $i--) { if (isset($url_data['action' . $i]) && $url_data['action' . $i] != null) { WoW_Achievements::SetCategoryForTemplate($url_data['action' . $i]); WoW_Template::LoadTemplate('page_character_achievements'); exit; } } WoW_Template::SetPageIndex('character_achievements'); WoW_Template::SetPageData('page', 'character_achievements'); break; case 'reputation': if (isset($url_data['action1']) && $url_data['action1'] == 'tabular') { WoW_Template::SetPageIndex('character_reputation_tabular'); } else { WoW_Template::SetPageIndex('character_reputation'); } WoW_Template::SetPageData('page', 'character_reputation'); WoW_Reputation::InitReputation(WoW_Characters::GetGUID()); break; case 'pvp': WoW_Template::SetPageIndex('character_pvp'); WoW_Template::SetPageData('page', 'character_pvp'); WoW_Characters::InitPvP(); break; case 'statistic': for ($i = 2; $i > 0; $i--) { if (isset($url_data['action' . $i]) && $url_data['action' . $i] != null) { WoW_Achievements::SetCategoryForTemplate($url_data['action' . $i]); WoW_Template::LoadTemplate('page_character_statistics'); exit; } } WoW_Template::SetPageIndex('character_statistics'); WoW_Template::SetPageData('page', 'character_statistics'); break; case 'feed': WoW_Template::SetPageIndex('character_feed'); WoW_Template::SetPageData('page', 'character_feed'); break; case 'companion': case 'mount': WoW_Template::SetPageIndex('character_companions_mounts'); WoW_Template::SetPageData('page', 'character_companions_mounts'); WoW_Template::SetPageData('category', $url_data['action0']); WoW_Characters::InitMounts(); break; } } } WoW_Template::SetMenuIndex('menu-game'); WoW_Template::LoadTemplate('page_index'); }
</a> (<span id="profile-info-spec" class="spec tip"><?php echo $talents['specsData'][WoW_Characters::GetActiveSpec()]['name']; ?> </span>) <span class="level"><strong><?php echo WoW_Characters::GetLevel(); ?> </strong></span> <?php echo WoW_Locale::GetString('template_lvl'); ?> <span class="comma">,</span> <span class="realm tip" id="profile-info-realm" data-battlegroup="<?php echo WoWConfig::$DefaultBGName; ?> "> <?php echo WoW_Characters::GetRealmName(); ?> </span> </div> <div class="achievements"><a href="<?php echo WoW_Characters::GetURL(); ?> achievement"><?php echo WoW_Achievements::GetAchievementsPoints(); ?> </a></div> </div> </div> <?php WoW_Template::LoadTemplate('block_profile_menu'); ?>