当前位置: 首页>>代码示例>>PHP>>正文


PHP WoW_Template类代码示例

本文整理汇总了PHP中WoW_Template的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Template类的具体用法?PHP WoW_Template怎么用?PHP WoW_Template使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了WoW_Template类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: ExtractCategory

 protected static function ExtractCategory($page_type, $category, &$type, &$class_category)
 {
     if (strpos($category, '.')) {
         $cat_data = explode('.', $category);
         if (!$cat_data || !is_array($cat_data)) {
             return false;
         }
     } else {
         $cat_data = array($category);
     }
     self::$m_pageType = $page_type;
     // Max subcats count: 3 - type.cat1.cat2
     $type = isset($cat_data[0]) && $cat_data[0] !== false ? $cat_data[0] : false;
     self::$m_categoryInfo[0] = $type;
     $breadcrumb = '0,' . self::GetCatIdForPage($page_type);
     // Find category
     for ($i = 0; $i < 3; ++$i) {
         if (isset($cat_data[$i]) && $cat_data[$i] >= 0) {
             $breadcrumb .= ',' . $cat_data[$i];
             $class_category = $i >= 0 ? $cat_data[$i] : false;
         }
     }
     self::$m_categoryInfo[1] = $class_category;
     WoW_Template::SetPageData('breadcrumb', $breadcrumb);
     return true;
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:26,代码来源:class.abstract.php

示例2: main

 public function main()
 {
     WoW_Template::SetTemplateTheme('wow');
     WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE));
     // Check query
     $searchQuery = isset($_GET['q']) ? $_GET['q'] : null;
     if ($searchQuery != null && mb_strlen($searchQuery) < 3) {
         $searchQuery = null;
     }
     if (preg_match('/\\@/', $searchQuery)) {
         $fast_access = explode('@', $searchQuery);
         if (isset($fast_access[0], $fast_access[1])) {
             header('Location: ' . WoW::GetWoWPath() . '/wow/' . WoW_Locale::GetLocale() . '/character/' . trim($fast_access[1]) . trim($fast_access[0]) . '/');
             exit;
         }
     }
     WoW_Search::SetSearchQuery($searchQuery);
     // Perform Search
     WoW_Search::PerformSearch();
     // Set active page
     if (isset($_GET['f']) && in_array($_GET['f'], array('search', 'wowarenateam', 'article', 'wowcharacter', 'wowitem', 'post', 'wowguild'))) {
         $page = $_GET['f'];
     } else {
         $page = 'search';
     }
     WoW_Search::SetCurrentPage($page);
     WoW_Template::SetPageIndex('search');
     WoW_Template::SetPageData('page', 'search');
     WoW_Template::SetPageData('searchQuery', $searchQuery);
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:31,代码来源:search.php

