示例#1
0
 public function main()
 {
     WoW_Template::SetPageData('body_class', sprintf('%s  game-index', WoW_Locale::GetLocale(LOCALE_DOUBLE)));
     WoW_Template::SetTemplateTheme('wow');
     $url_data = WoW::GetUrlData('game');
     if (empty($url_data['action1'])) {
         WoW_Template::SetPageIndex('game');
         WoW_Template::SetPageData('page', 'game');
     } elseif ($url_data['action1'] == 'guide') {
         switch ($url_data['action2']) {
             case 'getting-started':
             case 'how-to-play':
             case 'playing-together':
             case 'late-game':
                 WoW_Template::SetPageIndex('game_guide_' . str_replace('-', '_', $url_data['action2']));
                 WoW_Template::SetPageData('body_class', 'game-guide-' . $url_data['action2']);
                 WoW_Template::SetPageData('page', 'game_guide_' . str_replace('-', '_', $url_data['action2']));
                 break;
             default:
                 WoW_Template::SetPageIndex('game_guide_what_is_wow');
                 WoW_Template::SetPageData('body_class', 'game-guide-what-is-wow');
                 WoW_Template::SetPageData('page', 'game_guide_what_is_wow');
                 break;
         }
     } elseif ($url_data['action1'] == 'race') {
         $race_id = WoW_Utils::GetRaceIDByKey($url_data['action2']);
         if ($race_id > 0) {
             WoW_Game::LoadRace($race_id);
             WoW_Template::SetPageIndex('game_race');
             WoW_Template::SetPageData('body_class', 'race-' . $url_data['action2']);
             WoW_Template::SetPageData('race', $url_data['action2']);
             WoW_Template::SetPageData('page', 'game_race');
             WoW_Template::SetPageData('raceId', $race_id);
         } else {
             WoW_Template::SetPageIndex('game_race_index');
             WoW_Template::SetPageData('body_class', 'game-race-index');
             WoW_Template::SetPageData('page', 'game_race_index');
         }
     } elseif ($url_data['action1'] == 'class') {
         $class_id = WoW_Utils::GetClassIDByKey($url_data['action2']);
         if ($class_id > 0) {
             WoW_Game::LoadClass($class_id);
             WoW_Template::SetPageIndex('game_class');
             WoW_Template::SetPageData('body_class', 'class-' . $url_data['action2']);
             WoW_Template::SetPageData('class', $url_data['action2']);
             WoW_Template::SetPageData('classId', $class_id);
             WoW_Template::SetPageData('page', 'game_class');
         } else {
             WoW_Template::SetPageIndex('game_class_index');
             WoW_Template::SetPageData('body_class', 'game-classes-index');
             WoW_Template::SetPageData('page', 'game_class_index');
         }
     } else {
         WoW_Template::ErrorPage(404);
     }
     WoW_Template::SetMenuIndex('menu-game');
     WoW_Template::LoadTemplate('page_index');
 }
示例#2
0
 public function main()
 {
     WoW_Template::SetPageData('body_class', sprintf('%s zone-index expansion-3', WoW_Locale::GetLocale(LOCALE_DOUBLE)));
     WoW_Template::SetTemplateTheme('wow');
     WoW_Template::SetPageIndex('zones');
     WoW_Template::SetPageData('page', 'zones');
     $url_data = WoW::GetUrlData('zone');
     if (isset($url_data['action3'])) {
         exit;
     }
     if (isset($url_data['action1']) && $url_data['action1'] != null) {
         // Try to find zone
         if (WoW_Game::IsZone($url_data['action1'])) {
             WoW_Template::SetPageData('zoneKey', $url_data['action1']);
             if (isset($url_data['action2']) && $url_data['action2'] != null) {
                 if (in_array($url_data['action2'], array('loot', 'quests', 'quest-rewards', 'achievements', 'comments'))) {
                     die('NYI');
                 }
                 if (WoW_Game::IsBoss($url_data['action2'])) {
                     WoW_Template::SetPageIndex('boss');
                     WoW_Template::SetPageData('page', 'boss');
                     WoW_Template::SetPageData('bossKey', $url_data['action2']);
                     WoW_Game::LoadBoss($url_data['action2']);
                     // save in memory
                     WoW_Template::SetPageData('body_class', sprintf('%s zone-%s boss-%s', WoW_Locale::GetLocale(LOCALE_DOUBLE), $url_data['action1'], $url_data['action2']));
                 }
             } else {
                 WoW_Template::SetPageIndex('zone');
                 WoW_Template::SetPageData('page', 'zone');
                 WoW_Game::LoadZone($url_data['action1']);
                 // save in memory
                 WoW_Template::SetPageData('body_class', sprintf('%s zone-%s', WoW_Locale::GetLocale(LOCALE_DOUBLE), $url_data['action1']));
             }
         }
     }
     WoW_Template::SetMenuIndex('menu-game');
     WoW_Template::LoadTemplate('page_index');
 }
