本文整理汇总了PHP中WoW_Template::SetPageData方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Template::SetPageData方法的具体用法?PHP WoW_Template::SetPageData怎么用?PHP WoW_Template::SetPageData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoW_Template
的用法示例。
在下文中一共展示了WoW_Template::SetPageData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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;
}
示例3: 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');
}
示例4: 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');
}
示例5: 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');
}
示例6: main
public function main()
{
WoW_Template::SetPageData('carousel', WoW::GetCarouselData());
WoW_Template::SetPageData('wow_news', WoW::GetLastNews(20, isset($_GET['page']) ? (int) ($_GET['page'] - 1) : 0));
WoW_Template::SetPageData('body_class', sprintf('%s homepage', WoW_Locale::GetLocale(LOCALE_DOUBLE)));
WoW_Template::SetTemplateTheme('wow');
WoW_Template::SetPageIndex('index');
WoW_Template::SetMenuIndex('menu-home');
WoW_Template::LoadTemplate('page_index');
}
示例7: 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');
}
示例8: 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');
}
示例9: 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');
}
示例10: 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;
}
}
示例11: main
public function main()
{
WoW_Template::SetTemplateTheme('wow');
WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE));
$url_data = WoW::GetUrlData('blog');
$blog_id = $url_data['blog_id'];
if (!$blog_id || !WoW::LoadBlog($blog_id)) {
WoW_Template::ErrorPage(404);
} else {
WoW_Template::SetPageData('wow_news', WoW::GetLastNews());
WoW_Template::SetPageData('blog_title', WoW::GetBlogData('title'));
WoW_Template::SetPageData('overall_meta_title', WoW::GetBlogData('title'));
WoW_Template::SetPageData('overall_meta_img', '/cms/blog_thumbnail/' . WoW::GetBlogData('image'));
WoW_Template::SetPageIndex('blog');
WoW_Template::SetPageData('page', 'blog');
}
WoW_Template::SetMenuIndex('menu-home');
WoW_Template::LoadTemplate('page_index');
}
示例12: main
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');
}
示例13: InitPage
public static function InitPage($page_type, $category)
{
if ($page_type != 'search') {
WoW_Log::WriteError('%s : wrong page type (%s)!', __METHOD__, $page_type);
return false;
}
if (!isset($_GET['q'])) {
WoW::RedirectTo();
}
if ($_GET['q'] == null) {
WoW::RedirectTo();
}
WoW_Template::SetPageData('search_query', $_GET['q']);
self::$m_query = $_GET['q'];
if (isset($_GET['opensearch'])) {
echo '["ragnaros", ["Lil\' Ragnaros (Item)", "Ragnaros Core (Item)", "Spark of Ragnaros (Item)", "Sulfuras, Hand of Ragnaros (Item)", "Symbol of Ragnaros (Item)", "Ragnaros kills (Molten Core) (Achievement)", "Sulfuras, Hand of Ragnaros (Achievement)", "Sulfuras, Hand of Ragnaros - Guild Edition (Achievement)", "Dream of Ragnaros (Spell)", "Wrath of Ragnaros (Spell)"], [], [], [], [], [], [[3, 68385, "achievement_boss_ragnaros", 3], [3, 17982, "INV_Jewelry_Ring_25", 3], [3, 52332, "INV_Elemental_Primal_Fire", 1], [3, 17182, "INV_Hammer_Unique_Sulfuras", 5], [3, 10552, "INV_Jewelry_Talisman_04", 1], [10, 1099, "spell_fire_elemental_totem"], [10, 429, "inv_hammer_unique_sulfuras"], [10, 4997, "inv_hammer_unique_sulfuras"], [6, 75145, "INV_Chest_Cloth_57"], [6, 84402, "spell_fire_soulburn"]]]';
die;
}
WoW_Template::SetPageData('disable_breadcrumb', true);
WoW_Template::SetPageData('activeTab', 0);
// Do search
self::PerformSearch();
}
示例14: main
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');
}
示例15: main
public function main()
{
WoW_Template::SetTemplateTheme('wow');
WoW_Template::SetPageData('body_class', WoW_Locale::GetLocale(LOCALE_DOUBLE));
WoW_Template::SetMenuIndex('menu-forums');
$url_data = WoW::GetUrlData('forum');
$page = isset($_GET['page']) && preg_match('/([0-9]+)/i', $_GET['page']) ? $_GET['page'] : 1;
WoW_Template::SetPageData('current_page', $page);
// Clear category/thread values
WoW_Forums::SetCategoryId(0);
WoW_Forums::SetThreadId(0);
// Check preview
if (isset($url_data['action4'], $url_data['action5'], $url_data['action6']) && $url_data['action4'] . $url_data['action5'] . $url_data['action6'] == 'topicpostpreview') {
$post_text = isset($_POST['post']) ? $_POST['post'] : null;
if ($post_text == null) {
//This can not be here, it causes error when preview blank post text
//WoW_Template::ErrorPage(500);
}
// Convert BB codes to HTML
WoW_Forums::BBCodesToHTML($post_text);
// Output json
header('Content-type: text/json');
echo '{"detail":"' . $post_text . '"}';
exit;
}
// Set values (if any)
if ($url_data['category_id'] > 0) {
if (!WoW_Forums::SetCategoryId($url_data['category_id'])) {
WoW_Template::ErrorPage(404);
exit;
}
if (isset($url_data['action5']) && $url_data['action5'] == 'topic' && WoW_Account::IsHaveActiveCharacter()) {
// Check $_POST query
if (isset($_POST['xstoken'])) {
$post_allowed = true;
$required_post_fields = array('xstoken', 'sessionPersist', 'subject', 'postCommand_detail');
foreach ($required_post_fields as $field) {
if (!isset($_POST[$field])) {
$post_allowed = false;
}
}
if ($post_allowed) {
$post_info = WoW_Forums::AddNewThread($url_data['category_id'], $_POST, false);
if (is_array($post_info)) {
header('Location: ' . WoW::GetWoWPath() . '/wow/' . WoW_Locale::GetLocale() . '/forum/topic/' . $post_info['thread_id']);
exit;
}
}
}
// Topic create
WoW_Template::SetPageIndex('forum_new_topic');
WoW_Template::SetPageData('page', 'forum_new_topic');
} else {
WoW_Template::SetPageIndex('forum_category');
WoW_Template::SetPageData('page', 'forum_category');
}
} elseif ($url_data['thread_id'] > 0) {
if (!WoW_Forums::SetThreadId($url_data['thread_id'])) {
WoW_Template::ErrorPage(404);
exit;
}
if (isset($url_data['action4']) && $url_data['action4'] == 'topic' && preg_match('/([0-9]+)/i', $url_data['action5']) && WoW_Account::IsHaveActiveCharacter()) {
// Check $_POST query
if (isset($_POST['xstoken'])) {
$post_allowed = true;
$required_post_fields = array('xstoken', 'sessionPersist', 'detail');
foreach ($required_post_fields as $field) {
if (!isset($_POST[$field])) {
$post_allowed = false;
}
}
if ($post_allowed) {
$post_info = WoW_Forums::AddNewPost(null, $url_data['thread_id'], $_POST);
if (is_array($post_info)) {
header('Location: ' . WoW::GetWoWPath() . '/wow/' . WoW_Locale::GetLocale() . '/forum/topic/' . $url_data['thread_id']);
exit;
}
}
}
}
WoW_Template::SetPageIndex('forum_thread');
WoW_Template::SetPageData('page', 'forum_thread');
} elseif (isset($url_data['action4']) && $url_data['action4'] == 'topic' && isset($url_data['action5']) && $url_data['action5'] == 'post' && isset($url_data['action6']) && preg_match('/([0-9]+)/i', $url_data['action6'])) {
if (isset($url_data['action7']) && WoW_Account::IsHaveActiveCharacter()) {
switch ($url_data['action7']) {
case 'frag':
$Quote = WoW_Forums::QuotePost($url_data['action6']);
header('Content-type: text/json');
echo '{"detail":"' . $Quote['message'] . '","name":"' . $Quote['name'] . '"}';
exit;
break;
case 'edit':
if (isset($_POST['xstoken'])) {
$post_allowed = true;
$required_post_fields = array('xstoken', 'sessionPersist', 'postCommand_detail');
foreach ($required_post_fields as $field) {
if (!isset($_POST[$field])) {
$post_allowed = false;
}
}
//.........这里部分代码省略.........