当前位置: 首页>>代码示例>>PHP>>正文


PHP WoW_Locale::GetLocaleID方法代码示例

本文整理汇总了PHP中WoW_Locale::GetLocaleID方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Locale::GetLocaleID方法的具体用法?PHP WoW_Locale::GetLocaleID怎么用?PHP WoW_Locale::GetLocaleID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WoW_Locale的用法示例。


在下文中一共展示了WoW_Locale::GetLocaleID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: PerformItemsSearch

 private static function PerformItemsSearch()
 {
     if (!isset(self::$m_results['items'])) {
         self::$m_results['items'] = array();
     }
     // Find item IDs
     $items = DB::World()->select("\n        SELECT\n        `a`.`entry`\n        FROM `%s` AS `a`\n        WHERE %s LIKE '%s' LIMIT 200", WoW_Locale::GetLocaleID() != LOCALE_EN ? 'locales_item' : 'item_template', WoW_Locale::GetLocaleID() != LOCALE_EN ? '`a`.`name_loc' . WoW_Locale::GetLocaleID() . '`' : '`a`.`name`', '%' . self::$m_query . '%');
     if (!$items) {
         return;
     }
     $item_id = array();
     foreach ($items as $item) {
         // Generate IDs array
         $item_id[] = $item['entry'];
     }
     // Request items
     self::$m_results['items'] = WoW_Items::GetExtendedItemInfo($item_id);
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:18,代码来源:class.search.php

示例2: GetRandomTitle

 private static function GetRandomTitle()
 {
     $title = DB::World()->selectRow("SELECT `title_en` AS `originalTitle`%s FROM `DBPREFIX_site_titles` ORDER BY RAND() LIMIT 1", WoW_Locale::GetLocaleID() == LOCALE_EN ? null : sprintf(', `title_%s` AS `localizedTitle`', WoW_Locale::GetLocale()));
     if (!$title) {
         return false;
     }
     if (isset($title['localizedTitle']) && $title['localizedTitle'] != '') {
         return $title['localizedTitle'];
     }
     return $title['originalTitle'];
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:11,代码来源:class.template.php

示例3: PerformItemsSearch

 public static function PerformItemsSearch($limit = 0)
 {
     if (!self::$searchQuery) {
         return false;
     }
     $ph = '%%%s%%';
     if (WoW_Locale::GetLocaleID() > 0) {
         $sql_query = sprintf("SELECT\n            `item_template`.`entry`,\n            `item_template`.`ItemLevel`,\n            `item_template`.`class`,\n            `item_template`.`subclass`,\n            `item_template`.`InventoryType`,\n            `item_template`.`Quality`,\n            `item_template`.`displayid`,\n            `item_template`.`RequiredLevel`,\n            `item_template`.`SellPrice`,\n            `item_template`.`bonding`,\n            `locales_item`.`name_loc%d` AS `name`,\n            `locales_item`.`description_loc%d` AS `description`\n            FROM `item_template`\n            JOIN `locales_item` ON `locales_item`.`entry` = `item_template`.`entry`\n            WHERE\n            (\n                `locales_item`.`name_loc%d` LIKE '%s'\n                OR\n                `locales_item`.`description_loc%d` LIKE '%s'\n            )\n            ORDER BY `item_template`.`Quality` DESC, `item_template`.`ItemLevel` DESC\n            %s", WoW_Locale::GetLocaleID(), WoW_Locale::GetLocaleID(), WoW_Locale::GetLocaleID(), $ph, WoW_Locale::GetLocaleID(), $ph, $limit > 0 ? ' LIMIT ' . $limit : null);
     } else {
         $sql_query = "SELECT `entry`, `name`, `ItemLevel`, `class`, `subclass`, `InventoryType`, `Quality`, `displayid`, `RequiredLevel`, `SellPrice`, `bonding`, `description`\n            FROM `item_template`\n            WHERE\n            (\n                `name` LIKE '%%%s%%'\n                OR\n                `description` LIKE '%%%s%%'\n            )\n            ORDER BY `Quality` DESC, `ItemLevel` DESC";
         if ($limit > 0) {
             $sql_query .= ' LIMIT ' . $limit;
         }
     }
     $results = DB::World()->select($sql_query, self::GetSearchQuery(), self::GetSearchQuery());
     return self::SetSearchResults('wowitem', $results);
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:17,代码来源:class.search.php

示例4: GetItemSourceFromdDB

 private function GetItemSourceFromdDB($item_entry)
 {
     if ($item_entry <= 0) {
         WoW_Log::WriteError('%s : entry must be > than 0 (%d given)!', __METHOD__, $item_entry);
         return false;
     }
     $source_info = DB::WoW()->selectRow("SELECT `source`, `areaKey`, `areaUrl`, `isHeroic` FROM `DBPREFIX_source` WHERE `item` = %d", $item_entry);
     if (!$source_info) {
         WoW_Log::WriteError('%s : item #%d was not found in DBPREFIX_source table!', __METHOD__, $item_entry);
         return false;
     }
     // Parse
     switch ($source_info['source']) {
         default:
             return;
         case 'sourceType.dungeon':
             if ($source_info['areaKey'] == '') {
                 return false;
             }
             $boss_entry = DB::World()->selectCell("SELECT `entry` FROM `creature_loot_template` WHERE `item` = %d", $item_entry);
             if ($boss_entry > 0) {
                 $name = DB::World()->selectCell("SELECT `name` FROM `creature_template` WHERE `entry` = %d", $boss_entry);
                 if (WoW_Locale::GetLocale() != LOCALE_EN) {
                     $name_loc = DB::World()->selectCell("SELECT `name_loc%d` FROM `locales_creature` WHERE `entry` = %d", WoW_Locale::GetLocaleID(), $boss_entry);
                     return $name_loc ? $name_loc : $name;
                 }
                 return $name;
             }
             break;
     }
     return false;
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:32,代码来源:class.items.php

示例5: LoadItem

 public function LoadItem($item_entry, $itemGuid = 0, $ownerGuid = 0)
 {
     $item_row = DB::World()->selectRow("SELECT * FROM `item_template` WHERE `entry` = '%d' LIMIT 1", $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});
         }
     }
     $this->icon = DB::Wow()->selectCell("SELECT `icon` FROM `DBPREFIX_icons` WHERE `displayid` = %d LIMIT 1", $this->displayid);
     if (WoW_Locale::GetLocale() != 'en') {
         $newname = DB::World()->selectRow("SELECT `name_loc%d` AS `name`, `description_loc%d` AS `desc` FROM `locales_item` WHERE `entry` = %d", WoW_Locale::GetLocaleID(), WoW_Locale::GetLocaleID(), $this->entry);
         if ($newname) {
             $this->name = $newname['name'];
             $this->description = $newname['desc'];
         }
     }
     $itemsublcass = DB::Wow()->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);
     $this->subclass_name = $itemsublcass['subclass'];
     $this->class_name = $itemsublcass['class'];
     $this->m_guid = $itemGuid;
     // Can be NULL.
     $this->m_owner = $ownerGuid;
     // Can be NULL.
     $this->loaded = true;
     return true;
 }
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:64,代码来源:class.itemprototype.php

