本文整理汇总了PHP中WoW_Locale::GetLocaleId方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Locale::GetLocaleId方法的具体用法?PHP WoW_Locale::GetLocaleId怎么用?PHP WoW_Locale::GetLocaleId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoW_Locale
的用法示例。
在下文中一共展示了WoW_Locale::GetLocaleId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: HandleSellingItems
private static function HandleSellingItems()
{
if (self::$selling_count <= 0 || !is_array(self::$myitems_storage)) {
return false;
}
$item_ids = array();
$item_ids_guids = array();
$items_data = array();
foreach (self::$myitems_storage as $item) {
$item_ids[] = $item['item_template'];
$item_ids_guids[$item['itemguid']] = $item['item_template'];
$items_data[$item['itemguid']] = $item;
}
$items = DB::World()->select("SELECT `entry`, `name`, `Quality`, `displayid` FROM `item_template` WHERE `entry` IN (%s)", $item_ids);
if (!$items) {
return false;
}
$items_storage = array();
$displayids = array();
foreach ($items as $item) {
$items_storage[$item['entry']] = $item;
$displayids[] = $item['displayid'];
}
$icons = DB::WoW()->select("SELECT `displayid`, `icon` FROM `DBPREFIX_icons` WHERE `displayid` IN (%s)", $displayids);
if (!$icons) {
return false;
}
$icons_storage = array();
foreach ($icons as $icon) {
$icons_storage[$icon['displayid']] = $icon['icon'];
}
unset($icons);
self::$items_storage = array();
self::$buyout_price = 0;
foreach ($item_ids_guids as $item_guid => $item_id) {
if (isset($items_storage[$item_id])) {
$item = new WoW_Item(WoWConfig::$Realms[WoW_Account::GetActiveCharacterInfo('realmId')]['type']);
$item->LoadFromDBByEntry($item_guid, $item_id);
$auc_time = $items_data[$item_guid]['time'];
$now = time();
$auction_time = 0;
if ($now - $auc_time <= 48 * IN_HOURS) {
$auction_time = 3;
} elseif ($now - $auc_time <= 24 * IN_HOURS) {
$auction_time = 2;
} elseif ($now - $auc_time <= 12 * IN_HOURS) {
$auction_time = 1;
}
self::$items_storage[] = array('auction_id' => $items_data[$item_guid]['id'], 'guid' => $item_guid, 'id' => $items_storage[$item_id]['entry'], 'quality' => $items_storage[$item_id]['Quality'], 'name' => WoW_Locale::GetLocaleId() == LOCALE_EN ? $items_storage[$item_id]['name'] : WoW_Items::GetItemName($item_id), 'icon' => $icons_storage[$items_storage[$item_id]['displayid']], 'price_raw' => $items_data[$item_guid]['startbid'], 'price' => WoW_Utils::GetMoneyFormat($items_data[$item_guid]['startbid']), 'buyout_raw' => $items_data[$item_guid]['buyoutprice'], 'buyout' => WoW_Utils::GetMoneyFormat($items_data[$item_guid]['buyoutprice']), 'lastbid' => $items_data[$item_guid]['lastbid'], 'count' => $item->GetStackCount(), 'time' => $auction_time);
self::$buyout_price += $items_data[$item_guid]['buyoutprice'];
}
}
unset($items, $items_storage, $displayids);
return true;
}
示例2: FindItemSourceInfo
public function FindItemSourceInfo($entry, $type)
{
$source_info = false;
switch ($type) {
case 'sourceType.questReward':
$source_info = DB::World()->selectRow("\n SELECT\n `a`.`entry` AS `questId`,\n `a`.`Title`,\n `a`.`ZoneOrSort` AS `questZone`,\n %s\n FROM `quest_template` AS `a`\n %s\n WHERE\n `a`.`RewChoiceItemId1` = %d OR `a`.`RewChoiceItemId2` = %d OR `a`.`RewChoiceItemId3` = %d OR `a`.`RewChoiceItemId4` = %d OR `a`.`RewChoiceItemId5` = %d OR `a`.`RewChoiceItemId6` = %d OR\n `a`.`RewItemId1` = %d OR `a`.`RewItemId2` = %d OR `a`.`RewItemId3` = %d OR `a`.`RewItemId4` = %d\n LIMIT 1", WoW_Locale::GetLocale() != LOCALE_EN ? '`b`.`Title_loc' . WoW_Locale::GetLocaleId() . '` AS `Title_Loc`' : 'NULL', WoW_Locale::GetLocale() != LOCALE_EN ? 'LEFT JOIN `locale_quest` AS `b` ON `b`.`entry` = `a`.`entry`' : null, $entry, $entry, $entry, $entry, $entry, $entry, $entry, $entry, $entry, $entry);
if (!$source_info) {
return false;
}
if (WoW_Locale::GetLocale() != LOCALE_EN && $source_info['Title_Loc'] != null) {
$source_info['Title'] = $source_info['Title_Loc'];
}
break;
case 'sourceType.creatureDrop':
$source_info = DB::World()->selectRow("\n SELECT\n `a`.`entry` AS `npcId`,\n `b`.`name`,\n %s\n FROM\n LEFT JOIN `creature_template` AS `b` ON `b`.`entry` = `a`.`entry`\n %s\n WHERE\n `b`.`item` = %d\n LIMIT 1", WoW_Locale::GetLocale() != LOCALE_EN ? '`c`.`name_loc`' . WoW_Locale::GetLocaleId() . '` AS `name_loc`' : 'NULL', WoW_Locale::GetLocale() != LOCALE_EN ? 'LEFT JOIN `locale_creature` AS `c` ON `c`.`entry` = `a`.`entry`' : null, $entry);
if ($source_info && WoW_Locale::GetLocale() != LOCALE_EN && $source_info['name_loc'] != null) {
$source_info['name'] = $source_info['name_loc'];
}
break;
case 'sourceType.vendor':
break;
}
$source_info['type'] = $type;
return $source_info;
}