當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WoW::RedirectTo方法代碼示例

本文整理匯總了PHP中WoW::RedirectTo方法的典型用法代碼示例。如果您正苦於以下問題:PHP WoW::RedirectTo方法的具體用法?PHP WoW::RedirectTo怎麽用?PHP WoW::RedirectTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WoW的用法示例。


在下文中一共展示了WoW::RedirectTo方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: main

 public function main()
 {
     if (!WoWConfig::$Maintenance) {
         WoW::RedirectTo();
         return;
     }
     WoW_Template::LoadTemplate('page_maintenance', true);
 }
開發者ID:JunkyBulgaria,項目名稱:WoWCS,代碼行數:8,代碼來源:maintenance.php

示例2: 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

示例3: 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();
 }
開發者ID:Kheros,項目名稱:wowhead,代碼行數:23,代碼來源:class.search.php

示例4: main

 public function main()
 {
     $url_data = WoW::GetUrlData('vault');
     // Check session
     if ($url_data['action0'] != 'vault') {
         // Wrong URL parsing
         header('Location: ' . WoW::GetWoWPath() . '/wow/');
         exit;
     }
     if (!WoW_Account::IsLoggedIn()) {
         header('Location: ' . WoW::GetWoWPath() . '/login/?ref=' . urlencode($_SERVER['REQUEST_URI']));
         exit;
     }
     WoW_Template::SetTemplateTheme('wow');
     switch ($url_data['action1']) {
         case 'character':
             switch ($url_data['action2']) {
                 case 'auction':
                     $auction_side = $url_data['action3'];
                     if (!$auction_side || !in_array($auction_side, array('alliance', 'horde', 'neutral'))) {
                         WoW::RedirectTo('wow/' . WoW_Locale::GetLocale() . '/vault/character/auction/' . WoW_Account::GetActiveCharacterInfo('faction_text'));
                     }
                     // Check active character
                     if (WoW_Account::GetActiveCharacterInfo('guid') == 0) {
                         WoW::RedirectTo();
                     }
                     switch ($url_data['action4']) {
                         default:
                             WoW_Template::SetPageData('auction_side', $auction_side);
                             WoW_Template::SetPageIndex('auction_lots');
                             WoW_Template::SetPageData('page', 'auction_lots');
                             break;
                         case 'cancel':
                             // Cancelling, adding, etc. requires core support!
                             if (!isset($_POST['auc'])) {
                                 exit;
                             }
                             $auction_id = (int) $_POST['auc'];
                             header('Content-type: text/plain');
                             echo WoW_Auction::CancelAuction($auction_id);
                             exit;
                             /*
                             if(isset($_POST['auc'])) {
                                 $auction_id = (int) $_POST['auc'];
                                 // WoW REMOTE FEATURE
                             }
                             file_put_contents('cancel.txt', print_r($_POST, true));
                             exit;
                             */
                             break;
                     }
                     break;
                 default:
                     WoW_Template::ErrorPage(404);
                     break;
             }
             break;
         default:
             WoW_Template::ErrorPage(404);
             break;
     }
     WoW_Template::LoadTemplate('page_index');
 }
開發者ID:GetPlay,項目名稱:WorldOfWarCraft-WebSite,代碼行數:63,代碼來源:vault.php