示例3: main

 public function main()
 {
     WoW_Template::SetPageIndex('login');
     if (WoW_Account::IsLoggedIn()) {
         header('Location: ' . WoW::GetWoWPath() . '/');
         exit;
     }
     if (isset($_POST['accountName'])) {
         $username = $_POST['accountName'];
         $password = $_POST['password'];
         $persistLogin = isset($_POST['persistLogin']) ? true : false;
         WoW_Account::DropLastErrorCode();
         if (mb_strlen($password) <= 7) {
             WoW_Account::SetLastErrorCode(ERORR_INVALID_PASSWORD_FORMAT);
         }
         if ($username == null) {
             WoW_Account::SetLastErrorCode(ERROR_EMPTY_USERNAME);
         }
         if ($password == null) {
             WoW_Account::SetLastErrorCode(ERROR_EMPTY_PASSWORD);
         }
         if (WoW_Account::PerformLogin($username, $password, $persistLogin)) {
             if (isset($_POST['ref'])) {
                 header('Location: ' . $_POST['ref']);
                 exit;
             }
             header('Location: ' . WoW::GetWoWPath() . '/');
             exit;
         }
         // Other error messages will appear automaticaly.
     }
     WoW_Template::LoadTemplate('page_login', true);
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:33,代码来源:home.php

示例4: main

 public function main()
 {
     WoW_Template::SetTemplateTheme('bn');
     WoW_Template::SetMenuIndex('index');
     WoW_Template::SetPageIndex('landing');
     WoW_Template::SetPageData('landing', 'what_is');
     WoW_Template::LoadTemplate('page_landing');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:8,代码来源:what_is.php

示例5: main

 public function main()
 {
     WoW_Template::SetTemplateTheme('bn');
     WoW_Template::SetMenuIndex('index');
     WoW_Account::UserGames();
     WoW_Template::SetPageIndex('index');
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:8,代码来源:main.php

示例6: main

 public function main()
 {
     if (!WoWConfig::$Maintenance) {
         WoW::RedirectTo();
         return;
     }
     WoW_Template::LoadTemplate('page_maintenance', true);
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:8,代码来源:maintenance.php

示例7: main

 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');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:58,代码来源:game.php

示例8: main

 public function main()
 {
     WoW_Template::SetTemplateTheme('wow');
     WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE));
     WoW_Template::SetPageIndex('realm_status');
     WoW_Template::SetPageData('page', 'realm_status');
     WoW_Template::SetMenuIndex('menu-game');
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:9,代码来源:status.php

示例9: main

 public function main()
 {
     if (!WoWConfig::$EnableBNPage && !isset($_GET['skipRedirect'])) {
         WoW::RedirectTo('wow/' . WoW_Locale::GetLocale());
     }
     WoW_Template::SetTemplateTheme('bn');
     WoW_Template::SetMenuIndex('index');
     WoW_Account::UserGames();
     WoW_Template::SetPageIndex('index');
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:11,代码来源:home.php

示例10: main

 public function main()
 {
     if (!isset($_POST['index']) || !WoW_Account::IsLoggedIn()) {
         WoW_Template::ErrorPage(404);
         exit;
     }
     $character_index = $_POST['index'];
     DB::WoW()->query("UPDATE `DBPREFIX_user_characters` SET `isActive` = 0 WHERE `bn_id` = %d", WoW_Account::GetUserID());
     // Clear all
     DB::WoW()->query("UPDATE `DBPREFIX_user_characters` SET `isActive` = 1 WHERE `index` = %d AND `bn_id` = %d", $character_index, WoW_Account::GetUserID());
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:11,代码来源:pref.php

示例11: main

 public function main()
 {
     WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE));
     WoW_Template::SetTemplateTheme('wow');
     $url_data = WoW::GetUrlData('guild');
     $guild_error = false;
     if (!$url_data) {
         WoW_Template::ErrorPage(404);
     } elseif (!WoW_Guild::LoadGuild($url_data['name'], WoW_Utils::GetRealmIDByName($url_data['realmName']))) {
         WoW_Template::ErrorPage(404);
     } else {
         $primary = WoW_Account::GetActiveCharacter();
         WoW_Template::SetPageData('guild-authorized', false);
         if (is_array($primary) && isset($primary['realmName'])) {
             if ($primary['realmName'] == WoW_Guild::GetGuildRealmName() && $primary['guildId'] == WoW_Guild::GetGuildID()) {
                 WoW_Template::SetPageData('guild-authorized', true);
             }
         }
         switch ($url_data['action0']) {
             default:
                 WoW_Template::SetPageData('guild-page', 'summary');
                 WoW_Template::SetPageIndex('guild_page');
                 WoW_Template::SetPageData('page', 'guild_page');
                 break;
             case 'perk':
                 WoW_Template::SetPageData('guild-page', 'perks');
                 WoW_Template::SetPageIndex('guild_perks');
                 WoW_Template::SetPageData('page', 'guild_perks');
                 break;
             case 'roster':
                 switch ($url_data['action1']) {
                     default:
                         WoW_Template::SetPageIndex('guild_roster');
                         WoW_Template::SetPageData('page', 'guild_roster');
                         break;
                     case 'professions':
                         WoW_Guild::InitProfessions();
                         WoW_Template::SetPageIndex('guild_professions');
                         WoW_Template::SetPageData('page', 'guild_professions');
                         break;
                 }
                 WoW_Template::SetPageData('guild-page', 'roster');
                 break;
         }
         WoW_Template::SetPageData('guildName', $url_data['name']);
         WoW_Template::SetPageData('realmName', $url_data['realmName']);
         WoW_Template::SetMenuIndex('menu-game');
     }
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:50,代码来源:guild.php

示例12: main

 public function main()
 {
     WoW_Template::SetTemplateTheme('wow');
     WoW_Template::SetPageIndex('account_status');
     WoW_Template::SetPageData('page', 'account_status');
     if (!WoW_Account::IsLoggedIn()) {
         WoW_Template::SetPageData('account-status', 'no_session');
     } elseif (WoW_Account::IsBanned()) {
         WoW_Template::SetPageData('account-status', 'no_subscribe');
     } else {
         WoW_Template::SetPageData('account-status', 'success');
     }
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:14,代码来源:account_status.php

示例13: main

 public function main()
 {
     WoW_Template::SetPageData('body_class', sprintf('%s  media-content', WoW_Locale::GetLocale(LOCALE_DOUBLE)));
     WoW_Template::SetTemplateTheme('wow');
     $url_data = WoW::GetUrlData('media');
     if (empty($url_data['action1'])) {
         WoW_Template::SetPageIndex('media');
         WoW_Template::SetPageData('page', 'media');
     } else {
         WoW_Template::ErrorPage(404);
     }
     WoW_Template::SetMenuIndex('menu-media');
     WoW_Template::LoadTemplate('page_index');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:14,代码来源:media.php

示例14: main

 public function main()
 {
     if (!isset($this->m_actions['action3'])) {
         $this->m_actions['action3'] = 'arena';
     }
     WoW_Template::SetTemplateTheme('wow');
     switch ($this->m_actions['action3']) {
         default:
         case 'arena':
             if (isset($this->m_actions['action4']) && $this->m_actions['action4'] != null) {
                 // Try to find BG with provided name
                 $bg_found = false;
                 foreach (WoWConfig::$BattleGroups as &$bg) {
                     if (mb_strtolower($bg['name']) == mb_strtolower(urldecode($this->m_actions['action4']))) {
                         // BG was found
                         $bg_found = true;
                         WoW_Template::SetPageData('activeBG', mb_strtolower($bg['name']));
                         WoW_Template::SetPageData('bg', $bg);
                     }
                 }
                 if (!$bg_found) {
                     WoW_Template::ErrorPage(404);
                     return false;
                 }
                 WoW_Template::SetPageIndex('pvp_arena_ladder');
                 WoW_Template::SetPageData('page', 'pvp_arena_ladder');
                 // Set team format
                 if (!isset($this->m_actions['action4']) || $this->m_actions['action4'] == null) {
                     $this->m_actions['action4'] = '2v2';
                     WoW_Template::SetPageData('teamFormat', 2);
                     WoW_Template::SetPageData('teamFormatS', '2v2');
                 } else {
                     $format = substr($this->m_actions['action5'], 0, 1);
                     if (!in_array($format, array('2', '3', '5'))) {
                         $format = 2;
                     }
                     WoW_Template::SetPageData('teamFormat', $format);
                     WoW_Template::SetPageData('teamFormatS', $format . 'v' . $format);
                 }
             } else {
                 WoW_Template::SetPageIndex('pvp_arena');
                 WoW_Template::SetPageData('page', 'pvp_arena');
             }
             WoW_Template::LoadTemplate('page_index');
             break;
         case 'trending':
             break;
     }
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:49,代码来源:pvp.php

示例15: main

 public function main()
 {
     header('Content-type: text/plain');
     WoW_Template::SetTemplateTheme('wow');
     if (isset($_GET['locale']) && WoW_Locale::IsLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']))) {
         WoW_Locale::SetLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']));
     }
     $searchQuery = isset($_GET['term']) ? $_GET['term'] : null;
     if ($searchQuery != null && mb_strlen($searchQuery) < 3 || $searchQuery == null) {
         die('{"reason":"A term parameter is required.","status":"nok"}');
     }
     WoW_Search::SetSearchQuery($searchQuery);
     WoW_Search::PerformItemsSearch(10);
     WoW_Template::LoadTemplate('page_ta_lookup');
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:15,代码来源:ta.php


注:本文中的WoW_Template类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。