本文整理汇总了PHP中WoW::RedirectToCorrectProfilePage方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW::RedirectToCorrectProfilePage方法的具体用法?PHP WoW::RedirectToCorrectProfilePage怎么用?PHP WoW::RedirectToCorrectProfilePage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoW
的用法示例。
在下文中一共展示了WoW::RedirectToCorrectProfilePage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
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]);
//.........这里部分代码省略.........