示例#3
0
 public function main()
 {
     WoW_Template::SetPageData('body_class', sprintf('%s  faction-index expansion-3', WoW_Locale::GetLocale(LOCALE_DOUBLE)));
     WoW_Template::SetTemplateTheme('wow');
     WoW_Template::SetPageIndex('faction');
     WoW_Template::SetPageData('page', 'faction');
     $url_data = WoW::GetUrlData('faction');
     if (isset($url_data['action2']) && $url_data['action2'] != null) {
         exit;
         // [PH]
     }
     if (isset($url_data['action1']) && $url_data['action1'] != null) {
         // Try to find zone
         if (WoW_Game::IsZone($url_data['action1'])) {
             WoW_Template::SetPageIndex('zone');
             WoW_Template::SetPageData('page', 'zone');
             WoW_Game::LoadZone($url_data['action1']);
             // save in memory
         }
     }
     WoW_Template::SetMenuIndex('menu-game');
     WoW_Template::LoadTemplate('page_index');
 }
<?php

$race = WoW_Game::GetRace();
?>
<div id="content">
<div class="content-top">
<div class="content-trail">
<?php 
WoW_Template::NavigationMenu();
?>
<!--<ol class="ui-breadcrumb">
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/<?php 
echo WoW_Locale::GetLocale();
?>
/" rel="np">World of Warcraft</a></li>
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/<?php 
echo WoW_Locale::GetLocale();
?>
/game/" rel="np"><?php 
echo WoW_Locale::GetString('template_menu_game');
?>
</a></li>
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
示例#5
0
 public static function LoadBoss($boss_key)
 {
     self::$m_boss = DB::WoW()->selectRow("\n        SELECT\n        `a`.`boss_id` AS `id`,\n        `a`.`instance_id`,\n        `a`.`key`,\n        `a`.`name_en` AS `nameOriginal`,\n        `a`.`name_%s` AS `name`,\n        `a`.`subname_en` AS `subNameOriginal`,\n        `a`.`subname_%s` AS `subName`,\n        `a`.`description_en` AS `descriptionOriginal`,\n        `a`.`description_%s` AS `description`,\n        `a`.`level`,\n        `a`.`flags`,\n        `a`.`health_n`,\n        `a`.`health_h`,\n        `a`.`type`,\n        `b`.`zone_key`,\n        `b`.`name_%s` AS `zoneName`,\n        `b`.`name_en` AS `zoneNameOriginal`\n        FROM `DBPREFIX_instance_bosses` AS `a`\n        LEFT JOIN `DBPREFIX_instances` AS `b` ON `b`.`zone_id` = `a`.`instance_id`\n        WHERE `key` = '%s' LIMIT 1", WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), $boss_key);
     self::$m_boss['abilities'] = DB::WoW()->select("SELECT `name_%s` AS `name`, `name_en` AS `nameOriginal`, `description_%s` AS `description`, `description_en` AS `descriptionOriginal`, `icon` FROM `DBPREFIX_bosses_abilities` WHERE `boss_id` = %d", WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), self::$m_boss['id']);
     self::HandleBoss();
 }
		<div class="title">
			<h2><?php 
echo WoW_Locale::GetString('template_game_dungeons_and_raids');
?>
</h2>

			<div class="desc"><?php 
echo WoW_Locale::GetString('template_zones_desc');
?>
</div>
		</div>

		<div class="wrapper">
			<div class="groups">
            <?php 
