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


PHP WoW_Locale::IsLocale方法代碼示例

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


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

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

示例2: CatchOperations

 public static function CatchOperations(&$loaded)
 {
     // Perform log in (if required)
     if (isset($_GET['login']) || preg_match('/\\?login/', $_SERVER['REQUEST_URI'])) {
         // $_SERVER['REQUEST_URI'] check is required for mod_rewrited URL cases.
         header('Location: ' . WoW::GetWoWPath() . '/login/');
         exit;
     }
     // Perform logout (if required)
     if (isset($_GET['logout']) || preg_match('/\\?logout/', $_SERVER['REQUEST_URI'])) {
         // $_SERVER['REQUEST_URI'] check is required for mod_rewrited URL cases.
         WoW_Account::PerformLogout();
         header('Location: ' . WoW::GetWoWPath() . '/');
         exit;
     }
     // Locale
     if (isset($_GET['locale']) && !preg_match('/lookup/', $_SERVER['REQUEST_URI'])) {
         if (WoW_Locale::IsLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']))) {
             WoW_Locale::SetLocale($_GET['locale'], WoW_Locale::GetLocaleIDForLocale($_GET['locale']));
             $loaded = true;
             setcookie('wow_locale', WoW_Locale::GetLocale(), strtotime('NEXT YEAR'), '/');
             if (isset($_SERVER['HTTP_REFERER'])) {
                 header('Location: ' . $_SERVER['HTTP_REFERER']);
                 exit;
             } else {
                 header('Location: ' . WoW::GetWoWPath() . '/');
                 exit;
             }
         }
     }
 }
開發者ID:GetPlay,項目名稱:WorldOfWarCraft-WebSite,代碼行數:31,代碼來源:class.wow.php

示例3: SetPowerLocale

 protected static function SetPowerLocale()
 {
     if (strpos(WoW::GetRawPageAction(), '&pl')) {
         $data = explode('&', WoW::GetRawPageAction());
         foreach ($data as $it) {
             $tmp = explode('=', $it);
             if ($tmp[0] == 'pl') {
                 if (!$tmp[1] || !WoW_Locale::IsLocale($tmp[1], WoW_Locale::GetLocaleIDForLocale($tmp[1]))) {
                     $tmp[1] = 'enus';
                 }
                 WoW_Locale::SetLocale($tmp[1], WoW_Locale::GetLocaleIDForLocale($tmp[1]), true);
             }
         }
     }
 }
開發者ID:Kheros,項目名稱:wowhead,代碼行數:15,代碼來源:class.abstract.php

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