本文整理汇总了PHP中WoW_Locale::GetString方法的典型用法代码示例。如果您正苦于以下问题:PHP WoW_Locale::GetString方法的具体用法?PHP WoW_Locale::GetString怎么用?PHP WoW_Locale::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoW_Locale
的用法示例。
在下文中一共展示了WoW_Locale::GetString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PerformConversionStep
/**
* Performs account conversion (merging) step
*
* @access public
* @static WoW_Account::PerformConversionStep($step, $post_data = false)
* @param int $step
* @param array $post_data = false
* @category Account Manager Class
* @return bool
**/
public static function PerformConversionStep($step, $post_data = false)
{
switch ($step) {
case 1:
// Find account in realm DB and check passwords matching
if (!is_array($post_data)) {
// Wrong post data
WoW_Template::SetPageData('conversion_error', true);
WoW_Template::SetPageData('account_creation_error_msg', WoW_Locale::GetString('template_account_conversion_error1'));
return false;
}
$info = DB::Realm()->selectRow("SELECT `id`, `sha_pass_hash` FROM `account` WHERE `username` = '%s' LIMIT 1", $post_data['username']);
$sha = sha1(strtoupper($post_data['username']) . ':' . strtoupper($post_data['password']));
if (!$info || $info['sha_pass_hash'] != $sha) {
// Wrong post data
WoW_Template::SetPageData('conversion_error', true);
WoW_Template::SetPageData('account_creation_error_msg', WoW_Locale::GetString('template_account_conversion_error1'));
return false;
}
// Check account link
if (DB::WoW()->selectCell("SELECT 1 FROM `DBPREFIX_users_accounts` WHERE `account_id` = %d", $info['id'])) {
// Already linked
WoW_Template::SetPageData('conversion_error', true);
WoW_Template::SetPageData('account_creation_error_msg', WoW_Locale::GetString('template_account_conversion_error2'));
return false;
}
// All fine
$_SESSION['conversion_userName'] = $post_data['username'];
$_SESSION['conversion_userID'] = $info['id'];
break;
case 3:
// Check session
$conversion_allowed = true;
if (!isset($_SESSION['conversion_userName']) || !isset($_SESSION['conversion_userID'])) {
$conversion_allowed = false;
} else {
if ($_SESSION['conversion_userName'] == null) {
$conversion_allowed = false;
}
if ($_SESSION['conversion_userID'] == 0) {
$conversion_allowed = false;
}
}
if (!$conversion_allowed) {
header('Location: ' . WoW::GetWoWPath() . '/account/management/wow-account-conversion.html');
exit;
}
// Link account
if (DB::WoW()->query("INSERT INTO `DBPREFIX_users_accounts` VALUES (%d, %d)", self::GetUserID(), (int) $_SESSION['conversion_userID'])) {
header('Location: ' . WoW::GetWoWPath() . '/account/management/wow/dashboard.html?accountName=' . $_SESSION['conversion_userName'] . '®ion=EU');
exit;
}
break;
default:
return false;
}
return true;
}
示例2: GetRealmStatus
public static function GetRealmStatus($realmID = false)
{
if ($realmID === false) {
$realmList = DB::Realm()->select("SELECT `id`, `name`, `address`, `port`, `icon`, `timezone` FROM `realmlist`");
} else {
if (!WoWConfig::$UseRealmsStatus) {
return false;
}
if (isset(self::$realmsStatusCache[$realmID])) {
return self::$realmsStatusCache[$realmID];
}
$realmList[] = DB::Realm()->selectRow("SELECT `id`, `name`, `address`, `port`, `icon`, `timezone` FROM `realmlist` WHERE `id` = %d", $realmID);
}
if (!$realmList) {
return false;
}
$size = count($realmList);
for ($i = 0; $i < $size; ++$i) {
$errNo = 0;
$errStr = 0;
$realmList[$i]['status'] = @fsockopen($realmList[$i]['address'], $realmList[$i]['port'], $errNo, $errStr, 1) ? 'up' : 'down';
switch ($realmList[$i]['icon']) {
default:
case 0:
case 4:
$realmList[$i]['type'] = 'PvE';
break;
case 1:
$realmList[$i]['type'] = 'PvP';
break;
case 6:
$realmList[$i]['type'] = WoW_Locale::GetString('template_realm_status_type_roleplay');
break;
case 8:
$realmList[$i]['type'] = WoW_Locale::GetString('template_realm_status_type_rppvp');
break;
}
switch ($realmList[$i]['timezone']) {
default:
$realmList[$i]['language'] = 'Development Realm';
break;
case 8:
$realmList[$i]['language'] = WoW_Locale::GetString('template_locale_en');
break;
case 9:
$realmList[$i]['language'] = WoW_Locale::GetString('template_locale_de');
break;
case 10:
$realmList[$i]['language'] = WoW_Locale::GetString('template_locale_fr');
break;
case 11:
$realmList[$i]['language'] = WoW_Locale::GetString('template_locale_es');
break;
case 12:
$realmList[$i]['language'] = WoW_Locale::GetString('template_locale_ru');
break;
}
self::$realmsStatusCache[$realmList[$i]['id']] = $realmList[$i];
}
return $realmList;
}
示例3:
</div>
<span class="clear"><!-- --></span>
</div>
<script type="text/javascript">
//<![CDATA[
var MsgProfile = {
tooltip: {
feature: {
notYetAvailable: "<?php
echo WoW_Locale::GetString('template_feature_not_available');
?>
"
},
vault: {
character: "<?php
echo WoW_Locale::GetString('template_vault_auth_required');
?>
",
guild: "<?php
echo WoW_Locale::GetString('template_vault_guild');
?>
"
}
}
};
//]]>
</script>
</div>
</div>
</div>
示例4: sprintf
<a href="<?php
echo WoW_Characters::GetURL();
?>
pvp" class="" rel="np"><span class="arrow"><span class="icon">PvP</span></span></a>
</li>
<li class="<?php
echo WoW_Template::GetPageData('page') == 'character_feed' ? ' active' : null;
?>
">
<a href="<?php
echo WoW_Characters::GetURL();
?>
feed" class="" rel="np"><span class="arrow"><span class="icon"><?php
echo WoW_Locale::GetString('template_profile_feed');
?>
</span></span></a>
</li>
<?php
if (WoW_Account::IsAccountCharacter()) {
echo sprintf('<li class="%s">
<a href="%s/wow/vault/character/friend" class=" vault" rel="np"><span class="arrow"><span class="icon">%s</span></span></a>
</li>', WoW_Template::GetPageData('page') == 'vault_friends' ? ' active' : null, WoW::GetWoWPath(), WoW_Locale::GetString('template_profile_friends'));
}
if (WoW_Characters::GetGuildID() > 0) {
echo sprintf('<li class="%s">
<a href="%s?character=%s" class=" has-submenu" rel="np"><span class="arrow"><span class="icon">%s</span></span></a>
</li>', WoW_Template::GetPageData('page') == 'guild_roster' ? ' active' : null, WoW_Characters::GetGuildURL(), urlencode(WoW_Characters::GetName()), WoW_Locale::GetString('template_profile_guild'));
}
?>
</ul>
示例5:
<fieldset class="ui-controls section-buttons">
<button
class="ui-button button1 "
type="submit"
tabindex="1">
<span>
<span><?php
echo WoW_Locale::GetString('template_account_conversion_confirm_sole_user_yes');
?>
</span>
</span>
</button>
<a class="ui-cancel "
href="<?php
echo WoW::GetWoWPath();
?>
/account/management/"
tabindex="1">
<span>
<?php
echo WoW_Locale::GetString('template_account_conversion_confirm_sole_user_no');
?>
</span>
</a>
</fieldset>
</form>
</div>
</div>
</div>
</div>
示例6:
echo WoW_Locale::GetString('template_guild_menu_achievements');
?>
</span></span></a>
</li>
<li class="<?php
echo WoW_Template::GetPageData('guild-page') == 'perks' ? ' active' : null;
?>
">
<a href="<?php
echo WoW_Guild::GetGuildUrl();
?>
perk" class="" rel="np"><span class="arrow"><span class="icon"><?php
echo WoW_Locale::GetString('template_guild_menu_perks');
?>
</span></span></a>
</li>
<li class="<?php
echo WoW_Template::GetPageData('guild-authorized') == false ? ' disabled' : null;
echo WoW_Template::GetPageData('guild-page') == 'rewards' ? ' active' : null;
?>
">
<a href="<?php
echo WoW_Template::GetPageData('guild-authorized') == true ? '/vault/guild/reward' : 'javascript:;';
?>
" class=" vault" rel="np"><span class="arrow"><span class="icon"><?php
echo WoW_Locale::GetString('template_guild_menu_rewards');
?>
</span></span></a>
</li>
</ul>
示例7: 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;
}
示例8: ucfirst
die;
}
echo '<form action="" method="POST">
<input type="hidden" name="helper" value="1" />
<strong>Allowable races:</strong><br />';
for ($i = 1; $i < 12; ++$i) {
echo '<label for="race_' . $i . '">' . WoW_Locale::GetString('character_race_' . $i) . '</label> <input type="checkbox" name="race_' . $i . '" id="race_' . $i . '" value="1" /><br />';
}
echo '<label for="race_22">' . WoW_Locale::GetString('character_race_22') . '</label> <input type="checkbox" name="race_22" id="race_22" value="1" /><br />';
echo '<br />
<strong>Allowable classes:</strong><br />';
for ($i = 1; $i < 12; ++$i) {
if ($i == 10) {
continue;
}
echo '<label for="class_' . $i . '">' . WoW_Locale::GetString('character_class_' . $i) . '</label> <input type="checkbox" name="class_' . $i . '" id="class_' . $i . '" value="1" /><br />';
}
echo '<br />
<strong>Armor:</strong><br />
<label for="armor_cloth">Cloth</label> <input type="checkbox" value="1" name="armor_cloth" id="armor_cloth" /><br />
<label for="armor_leather">Leather</label> <input type="checkbox" value="1" name="armor_leather" id="armor_leather" /><br />
<label for="armor_mail">Mail</label> <input type="checkbox" value="1" name="armor_mail" id="armor_mail" /><br />
<label for="armor_plate">Plate</label> <input type="checkbox" value="1" name="armor_plate" id="armor_plate" /><br />
<label for="armor_shield">Shield</label> <input type="checkbox" value="1" name="armor_shield" id="armor_shield" /><br />
<br />
<strong>Weapons:</strong><br />';
foreach ($weapons as &$weapon) {
echo '<label for="weapon_' . $weapon . '">' . ucfirst($weapon) . '</label> <input type="checkbox" value="1" name="weapon_' . $weapon . '" id="weapon_' . $weapon . '" /><br />';
}
echo '<br /><strong>Roles:</strong><br />';
foreach ($roles as $role) {
示例9:
<div class="user-plate">
<a href="?login" class="card-character plate-logged-out" onclick="return Login.open()">
<span class="card-portrait"></span>
<span class="wow-login-key"></span>
<span class="login-msg"><?php
echo WoW_Locale::GetString('template_userbox_auth_caption');
?>
</span>
</a>
</div>
示例10:
<a href="#" class="note-toggler" rel="newPassword-note">
<img src="<?php
echo WoW::GetWoWPath();
?>
/account/images/icons/tooltip-help.gif" alt="?" width="16" height="16" /></a>
</div>
</div>
<div class="form-row required">
<label for="reNewPassword" class="label-full ">
<strong><?php
echo WoW_Locale::GetString('template_account_password_reset_change_confirm');
?>
</strong>
<span class="form-required">*</span>
</label>
<input type="password" id="reNewPassword" name="reNewPassword" value="" class="input border-5 glow-shadow-2" maxlength="16" tabindex="1" />
</div>
<fieldset class="ui-controls">
<button class="ui-button button1 disabled" type="submit" disabled="disabled" id="settings-submit" tabindex="1">
<span><span><?php
echo WoW_Locale::GetString('template_account_password_reset_next');
?>
</span></span>
</button>
</fieldset>
</form>
</div>
</div>
</div>
</div>
示例11:
<div class="wrapper">
<div id="content">
<div id="page-header">
<h3 class="headline"><?php
echo WoW_Locale::GetString('template_account_password_reset_change_success');
?>
</h3>
</div>
<div id="page-content" class="page-content">
<h4 class="caption"><?php
echo WoW_Locale::GetString('template_account_password_reset_change_success_title');
?>
</h4>
<p><?php
echo WoW_Locale::GetString('template_account_password_reset_change_success_info');
?>
</p>
<div class="section-buttons">
<a class="ui-button button1" href="<?php
echo WoW::GetWoWPath();
?>
/account/"><span><span><?php
echo WoW_Locale::GetString('template_account_password_reset_change_success_home');
?>
</span></span></a>
</div>
</div>
</div>
</div>
</div>
示例12: sprintf
}
}
?>
</div>
</div>
</div>
<div class="filter">
<input type="input" class="input character-filter" value="<?php
echo WoW_Locale::GetString('template_filter_caption');
?>
" alt="<?php
echo WoW_Locale::GetString('template_filter_caption');
?>
" /><br />
<a href="javascript:;" onclick="CharSelect.swipe('out', this); return false;"><?php
echo WoW_Locale::GetString('template_back_to_characters_list');
?>
</a>
</div>
</div>
</div> </div>
</div>
<?php
if (WoW_Account::GetActiveCharacterInfo('guildId') > 0) {
echo sprintf('<div class="guild"><a class="guild-name" href="%s">%s</a></div>', WoW_Account::GetActiveCharacterInfo('guildUrl'), WoW_Account::GetActiveCharacterInfo('guildName'));
}
?>
</div>
</div>
<div class="card-overlay"></div>
</div>
示例13: sprintf
</div>
</div>
<ul class="navigation">
<?php
for ($i = 4; $i >= 0; --$i) {
echo sprintf('<li>
<a href="javascript:;"
id="nav-%d"
onclick="WikiDirectory.view(this, %d);"
class="expansion-%d' . ($i == 4 ? ' nav-active' : '') . '">
%s
</a>
</li>
', $i, $i, $i, WoW_Locale::GetString('template_expansion_' . $i));
}
?>
</ul>
</div>
<script type="text/javascript">
//<![CDATA[
$(function() {
WikiDirectory.initialize(3);
});
//]]>
</script>
<span class="clear"><!-- --></span>
示例14: main
public function main()
{
WoW_Template::SetTemplateTheme('wow');
WoW_Template::SetPageIndex('item_info');
WoW_Template::SetPageData('page', 'item_info');
WoW_Template::SetMenuIndex('menu-game');
$url_data = WoW::GetUrlData('item');
if (!$url_data) {
if (!isset($_GET['t'])) {
WoW_Template::ErrorPage(404);
}
exit;
}
$item_entry = $url_data['item_entry'];
if ($item_entry == 0) {
$breadcrumbs = WoW_Items::GetBreadCrumbsForItem($_GET);
WoW_Template::SetPageIndex('item_list');
WoW_Template::SetPageData('body_class', 'item-index');
WoW_Template::SetPageData('page', 'item_list');
WoW_Template::SetPageData('breadcrumbs', $breadcrumbs);
WoW_Template::SetPageData('last-crumb', is_array($breadcrumbs) ? $breadcrumbs[sizeof($breadcrumbs) - 1]['caption'] : WoW_Locale::GetString('template_menu_items'));
WoW_Template::LoadTemplate('page_index');
exit;
}
// Load proto
$proto = new WoW_ItemPrototype();
$proto->LoadItem($item_entry);
if (!$proto->IsCorrect()) {
if (!isset($_GET['t']) && (!isset($url_data['action0']) || $url_data['action0'] != 'tooltip')) {
WoW_Template::ErrorPage(404);
}
exit;
}
WoW_Template::SetPageData('item_entry', $item_entry);
// SSD and SSV data
$ssd = DB::WoW()->selectRow("SELECT * FROM `DBPREFIX_ssd` WHERE `entry` = %d", $proto->ScalingStatDistribution);
$ssd_level = MAX_PLAYER_LEVEL;
if (isset($_GET['pl'])) {
$ssd_level = (int) $_GET['pl'];
if (is_array($ssd) && $ssd_level > $ssd['MaxLevel']) {
$ssd_level = $ssd['MaxLevel'];
}
}
$ssv = DB::WoW()->selectRow("SELECT * FROM `DBPREFIX_ssv` WHERE `level` = %d", $ssd_level);
if (isset($_GET['t'])) {
$url_data['tooltip'] = true;
}
if ($url_data['tooltip'] == true) {
WoW_Template::SetPageIndex('item_tooltip');
WoW_Template::SetPageData('tooltip', true);
WoW_Template::SetPageData('page', 'item_tooltip');
WoW_Template::SetPageData('proto', $proto);
WoW_Template::SetPageData('ssd', $ssd);
WoW_Template::SetPageData('ssd_level', $ssd_level);
WoW_Template::SetPageData('ssv', $ssv);
WoW_Template::LoadTemplate('page_item_tooltip');
} else {
if (isset($url_data['action0']) && $url_data['action0'] != null) {
WoW_Template::SetPageData('tab_type', $url_data['action0']);
WoW_Template::LoadTemplate('page_item_tab');
exit;
}
WoW_Template::SetPageIndex('item');
WoW_Template::SetPageData('tooltip', false);
WoW_Template::SetPageData('itemName', $proto->name);
WoW_Template::SetPageData('page', 'item');
WoW_Template::SetPageData('proto', $proto);
WoW_Template::SetPageData('ssd', $ssd);
WoW_Template::SetPageData('ssd_level', $ssd_level);
WoW_Template::SetPageData('ssv', $ssv);
WoW_Template::LoadTemplate('page_index');
}
unset($proto);
}
示例15:
//]]>
</script>
</div>
<div class="post-detail" id="post-preview" style="display: none; "><?php
echo WoW_Template::GetPageData('edit_text');
?>
</div>
<div class="talkback-btm">
<table class="dynamic-center ">
<tr>
<td>
<div id="submitBtn">
<button class="ui-button button1 " type="submit">
<span>
<span><?php
echo WoW_Locale::GetString('template_forum_submit');
?>
</span>
</span>
</button>
</div>
</td>
</tr>
</table>
</div>
</div>
<span class="clear"><!-- --></span>
</div>
</div>
</form>
<span class="clear"><!-- --></span>