$all_zones = WoW_Game::GetZones();
if (is_array($all_zones)) {
    $modes = array('dungeons', 'raids');
    foreach ($all_zones as $expansionId => $zones) {
        echo sprintf('<div class="group" id="expansion-%d"%s>', $expansionId, $expansionId != EXPANSION_CATA ? ' style="display: none"' : null);
        foreach ($modes as $currentMode) {
            echo sprintf('
                        <div class="group-column">
                        <h3>%s</h3>
                        ', WoW_Locale::GetString('template_zones_' . $currentMode));
            // Print dungeons
            if (isset($zones[$currentMode]) && is_array($zones[$currentMode])) {
                echo '<ul>
                            ';
                $dungeonGroups = array();
                foreach ($zones[$currentMode] as $dungeon) {
<?php

$class = WoW_Game::GetClass();
?>
<div id="content">
<div class="content-top">
<div class="content-trail">
<?php 
WoW_Template::NavigationMenu();
?>
<!--<ol class="ui-breadcrumb">
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/<?php 
echo WoW_Locale::GetLocale();
?>
/" rel="np">World of Warcraft</a></li>
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/<?php 
echo WoW_Locale::GetLocale();
?>
/game/" rel="np"><?php 
echo WoW_Locale::GetString('template_menu_game');
?>
</a></li>
<li><a href="<?php 
echo WoW::GetWoWPath();
?>
<?php

$zone_info = WoW_Game::GetZone();
?>
<div id="content">
<div class="content-top">
<div class="content-trail">
<?php 
WoW_Template::NavigationMenu();
?>
<!--<ol class="ui-breadcrumb">
<li>
<a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/" rel="np">
World of Warcraft
</a>
</li>
<li>
<a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/game/" rel="np">
<?php 
echo WoW_Locale::GetString('template_menu_game');
?>
</a>
</li>
<li>
<a href="<?php 
?>
</p>
<?php 
$classes = array('warrior' => CLASS_WARRIOR, 'paladin' => CLASS_PALADIN, 'hunter' => CLASS_HUNTER, 'rogue' => CLASS_ROGUE, 'priest' => CLASS_PRIEST, 'death-knight' => CLASS_DK, 'shaman' => CLASS_SHAMAN, 'mage' => CLASS_MAGE, 'warlock' => CLASS_WARLOCK, 'druid' => CLASS_DRUID);
$exp_classes = array('wrath' => array('death-knight'));
$i = 0;
foreach ($classes as $class_name => $class_id) {
    if (in_array($class_name, $exp_classes['wrath'])) {
        $req = sprintf('<em class="class-req wrath">%s</em>', WoW_Locale::GetString('template_zone_expansion_required') . ' ' . WoW_Locale::GetString('template_expansion_2'));
    } else {
        $req = '';
    }
    echo sprintf('<div class="flag-card %s">
        <div class="wrapper">
        <a href="%s">
        	<span class="class-name">%s</span>
        	<span class="class-type">%s</span>%s
        	<span class="class-desc">%s</span>
        </a>
        </div>
        </div>', $class_name, $class_name, WoW_Locale::GetString('character_class_' . $class_id), WoW_Utils::GetClassRolesInfo(WoW_Game::GetClassRole($class_id)), $req, WoW_Locale::GetString('template_game_class_' . $class_name . '_info'));
    ++$i;
}
?>
      <span class="clear">
        <!-- -->
      </span>
    </div>
  </div>
</div>
 public static function NavigationMenu()
 {
     // Maybe breadcrumb content should be filled from appropriate page controller? // Shadez
     $navigationMenu[0] = WoW_Locale::$navigation;
     $url_data = WoW::GetUrlData();
     $path_data = NULL;
     $path_search_data = NULL;
     $last = false;
     $dynamic_content = false;
     switch ($url_data[1]) {
         case '/zone/':
             $dynamic_content = true;
             @($zone_info = WoW_Game::GetZone());
             $_data = array(0 => '/', 1 => '/game/', 2 => '/zone/', 3 => '/zone/#expansion=' . @$zone_info['expansion'] . '&type=' . @$zone_info['type'] . 's', 4 => '/zone/' . @$url_data[2], 5 => '/zone/' . @$url_data[2] . '/' . @$url_data[3]);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             if (isset($url_data[2])) {
                 $path_search_data[4] = $_data[4];
             }
             break;
         case '/faction/':
             $dynamic_content = true;
             /**
              *  WoW_Game::GetFaction() is not defined    
              *                           
              *  TODO
              *  Create function WoW_Game::GetFaction() with same rules as WoW_Game::GetZone()
              *  and edit wow_content_faction.php template to load datas from DB same as wow_content_zones.php template
              *  
              *  Create template and DB data to load and display each faction details.                              
              */
             //@$faction_info = WoW_Game::GetFaction();
             $_data = array(0 => '/', 1 => '/game/', 2 => '/faction/', 3 => '/faction/#expansion=' . @$faction_info['expansion'], 4 => '/faction/' . @$url_data[2]);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             if (isset($url_data[2])) {
                 $path_search_data[4] = $_data[4];
             }
             break;
         case '/item/':
             $dynamic_content = true;
             //WoW_Items::GetBreadCrumbsForItem($_GET) is NOT needed now
             if (isset($url_data[2])) {
                 $preg = preg_match('/\\/(\\?classId=([0-9]+)((&subClassId=([0-9]+))?(&invType=([0-9]+))?)?)|([0-9]+)\\/{0,1}/i', $url_data[2], $matches);
             }
             $_data = array(0 => '/', 1 => '/game/', 2 => '/item/', 3 => NULL, 4 => NULL, 5 => NULL);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             if (isset($matches) && array_key_exists(8, $matches)) {
                 $proto = new WoW_ItemPrototype();
                 $proto->LoadItem($matches[8]);
                 $matches[2] = $proto->class;
                 $matches[5] = $proto->subclass;
                 if ($matches[2] == 4 && in_array($matches[5], array(0, 1, 2, 3, 4))) {
                     $matches[7] = $proto->InventoryType;
                     $path_search_data[6] = '/item/' . $matches[8];
                     $label[6] = $proto->name;
                 } else {
                     unset($matches[7]);
                     $path_search_data[5] = '/item/' . $matches[8];
                     $label[5] = $proto->name;
                 }
             }
             if (isset($matches) && (array_key_exists(2, $matches) || array_key_exists(8, $matches))) {
                 $path_search_data[3] = '/item/?classId=' . $matches[2];
             }
             if (isset($matches) && (array_key_exists(5, $matches) || array_key_exists(8, $matches))) {
                 $path_search_data[4] = '/item/?classId=' . $matches[2] . '&subClassId=' . $matches[5];
             }
             if (isset($matches) && array_key_exists(7, $matches)) {
                 $path_search_data[5] = '/item/?classId=' . $matches[2] . '&subClassId=' . $matches[5] . '&invType=' . $matches[7];
             }
             break;
         case '/profession/':
             $dynamic_content = true;
             $_data = array(0 => '/', 1 => '/game/', 2 => '/profession/', 3 => '/profession/' . @$url_data[2]);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             break;
         case '/pvp/':
             $dynamic_content = true;
             $_data = array(0 => '/', 1 => '/game/', 2 => '/pvp/', 3 => '/pvp/' . @$url_data[2]);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             break;
         case '/status/':
             $dynamic_content = true;
             $_data = array(0 => '/', 1 => '/game/', 2 => '/status/', 3 => '/status/' . @$url_data[2]);
             for ($a = 0; $a <= count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             break;
         case '/character/':
             $dynamic_content = true;
             $subdata4 = '';
             $data3 = '';
             $count = 0;
             @($url_data[3] = @urldecode($url_data[3]));
             if (isset($url_data[4])) {
                 if (in_array($url_data[4], array('/simple/', '/advanced/'))) {
                     $count = 2;
                     $subdata4 = @$url_data[4];
                 } elseif ($url_data[4] == '/achievement/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_achievements');
                 } elseif ($url_data[4] == '/statistic/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_statistics');
                 } elseif ($url_data[4] == '/reputation/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_reputation');
                 } elseif ($url_data[4] == '/pvp/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = 'PvP';
                 } elseif ($url_data[4] == '/feed/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_feed');
                 } elseif ($url_data[4] == '/mount/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_mounts');
                 } elseif ($url_data[4] == '/companion/') {
                     $count = 3;
                     $data3 = '/character/' . @$url_data[2] . @$url_data[3] . @$url_data[4];
                     $label[3] = WoW_Locale::GetString('template_profile_companions');
                 }
             }
             $label[2] = str_replace(array('/', '+'), array('', ' '), @$url_data[3] . ' @ ' . @$url_data[2]);
             $_data = array(0 => '/', 1 => '/game/', 2 => '/character/' . @$url_data[2] . @$url_data[3] . $subdata4, 3 => $data3, 4 => NULL, 5 => NULL);
             for ($a = 0; $a <= $count; ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             break;
         case '/blog/':
             $dynamic_content = true;
             $_data = array(0 => '/', 1 => '/blog/' . @$url_data[2]);
             $label[1] = WoW::GetBlogData('title');
             for ($a = 0; $a < count($_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             break;
         case '/forum/':
             $dynamic_content = true;
             $_data = array(0 => '/', 1 => '/forum/', 2 => '/forum/#forum' . WoW_Forums::GetGlobalCategoryId(), 3 => '/forum/' . WoW_Forums::GetCategoryId() . '/', 4 => '/forum/topic/' . WoW_Forums::GetThreadId() . '/', 5 => '/forum/topic/post/' . @$url_data[4] . '/edit', 6 => '/forum/topic/post/' . @$url_data[4] . '/delete', 7 => '/forum/blizztracker/');
             for ($a = 0; $a < count($url_data); ++$a) {
                 $path_search_data[$a] = $_data[$a];
             }
             if (isset($url_data[2]) && $url_data[2] != '/topic/') {
                 if (isset($url_data[2]) && $url_data[2] == '/blizztracker/') {
                     $path_search_data[2] = $_data[7];
                     $label[2] = WoW_Locale::GetString('template_blizztracker_title');
                     unset($path_search_data[3]);
                 } else {
                     $path_search_data[3] = $_data[3];
                 }
             }
             if (isset($url_data[2]) && $url_data[2] == '/topic/') {
                 if ($url_data[3] == '/post/') {
                     $path_search_data[3] = $_data[3];
                     $path_search_data[4] = $_data[5];
                     $label[4] = WoW_Forums::GetThreadTitle();
                     unset($path_search_data[5]);
                     unset($path_search_data[6]);
                 } else {
                     $path_search_data[3] = $_data[3];
                     $path_search_data[4] = $_data[4];
                     $label[4] = WoW_Forums::GetThreadTitle();
                 }
             }
             break;
         default:
             $path_search_data = $url_data;
             break;
     }
     /*
      * BUG!!! Need Rewritten and Reworked script...
      * Need This <span class="breadcrumb-arrow"></span>
      */
     echo '<ol class="ui-breadcrumb">';
     $path_data = '';
     for ($i = 0; $i < count($path_search_data); ++$i) {
         if ($i == count($path_search_data) - 1) {
             $last = true;
         }
         if ($dynamic_content) {
             $path_data = $path_search_data[$i];
         } else {
             $path_data .= $url_data[$i];
         }
         $path_data = str_replace('//', '/', $path_data);
         if (!isset($label[$i])) {
             $menu = self::array_searchRecursive($path_data, $navigationMenu);
         } else {
             $menu['label'] = $label[$i];
         }
         echo '<li' . ($last == true ? ' class="last"' : null) . '><a href="' . WoW::GetWoWPath() . '/wow/' . WoW_Locale::GetLocale() . $path_data . '" rel="np">' . $menu['label'] . '</a></li>';
     }
     echo '</ol>';
 }
示例#11
0
<?php

$boss = WoW_Game::GetBoss();
?>
<div id="content">
<div class="content-top">
<div class="content-trail">
<?php 
WoW_Template::NavigationMenu();
?>
<!--
<ol class="ui-breadcrumb">
<li>
<a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/<?php 
echo WoW_Locale::GetLocale();
?>
/" rel="np">
World of Warcraft
</a>
</li>
<li>
<a href="<?php 
echo WoW::GetWoWPath();
?>
/wow/ru/game/" rel="np">
Игра
</a>
</li>