示例6: AchievementCategory

 public static function AchievementCategory($category)
 {
     $achievement_category = array();
     $achievements = DB::WoW()->select("SELECT `id`, `name_%s` AS `name`, `description_%s` AS `desc`, `categoryId`, `points`, `iconname`, `titleReward_%s` AS `titleReward` FROM `DBPREFIX_achievement` WHERE `categoryId` = %d AND `factionFlag` <> %d", WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), $category, WoW_Characters::GetFactionID());
     if (!$achievements) {
         WoW_Log::WriteError('%s : unable to find any achievement in %d category!', __METHOD__, $category);
         return false;
     }
     $current_category = $category;
     $skip = array();
     foreach ($achievements as $ach) {
         $skip = array_merge($skip, self::IsAchievementHasChildAchievementCompleted($ach['id'], $current_category));
         if (self::IsAchievementCompleted($ach['id'], $current_category)) {
             $ach['dateCompleted'] = self::GetAchievementDate($ach['id']);
         }
         // Find criterias
         $ach['criterias'] = self::BuildCriteriasList($ach['id']);
         // If we have reward...
         if ($ach['titleReward'] != null) {
             // ... let's check if it's an item
             $reward_item = DB::World()->selectCell("SELECT `item` FROM `achievement_reward` WHERE `entry` = %d", $ach['id']);
             if ($reward_item > 0) {
                 // Find item
                 if (WoW_Locale::GetLocaleID() > 0) {
                     $item = DB::World()->selectRow("SELECT `item_template`.`entry`,  `item_template`.`Quality`, `locales_item`.`name_loc%d` AS `name` FROM `item_template` JOIN `locales_item` ON `locales_item`.`entry` = `item_template`.`entry` WHERE `item_template`.`entry` = %d LIMIT 1", WoW_Locale::GetLocaleID(), $reward_item);
                 } else {
                     $item = DB::World()->selectRow("SELECT `entry`, `name`, `Quality` FROM `item_template` WHERE `entry` = %d LIMIT 1", $reward_item);
                 }
                 if (is_array($item)) {
                     // Assign data
                     $ach['reward_item'] = $item;
                 }
             }
         }
         $achievement_category[] = $ach;
     }
     // Sort all categories (completed - up, incompleted - down)
     $tmp_compl = array();
     $tmp_incompl = array();
     $last_compl = 0;
     $last_incompl = 0;
     foreach ($achievement_category as $ach) {
         if (isset($ach['dateCompleted'])) {
             $tmp_compl[$last_compl] = $ach;
             $last_compl++;
         } else {
             $tmp_incompl[$last_incompl] = $ach;
             $last_incompl++;
         }
         for ($i = 0; $i < $last_compl; $i++) {
             $date = $tmp_compl[$i]['dateCompleted'];
             for ($j = 0; $j < $last_compl; $j++) {
                 if ($tmp_compl[$j]['dateCompleted'] < $date) {
                     $tmpach = $tmp_compl[$i];
                     $tmp_compl[$i] = $tmp_compl[$j];
                     $tmp_compl[$j] = $tmpach;
                 }
             }
         }
     }
     $achievement_category = $category == 81 ? $tmp_compl : array_merge($tmp_compl, $tmp_incompl);
     $count = count($achievement_category);
     for ($i = 0; $i < $count; ++$i) {
         $id = $achievement_category[$i]['id'];
         if (in_array($id, $skip)) {
             if (self::IsAchievementCompleted($id)) {
                 $chain = self::GenerateAchievementChain($id, $category);
                 if (is_array($chain)) {
                     $points = 0;
                     $count_chain = count($chain);
                     $changed = false;
                     $last_id = 0;
                     for ($j = 0; $j < $count_chain; ++$j) {
                         if ($chain[$j]['completed'] == 1) {
                             $points += $chain[$j]['points'];
                             $last_id = $chain[$j]['current'];
                         } else {
                             if (isset($chain[$j - 1]) && $chain[$j - 1]['completed'] == 1) {
                                 $changed = self::AssignNewDataToAchievementsInCategory($points, $chain[$j - 1]['current'], $achievement_category, $chain);
                             }
                         }
                     }
                     if (!$changed) {
                         self::AssignNewDataToAchievementsInCategory($points, $last_id, $achievement_category, $chain);
                     }
                 }
             }
             unset($achievement_category[$i]);
         }
     }
     return $achievement_category;
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:92,代码来源:class.achievements.php