示例5: InitFilters

 public static function InitFilters($parsePost = true)
 {
     if ($_POST && $parsePost) {
         $filter_filters = null;
         foreach ($_POST as $filterKey => $filterValue) {
             if ((!is_string($filterValue) || $filterValue == null || empty($filterValue)) && (!is_array($filterValue) || !$filterValue)) {
                 continue;
             }
             if (is_array($filterValue) && count($filterValue) > 0) {
                 $filter_filters .= $filterKey . '=';
                 $max = count($filterValue);
                 $current = 1;
                 foreach ($filterValue as $val) {
                     if ($val === null) {
                         continue;
                     }
                     $filter_filters .= $val;
                     if ($current < $max) {
                         $filter_filters .= ':';
                     }
                 }
                 $filter_filters .= ';';
             } elseif ($filterValue !== null) {
                 $filter_filters .= $filterKey . '=' . $filterValue . ';';
             }
         }
         $filter_filters = str_replace(array(':;', '=;'), ';', $filter_filters);
         WoW::RedirectTo(self::GetPageAction() . '?filter=' . $filter_filters);
     }
     /*
         COMMON FILTERS:
             [na] => Name
             [si] => Side (1 - Alliance, -1 - Alliance only, 2 - Horde, -2 - Horde only, 3 - both)
             [cr] => CommonFilterID
             [crs] => FirstFilterValID
             [crv] => SecondFilterValID
         ITEM FILTERS:
             [sl] => SlotID
             [qu] => QualityID
             [minle] => MinItemLevel
             [maxle] => MaxItemLevel
             [minrl] => MinRequiredLevel
             [maxrl] => MaxRequiredLevel
             [ub] => UseableClassID
             [gt] => GetTypes
         ACHIEVEMENTS FILTERS:
             [minpt] => Min Points
             [maxpt] => Max Points
         QUESTS FILTERS:
             [minle] => MinQuestLevel
             [maxle] => MaxQuestLevel
         SPELLS FILTERS:
             [me] => MechanicID
             [dt] => DispellTypeID
             [sc] => SpellSchoolID
             [ra] => RaceID
         NPCS FILTERS:
             [ra] => ReactionAlliance
             [rh] => ReactionHorde
             [fa] => FamilyID
             [cl] => ClassificationID
         ITEMSET FILTERS:
             [ta] => ItemsetTag
             [ty] => ItemInventoryTypeID
     */
     //WoW_Template::SetPageIndex('filters');
     if (!isset($_GET['filter'])) {
         return false;
     }
     // Try to explode
     $filter_items = explode(';', $_GET['filter']);
     if (!$filter_items) {
         return false;
     }
     $filter = array();
     $advanced_filters = array();
     $nextId = 0;
     foreach ($filter_items as $item) {
         $current = explode('=', $item);
         if (!$current || !isset($current[1])) {
             continue;
         }
         $each = explode(':', $current[1]);
         if ($each) {
             $temp = array('key' => $current[0], 'values' => array());
             if (in_array($current[0], array('cr', 'crv', 'crs'))) {
                 $advanced_filters[$current[0]] = array('key' => $current[0], 'values' => array());
             }
             foreach ($each as $value) {
                 if ($value !== null) {
                     $temp['values'][] = $value;
                 }
                 if (in_array($current[0], array('cr', 'crv', 'crs')) && !empty($value)) {
                     $advanced_filters[$current[0]]['values'][] = $value;
                 }
             }
         } else {
             $temp = array('key' => $current[0], 'values' => $current[1]);
             if (in_array($current[0], array('cr', 'crv', 'crs'))) {
                 $advanced_filters[$current[0]] = array('key' => $current[0], 'values' => array($current[1]));
//.........這裏部分代碼省略.........
開發者ID:Kheros,項目名稱:wowhead,代碼行數:101,代碼來源:class.wow.php

示例6: strtolower

    //prevent error when mailer classes are loaded
    $className = strtolower(str_replace('WoW_', null, $className));
    if (!file_exists(CLASSES_DIR . 'class.' . $className . '.php')) {
        die('<strong>Autoload Fatal Error:</strong> unable to autoload class ' . $className . '!');
    }
    include CLASSES_DIR . 'class.' . $className . '.php';
}
// Locale
if (isset($_GET['locale'])) {
    if (WoW_Locale::IsLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']))) {
        WoW_Locale::SetLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']));
        if (isset($_SERVER['HTTP_REFERER'])) {
            header('Location: ' . $_SERVER['HTTP_REFERER']);
            exit;
        } else {
            WoW::RedirectTo();
            exit;
        }
    }
}
// Load locale
if (isset($_COOKIE['wow_locale'], $_COOKIE['wow_locale_id']) && WoW_Locale::IsLocale($_COOKIE['wow_locale'], $_COOKIE['wow_locale_id'])) {
    WoW_Locale::SetLocale($_COOKIE['wow_locale'], $_COOKIE['wow_locale_id']);
} else {
    WoW_Locale::SetLocale(WoWConfig::$DefaultLocale, WoWConfig::$DefaultLocaleID);
}
// Initialize debug log
WoW_Log::Initialize(WoWConfig::$UseLog, WoWConfig::$LogLevel);
if (isset($_GET['_DISPLAYVERSION_'])) {
    die(WOW_REVISION);
}
開發者ID:Kheros,項目名稱:wowhead,代碼行數:31,代碼來源:WoW_Loader.php


注:本文中的WoW::RedirectTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。