本文整理汇总了PHP中WoW_Locale::GetLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Locale::GetLocale方法的具体用法?PHP WoW_Locale::GetLocale怎么用?PHP WoW_Locale::GetLocale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoW_Locale
的用法示例。
在下文中一共展示了WoW_Locale::GetLocale方法的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: 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');
}
示例3: 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');
}
示例4: 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');
}
示例5: 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');
}
示例6: 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');
}
示例7: 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');
}
示例8: 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');
}
示例9: 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');
}
示例10: 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');
}
示例11: 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;
}
}
}
}
示例12: sprintf
" rel="np" class="icon-posts"> </a>
<a href="<?php
echo WoW::GetWoWPath();
?>
/wow/<?php
echo WoW_Locale::GetLocale();
?>
/vault/character/auction/horde/" title="<?php
echo WoW_Locale::GetString('template_browse_auction_caption');
?>
" rel="np" class="icon-auctions"> </a>
<a href="<?php
echo WoW::GetWoWPath();
?>
/wow/<?php
echo WoW_Locale::GetLocale();
?>
/vault/character/event" title="<?php
echo WoW_Locale::GetString('template_browse_events_caption');
?>
" rel="np" class="icon-events link-last"> </a>
</div>
</div>
<div class="character-list">
<div class="primary chars-pane">
<div class="char-wrapper">
<?php
echo sprintf('<a href="javascript:;"
class="char pinned"
rel="np">
<span class="pin"></span>
示例13: date
?>
';
var wowheadFullUrl = '<?php
echo WoW::GetUrl();
?>
';
var wowheadDomain = '<?php
echo WoW::GetDomain();
?>
';
var currentPage = '<?php
echo WoW::GetCurrentPageUrl();
?>
';
var wowheadLocale = '<?php
echo WoW_Locale::GetLocale(LOCALE_SPLIT);
?>
';
var wowheadLocaleID = <?php
echo WoW_Locale::GetLocaleID();
?>
;
</script>
<script type="text/javascript">//<![CDATA[
$.extend(window, {g_staticUrl: '<?php
echo WoW::GetStaticUrl();
?>
', g_serverTime: new Date('<?php
echo date('Y/m/d H:i:s');
?>
示例14: LoadItem
public function LoadItem($item_entry, $itemGuid = 0, $ownerGuid = 0)
{
$item_row = DB::World()->selectRow("\n SELECT\n `a`.*,\n %s\n `b`.`icon`,\n `d`.`patch`\n FROM `item_template` AS `a`\n LEFT JOIN `DBPREFIX_icons` AS `b` ON `b`.`displayid` = `a`.`displayid`\n LEFT JOIN `locales_item` AS `c` ON `c`.`entry` = `a`.`entry`\n LEFT JOIN `DBPREFIX_item_version` AS `d` ON `d`.`entry` = `a`.`entry`\n WHERE `a`.`entry` = %d LIMIT 1", WoW_Locale::GetLocaleID() > 0 ? sprintf('`c`.`name_loc%d` AS `name_loc`, `c`.`description_loc%d` AS `desc_loc`,', WoW_Locale::GetLocaleID(), WoW_Locale::GetLocaleID()) : null, $item_entry);
if (!$item_row) {
WoW_Log::WriteError('%s : item #%d (GUID: %d) was not found in `item_template` table.', __METHOD__, $item_entry, $itemGuid);
return false;
}
// FlagsExtra check
if (isset($item_row['FlagsExtra'])) {
$item_row['Flags2'] = $item_row['FlagsExtra'];
unset($item_row['FlagsExtra']);
// For compatibility
}
// Assign variables
foreach ($item_row as $field => $value) {
$this->{$field} = $value;
}
// Create arrays
// Item mods
for ($i = 0; $i < MAX_ITEM_PROTO_STATS + 1; $i++) {
$key = $i + 1;
if (isset($this->{'stat_type' . $key})) {
$this->ItemStat[$i] = array('type' => $this->{'stat_type' . $key}, 'value' => $this->{'stat_value' . $key});
}
}
// Item damages
for ($i = 0; $i < MAX_ITEM_PROTO_DAMAGES + 1; $i++) {
$key = $i + 1;
if (isset($this->{'dmg_type' . $key})) {
$this->Damage[$i] = array('type' => $this->{'dmg_type' . $key}, 'min' => $this->{'dmg_min' . $key}, 'max' => $this->{'dmg_max' . $key});
}
}
// Item spells
for ($i = 0; $i < MAX_ITEM_PROTO_SPELLS + 1; $i++) {
$key = $i + 1;
if (isset($this->{'spellid_' . $key})) {
$this->Spells[$i] = array('spellid' => $this->{'spellid_' . $key}, 'trigger' => $this->{'spelltrigger_' . $key}, 'charges' => $this->{'spellcharges_' . $key}, 'ppmRate' => $this->{'spellppmRate_' . $key}, 'cooldown' => $this->{'spellcooldown_' . $key}, 'category' => $this->{'spellcategory_' . $key}, 'categorycooldown' => $this->{'spellcategorycooldown_' . $key});
}
}
// Item sockets
for ($i = 0; $i < MAX_ITEM_PROTO_SOCKETS + 1; $i++) {
$key = $i + 1;
if (isset($this->{'socketColor_' . $key})) {
$this->Socket[$i] = array('color' => $this->{'socketColor_' . $key}, 'content' => $this->{'socketContent_' . $key}, 'filter' => 0, 'name' => '');
switch ($this->Socket[$i]['color']) {
case 1:
$this->Socket[$i]['filter'] = $this->Socket[$i]['color'];
$this->Socket[$i]['name'] = 'meta';
case 2:
$this->Socket[$i]['filter'] = $this->Socket[$i]['color'];
$this->Socket[$i]['name'] = 'red';
break;
case 4:
$this->Socket[$i]['filter'] = 3;
$this->Socket[$i]['name'] = 'yellow';
break;
case 8:
$this->Socket[$i]['filter'] = 4;
$this->Socket[$i]['name'] = 'blue';
break;
}
}
}
// Set locale
if (WoW_Locale::GetLocaleID() != LOCALE_EN) {
$this->name = $this->name_loc != null ? $this->name_loc : $this->name;
$this->description = $this->desc_loc != null ? $this->desc_loc : $this->description;
}
// Data to template class
WoW_Template::SetPageData('item_name', $this->name);
// Set class/subclass/inventory type names
$itemsubclass = DB::World()->selectRow("SELECT `subclass_name_%s` AS `subclass`, `class_name_%s` AS `class` FROM `DBPREFIX_item_subclass` WHERE `subclass` = %d AND `class` = %d LIMIT 1", WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), $this->subclass, $this->class);
if (is_array($itemsubclass)) {
$this->subclass_name = $itemsubclass['subclass'];
$this->class_name = $itemsubclass['class'];
}
if (in_array($this->class, array(ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON))) {
$this->InventoryType_name = $this->InventoryType > 0 ? WoW_Locale::GetString('template_item_invtype_' . $this->InventoryType) : null;
}
// Faction
if ($this->Flags2 & ITEM_FLAGS2_HORDE_ONLY) {
$this->faction = FACTION_HORDE;
$this->faction_convert = DB::World()->selectCell("SELECT `item_alliance` FROM `DBPREFIX_item_equivalents` WHERE `item_horde` = %d", $this->entry);
} elseif ($this->Flags2 & ITEM_FLAGS2_ALLIANCE_ONLY) {
$this->faction = FACTION_ALLIANCE;
$this->faction_convert = DB::World()->selectCell("SELECT `item_horde` FROM `DBPREFIX_item_equivalents` WHERE `item_alliance` = %d", $this->entry);
}
// GUIDs
$this->m_guid = $itemGuid;
// Can be NULL.
$this->m_owner = $ownerGuid;
// Can be NULL.
$this->loaded = true;
return true;
}
示例15: foreach
<div id="left-results">
<?php
$searchResults = WoW_Search::GetSearchResults('wowguild');
if (is_array($searchResults)) {
foreach ($searchResults as $guild) {
echo sprintf('
<div class="search-result">
<div class="">
<div class="result-title">
<a href="%s/wow/%s/guild/%s/%s/" class="search-title"><%s></a>
</div>
<div class="search-content">
<div class="info">%s / %s</div>
</div>
<div class="search-results-url"> /wow/guild/%s/%s/</div>
</div>
<div class="clear"></div>
</div>', WoW::GetWoWPath(), WoW_Locale::GetLocale(), $guild['realmName'], $guild['name'], $guild['name'], $guild['realmName'], WoW_Locale::GetString(WoW_Utils::GetFactionId($guild['raceId']) == FACTION_ALLIANCE ? 'faction_alliance' : 'faction_horde'), $guild['realmName'], $guild['name']);
}
}
?>
</div>