示例7: __construct

 /**
  * Class constructor, defines locale and inits storage
  **/
 public function __construct()
 {
     $this->m_locale = WoW_Locale::GetLocale();
     $this->m_dbLocale = WoW_Locale::GetLocaleID();
     $this->InitStorage();
     return true;
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:10,代码来源:class.dbstorage.php

示例8: 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;
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:95,代码来源:class.itemprototype.php

示例9: sprintf

<script type="text/javascript">//<![CDATA[
<?php 
if (WoW_Locale::GetLocaleID() > 0) {
    echo sprintf('Locale.set(%d);', WoW_Locale::GetLocaleID());
}
?>

PageTemplate.set({pageName: '<?php 
echo WoW_Template::GetPageIndex();
?>
', activeTab: <?php 
echo WoW_Template::GetPageData('activeTab');
echo WoW_Template::GetPageData('disable_breadcrumb') != true ? ', breadcrumb: [' . WoW_Template::GetPageData('breadcrumb') . ']' : null;
?>
});
PageTemplate.init();
g_captchaType = 1;g_dataKey = '60770694807121612389db4ad8f344000d5cab78';g_host = 'http://www01.wowhead.com';
//]]></script>
开发者ID:Kheros,项目名称:wowhead,代码行数:18,代码来源:wowhead_block_set_page_template.php

示例10:

echo WoW_Locale::GetLocale(LOCALE_DOUBLE);
?>
" onclick="WowLanding.regionMenu.hide();">
	<div class="positionWrapper">
		<div class="relative">
			<div class="page">
	<div class="leftColumn">
		<div class="flash-trailer">

			<div id="trailer"></div>
			<script type="text/javascript">

				var params = { allowScriptAccess: "always", wmode: "transparent", allowFullScreen: "true" };
				var atts = { id: "trailer" };
				swfobject.embedSWF('http://www.youtube.com/v/<?php 
echo WoW_Locale::GetLocaleID() == LOCALE_RU ? 'tp-utWVDpIQ' : 'Wq4Y7ztznKc';
?>
?enablejsapi=1&amp;amp;playerapiid=finalunlocked-video&amp;amp;fs=1&amp;amp;hd=1', "trailer", "432", "216", "8", null, null, params, atts);
                
			</script>
			<div class="cataclysm-logo"></div>
		</div>

		<span class="new-age"></span>

        <div class="gameWorld"><!-- --></div>
		<a class="watchCinematic" href="https://eu.battle.net/account/activation/landing.html?product=CAT" onclick="window.open(this.href); return false;">
			<img class="blank" src="/account/images/layout/blank.gif" alt="<?php 
echo WoW_Locale::GetString('template_account_wow_cata_cinematic');
?>
" />
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:31,代码来源:account_creation_wow.php

示例11: switch

<span class="label-text">
<?php 
echo WoW_Locale::GetString('template_account_creation_select_country');
?>
</span>
<span class="input-required"></span>
</label>
</span>
<span class="input-right">
<span class="input-select input-select-small">
<select name="country" id="country" class="small border-5 glow-shadow-2" tabindex="1">
<?php 
if (isset($_GET['country']) && in_array(strtoupper($_GET['country']), array('GBR', 'USA', 'FRA', 'DEU', 'ESP', 'RUS'))) {
    $selected_country = $_GET['country'];
} else {
    switch (WoW_Locale::GetLocaleID()) {
        case LOCALE_DE:
            $selected_country = 'DEU';
            break;
        case LOCALE_EN:
            $selected_country = 'GBR';
            break;
        case LOCALE_ES:
            $selected_country = 'ESP';
            break;
        case LOCALE_FR:
            $selected_country = 'FRA';
            break;
        case LOCALE_RU:
            $selected_country = 'RUS';
            break;
开发者ID:JunkyBulgaria,项目名称:WoWCS,代码行数:31,代码来源:account_content_creation_tos.php

示例12: HandleChosenTitleInfo

 private static function HandleChosenTitleInfo()
 {
     if (!self::IsCorrect()) {
         WoW_Log::WriteError('%s : character was not found.', __METHOD__);
         return false;
     }
     $title_data = DB::WoW()->selectRow("SELECT `title_F_%s` AS `titleF`, `title_M_%s` AS `titleM`, `place` FROM `DBPREFIX_titles` WHERE `id`=%d", WoW_Locale::GetLocale(), WoW_Locale::GetLocale(), self::$chosenTitle);
     if (!$title_data) {
         WoW_Log::WriteError('%s: character %s (GUID: %d) has wrong chosenTitle ID (%d) or there is no data for %s locale (locId: %d)', __METHOD__, self::$name, self::$guid, self::$chosenTitle, WoW_Locale::GetLocale(), WoW_Locale::GetLocaleID());
         return false;
     }
     self::$title_info['place'] = $title_data['place'];
     switch (self::$gender) {
         case GENDER_MALE:
             self::$title_info['title'] = $title_data['titleM'];
             break;
         case GENDER_FEMALE:
             self::$title_info['title'] = $title_data['titleF'];
             break;
     }
     return true;
 }
开发者ID:GetPlay,项目名称:WorldOfWarCraft-WebSite,代码行数:22,代码来源:class.characters.php

示例13: foreach

$.extend(true, g_items, _);
_ = g_items;
_[<?php 
echo $proto->entry;
?>
].tooltip_enus = '<?php 
echo $proto->tooltip;
?>
';
<?php 
$vendors = WoW_Items::GetVendorsSource();
if (is_array($vendors)) {
    foreach ($vendors as $vendor) {
        if (isset($vendor['ext_cost_items']) && is_array($vendor['ext_cost_items'])) {
            foreach ($vendor['ext_cost_items'] as $item) {
                echo sprintf('_[%d]={name_enus:\'%d\',icon:[\'%s\',\'%s\']};', $item['entry'], WoW_Locale::GetLocaleID() != LOCALE_EN && isset($item['name_loc']) && $item['name_loc'] != null ? $item['name_loc'] : $item['name'], $item['icon'], $item['icon']);
            }
        }
    }
}
?>
//_[395]={name_enus:'Очки справедливости',icon:['pvecurrency-justice','pvecurrency-justice']};
//_[241]={name_enus:'Печать чемпиона',icon:['ability_paladin_artofwar','ability_paladin_artofwar']};
$.extend(true, g_gatheredcurrencies, _);
<?php 
$achievementsCriteria = WoW_Items::GetAchievementsCriteria();
if (is_array($achievementsCriteria)) {
    echo 'var _ = {};';
    foreach ($achievementsCriteria as $achievement) {
        echo sprintf('_[%d]={name_enus:\'%s\',icon:\'%s\'};', $achievement['id'], str_replace("'", "\\'", $achievement['name']), str_replace("'", "\\'", $achievement['icon']));
    }
开发者ID:Kheros,项目名称:wowhead,代码行数:31,代码来源:wowhead_content_item.php

示例14: GetNPCInfo

 public static function GetNPCInfo($entry, $type)
 {
     if (!DB::World()->selectCell("SELECT 1 FROM creature_template WHERE entry = %d", $entry)) {
         return false;
     }
     switch ($type) {
         case 'name':
             if (WoW_Locale::GetLocaleID() == LOCALE_EN) {
                 return DB::World()->selectCell("SELECT name FROM creature_template WHERE entry = %d", $entry);
             }
             $data = DB::World()->selectRow("\n                SELECT\n                a.name,\n                b.name_loc%d AS name_loc\n                FROM creature_template AS a\n                LEFT JOIN locales_creature AS b ON b.entry = a.entry\n                WHERE a.entry = %d", WoW_Locale::GetLocaleID(), $entry);
             if (!$data) {
                 return DB::World()->selectCell("SELECT name FROM creature_template WHERE entry = %d", $entry);
             }
             if ($data['name_loc'] != null) {
                 return $data['name_loc'];
             }
             return $data['name'];
             break;
     }
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:21,代码来源:class.npcs.php

示例15: InitData

 private static function InitData()
 {
     WoW_Template::SetPageIndex('data');
     $js_contents = null;
     switch (self::GetPageAction()) {
         case 'spell-scaling':
         case 'item-scaling':
         case 'realms.weight-presets':
         case 'user':
             $js_contents = file_get_contents('data/' . self::GetPageAction() . '.js');
             break;
             // Locale-depended files
         // Locale-depended files
         case 'weight-presets.zones':
         case 'zones':
         case 'glyphs':
             $js_contents = file_get_contents('data/' . self::GetPageAction() . '-' . WoW_Locale::GetLocaleID() . '.js');
             break;
         case 'talents':
             $class_id = isset($_GET['class']) ? (int) $_GET['class'] : 6;
             $js_contents = file_get_contents('data/talents-' . $class_id . '-' . WoW_Locale::GetLocaleID() . '.js');
             break;
     }
     WoW_Template::SetPageData('js-data', $js_contents);
     // Must be freed after using!
 }
开发者ID:Kheros,项目名称:wowhead,代码行数:26,代码来源:class.wow.php


注:本文中的WoW_Locale::GetLocaleID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。