本文整理汇总了PHP中Lang::achievement方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::achievement方法的具体用法?PHP Lang::achievement怎么用?PHP Lang::achievement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::achievement方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderTooltip
//.........这里部分代码省略.........
if ($_class == ITEM_CLASS_ARMOR && $this->curTpl['armorDamageModifier'] > 0) {
$spanI = 'class="q2"';
if ($interactive) {
$spanI = 'class="q2 tip" onmouseover="$WH.Tooltip.showAtCursor(event, $WH.sprintf(LANG.tooltip_armorbonus, ' . $this->curTpl['armorDamageModifier'] . '), 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"';
}
$x .= '<span ' . $spanI . '><!--addamr' . $this->curTpl['armorDamageModifier'] . '--><span>' . sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])) . '</span></span><br />';
} else {
if ($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'] > 0) {
$x .= '<span><!--amr-->' . sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])) . '</span><br />';
}
}
// Block
if ($this->curTpl['block']) {
$x .= '<span>' . sprintf(Lang::item('block'), $this->curTpl['block']) . '</span><br />';
}
// Item is a gem (don't mix with sockets)
if ($geId = $this->curTpl['gemEnchantmentId']) {
$gemEnch = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE id = ?d', $geId);
$x .= '<span class="q1"><a href="?enchantment=' . $geId . '">' . Util::localizedString($gemEnch, 'name') . '</a></span><br />';
// activation conditions for meta gems
if (!empty($gemEnch['conditionId'])) {
if ($gemCnd = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantmentcondition WHERE id = ?d', $gemEnch['conditionId'])) {
for ($i = 1; $i < 6; $i++) {
if (!$gemCnd['color' . $i]) {
continue;
}
switch ($gemCnd['comparator' . $i]) {
case 2:
// requires less <color> than (<value> || <comparecolor>) gems
// requires less <color> than (<value> || <comparecolor>) gems
case 5:
// requires at least <color> than (<value> || <comparecolor>) gems
$sp = (int) $gemCnd['value' . $i] > 1;
$x .= '<span class="q0">' . Lang::achievement('reqNumCrt') . ' ' . sprintf(Lang::item('gemConditions', $gemCnd['comparator' . $i], $sp), $gemCnd['value' . $i], Lang::item('gemColors', $gemCnd['color' . $i] - 1)) . '</span><br />';
break;
case 3:
// requires more <color> than (<value> || <comparecolor>) gems
$x .= '<span class="q0">' . Lang::achievement('reqNumCrt') . ' ' . sprintf(Lang::item('gemConditions', 3), Lang::item('gemColors', $gemCnd['color' . $i] - 1), Lang::item('gemColors', $gemCnd['cmpColor' . $i] - 1)) . '</span><br />';
break;
}
}
}
}
}
// Random Enchantment - if random enchantment is set, prepend stats from it
if ($this->curTpl['randomEnchant'] && !isset($enhance['r'])) {
$x .= '<span class="q2">' . Lang::item('randEnchant') . '</span><br />';
} else {
if (isset($enhance['r'])) {
$x .= $randEnchant;
}
}
// itemMods (display stats and save ratings for later use)
for ($j = 1; $j <= 10; $j++) {
$type = $this->curTpl['statType' . $j];
$qty = $this->curTpl['statValue' . $j];
if (!$qty || $type <= 0) {
continue;
}
// base stat
if ($type >= ITEM_MOD_AGILITY && $type <= ITEM_MOD_STAMINA) {
$x .= '<span><!--stat' . $type . '-->' . ($qty > 0 ? '+' : '-') . abs($qty) . ' ' . Lang::item('statType', $type) . '</span><br />';
} else {
// rating with % for reqLevel
$green[] = $this->parseRating($type, $qty, $interactive, $causesScaling);
}
示例2: foreach
<tr><th id="infobox-series"><?php
echo $listTitle ?: Lang::achievement('series');
?>
</th></tr>
<tr><td>
<div class="infobox-spacer"></div>
<table class="series">
<?php
foreach ($list as $idx => $itr) {
echo ' <tr><th>' . ($idx + 1) . '</th><td><div>';
$_ = array_keys($itr);
$end = array_pop($_);
foreach ($itr as $k => $i) {
// itemItr
switch ($i['side']) {
case 1:
$wrap = '<span class="icon-alliance-padded">%s</span>';
break;
case 2:
$wrap = '<span class="icon-horde">%s</span>';
break;
default:
$wrap = '%s';
break;
}
if ($i['typeId'] == $this->typeId) {
echo sprintf($wrap, '<b>' . $i['name'] . '</b>');
} else {
echo sprintf($wrap, '<a href="?' . $i['typeStr'] . '=' . $i['typeId'] . '">' . $i['name'] . '</a>');
}
echo $end == $k ? null : '<br />';
示例3: generateContent
protected function generateContent()
{
$_level = $this->subject->getField('level');
$_minLevel = $this->subject->getField('minLevel');
$_flags = $this->subject->getField('flags');
$_specialFlags = $this->subject->getField('specialFlags');
$_side = Util::sideByRaceMask($this->subject->getField('reqRaceMask'));
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// event (todo: assign eventData)
if ($_ = $this->subject->getField('eventId')) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $_);
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $_ . ']';
}
// level
if ($_level > 0) {
$infobox[] = Lang::game('level') . Lang::main('colon') . $_level;
}
// reqlevel
if ($_minLevel) {
$lvl = $_minLevel;
if ($_ = $this->subject->getField('maxLevel')) {
$lvl .= ' - ' . $_;
}
$infobox[] = sprintf(Lang::game('reqLevel'), $lvl);
}
// loremaster (i dearly hope those flags cover every case...)
if ($this->subject->getField('zoneOrSortBak') > 0 && !$this->subject->isRepeatable()) {
$conditions = array(['ac.type', ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE], ['ac.value1', $this->subject->getField('zoneOrSortBak')], ['a.faction', $_side, '&']);
$loremaster = new AchievementList($conditions);
$this->extendGlobalData($loremaster->getJSGlobals(GLOBALINFO_SELF));
switch ($loremaster->getMatches()) {
case 0:
break;
case 1:
$infobox[] = Lang::quest('loremaster') . Lang::main('colon') . '[achievement=' . $loremaster->id . ']';
break;
default:
$lm = Lang::quest('loremaster') . Lang::main('colon') . '[ul]';
foreach ($loremaster->iterate() as $id => $__) {
$lm .= '[li][achievement=' . $id . '][/li]';
}
$infobox[] = $lm . '[/ul]';
break;
}
}
// type (maybe expand uppon?)
$_ = [];
if ($_flags & QUEST_FLAG_DAILY) {
$_[] = Lang::quest('daily');
} else {
if ($_flags & QUEST_FLAG_WEEKLY) {
$_[] = Lang::quest('weekly');
} else {
if ($_specialFlags & QUEST_FLAG_SPECIAL_MONTHLY) {
$_[] = Lang::quest('monthly');
}
}
}
if ($t = $this->subject->getField('type')) {
$_[] = Lang::quest('questInfo', $t);
}
if ($_) {
$infobox[] = Lang::game('type') . Lang::main('colon') . implode(' ', $_);
}
// side
$_ = Lang::main('side') . Lang::main('colon');
switch ($_side) {
case 3:
$infobox[] = $_ . Lang::game('si', 3);
break;
case 2:
$infobox[] = $_ . '[span class=icon-horde]' . Lang::game('si', 2) . '[/span]';
break;
case 1:
$infobox[] = $_ . '[span class=icon-alliance]' . Lang::game('si', 1) . '[/span]';
break;
}
// races
if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_RACE, $jsg);
$t = $n == 1 ? Lang::game('race') : Lang::game('races');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// classes
if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $n == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// profession / skill
if ($_ = $this->subject->getField('reqSkillId')) {
$this->extendGlobalIds(TYPE_SKILL, $_);
$sk = '[skill=' . $_ . ']';
if ($_ = $this->subject->getField('reqSkillPoints')) {
$sk .= ' (' . $_ . ')';
}
$infobox[] = Lang::quest('profession') . Lang::main('colon') . $sk;
//.........这里部分代码省略.........
示例4: foreach
?>
</td>
<td class="padded"> <select name="si">
<option></option>
<?php
foreach (Lang::game('si') as $i => $str) {
if ($str) {
echo ' <option value="' . $i . '" ' . (isset($f['si']) && $f['si'] == $i ? 'selected' : null) . '>' . $str . "</option>\n";
}
}
?>
</select>
</td>
<td class="padded"><table><tr>
<td> <?php
echo Lang::achievement('points') . Lang::main('colon');
?>
</td>
<td> <input type="text" name="minpt" maxlength="2" class="smalltextbox" <?php
echo isset($f['minpt']) ? 'value="' . $f['minpt'] . '"' : null;
?>
/> - <input type="text" name="maxpt" maxlength="2" class="smalltextbox" <?php
echo isset($f['maxpt']) ? 'value="' . $f['maxpt'] . '"' : null;
?>
/></td>
</tr></table></td>
</tr>
</table>
<div id="fi_criteria" class="padded criteria"><div></div></div><div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php
echo Lang::main('addFilter');
示例5: notFound
public function notFound()
{
if ($this->mode != CACHE_TYPE_TOOLTIP) {
return parent::notFound(Lang::game('achievement'), Lang::achievement('notFound'));
}
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit;
}
示例6: generateContent
protected function generateContent()
{
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// reqLevel
if ($_ = $this->subject->getField('requiredLevel')) {
$infobox[] = sprintf(Lang::game('reqLevel'), $_);
}
// reqskill
if ($_ = $this->subject->getField('skillLine')) {
$this->extendGlobalIds(TYPE_SKILL, $_);
$foo = sprintf(Lang::game('requires'), ' [skill=' . $_ . ']');
if ($_ = $this->subject->getField('skillLevel')) {
$foo .= ' (' . $_ . ')';
}
$infobox[] = $foo;
}
/****************/
/* Main Content */
/****************/
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->effects = [];
// 3 effects
for ($i = 1; $i < 4; $i++) {
$_ty = $this->subject->getField('type' . $i);
$_qty = $this->subject->getField('amount' . $i);
$_obj = $this->subject->getField('object' . $i);
switch ($_ty) {
case 1:
case 3:
case 7:
$sArr = $this->subject->getField('spells')[$i];
$spl = $this->subject->getRelSpell($sArr[0]);
$this->effects[$i]['name'] = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Type: ' . $_ty, Lang::item('trigger', $sArr[1])) : Lang::item('trigger', $sArr[1]);
$this->effects[$i]['proc'] = $sArr[3];
$this->effects[$i]['value'] = $_qty ?: null;
$this->effects[$i]['icon'] = array('name' => !$spl ? Util::ucFirst(Lang::game('spell')) . ' #' . $sArr[0] : Util::localizedString($spl, 'name'), 'id' => $sArr[0], 'count' => $sArr[2]);
break;
case 5:
if ($_obj < 2) {
// [mana, health] are on [0, 1] respectively and are expected on [1, 2] ..
$_obj++;
}
// 0 is weaponDmg .. ehh .. i messed up somewhere
$this->effects[$i]['tip'] = [$_obj, Util::$itemMods[$_obj]];
// DO NOT BREAK!
// DO NOT BREAK!
case 2:
case 6:
case 8:
case 4:
$this->effects[$i]['name'] = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Type: ' . $_ty, Lang::enchantment('types', $_ty)) : Lang::enchantment('types', $_ty);
$this->effects[$i]['value'] = $_qty;
if ($_ty == 4) {
$this->effects[$i]['name'] .= Lang::main('colon') . '(' . (User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'Object: ' . $_obj, Lang::getMagicSchools(1 << $_obj)) : Lang::getMagicSchools(1 << $_obj)) . ')';
}
}
}
// activation conditions
if ($_ = $this->subject->getField('conditionId')) {
$x = '';
if ($gemCnd = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantmentcondition WHERE id = ?d', $_)) {
for ($i = 1; $i < 6; $i++) {
if (!$gemCnd['color' . $i]) {
continue;
}
$fiColors = function ($idx) {
$foo = '';
switch ($idx) {
case 2:
$foo = '0:3:5';
break;
// red
// red
case 3:
$foo = '2:4:5';
break;
// yellow
// yellow
case 4:
$foo = '1:3:4';
break;
// blue
}
return $foo;
};
$bLink = $gemCnd['color' . $i] ? '<a href="?items=3&filter=ty=' . $fiColors($gemCnd['color' . $i]) . '">' . Lang::item('gemColors', $gemCnd['color' . $i] - 1) . '</a>' : '';
$cLink = $gemCnd['cmpColor' . $i] ? '<a href="?items=3&filter=ty=' . $fiColors($gemCnd['cmpColor' . $i]) . '">' . Lang::item('gemColors', $gemCnd['cmpColor' . $i] - 1) . '</a>' : '';
switch ($gemCnd['comparator' . $i]) {
case 2:
// requires less <color> than (<value> || <comparecolor>) gems
// requires less <color> than (<value> || <comparecolor>) gems
case 5:
// requires at least <color> than (<value> || <comparecolor>) gems
$sp = (int) $gemCnd['value' . $i] > 1;
$x .= '<span class="q0">' . Lang::achievement('reqNumCrt') . ' ' . sprintf(Lang::item('gemConditions', $gemCnd['comparator' . $i], $sp), $gemCnd['value' . $i], $bLink) . '</span><br />';
break;
case 3:
//.........这里部分代码省略.........
示例7: renderTooltip
public function renderTooltip()
{
$criteria = $this->getCriteria();
$tmp = [];
$rows = [];
$i = 0;
foreach ($criteria as $_row) {
if ($i++ % 2) {
$tmp[] = $_row;
} else {
$rows[] = $_row;
}
}
if ($tmp) {
$rows = array_merge($rows, $tmp);
}
$description = $this->getField('description', true);
$name = $this->getField('name', true);
$criteria = '';
$i = 0;
foreach ($rows as $crt) {
$obj = (int) $crt['value1'];
$qty = (int) $crt['value2'];
// we could show them, but the tooltips are cluttered
if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_HIDDEN && User::$perms <= 0) {
continue;
}
$crtName = Util::localizedString($crt, 'name');
switch ($crt['type']) {
// link to title - todo (low): crosslink
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
$crtName = Util::ucFirst(Lang::game('title')) . Lang::main('colon') . $crtName;
break;
// link to quest
// link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
if (!$crtName) {
$crtName = QuestList::getName($obj);
}
break;
// link to spell (/w icon)
// link to spell (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
if (!$crtName) {
$crtName = SpellList::getName($obj);
}
break;
// link to item (/w icon)
// link to item (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
if (!$crtName) {
$crtName = ItemList::getName($obj);
}
break;
// link to faction (/w target reputation)
// link to faction (/w target reputation)
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
if (!$crtName) {
$crtName = FactionList::getName($obj);
}
break;
}
if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) {
$criteria .= '- ' . Util::jsEscape($crtName) . ' <span class="moneygold">' . number_format($crt['value2'] / 10000) . '</span><br />';
} else {
$criteria .= '- ' . Util::jsEscape($crtName) . '<br />';
}
if (++$i == round(count($rows) / 2)) {
$criteria .= '</small></td><th class="q0" style="white-space: nowrap; text-align: left"><small>';
}
}
$x = '<table><tr><td><b class="q">';
$x .= Util::jsEscape($name);
$x .= '</b></td></tr></table>';
if ($description || $criteria) {
$x .= '<table><tr><td>';
}
if ($description) {
$x .= '<br />' . Util::jsEscape($description) . '<br />';
}
if ($criteria) {
$x .= '<br /><span class="q">' . Lang::achievement('criteria') . ':</span>';
$x .= '<table width="100%"><tr><td class="q0" style="white-space: nowrap"><small>' . $criteria . '</small></th></tr></table>';
}
if ($description || $criteria) {
$x .= '</td></tr></table>';
}
return $x;
}
示例8:
echo '<tr><th' . (isset($cr['icon']) ? ' align="right" id="iconlist-icon' . $cr['icon'] . '"' : null) . '>';
if (!isset($cr['icon'])) {
echo '<ul><li><var> </var></li></ul>';
}
echo '</th><td>';
if (!empty($cr['link'])) {
echo '<a href="' . $cr['link']['href'] . '"' . (isset($cr['link']['quality']) ? ' class="q' . $cr['link']['quality'] . '"' : null) . '>' . Util::htmlEscape($cr['link']['text']) . '</a>';
}
if (!empty($cr['link']['count']) && $cr['link']['count'] > 1) {
echo ' (' . $cr['link']['count'] . ')';
}
if (isset($cr['extraText'])) {
echo ' ' . $cr['extraText'];
}
if (User::isInGroup(U_GROUP_STAFF)) {
echo ' <small title="' . Lang::achievement('criteriaType') . ' ' . $cr['type'] . '" class="q0">[' . $cr['id'] . ']</small>';
}
echo '</td></tr>';
// every odd number of elements
if ($i + 1 == round(count($this->criteria['data']) / 2)) {
echo '</table></div><div style="float: left"><table class="iconlist">';
}
}
?>
</table>
</div>
<script type="text/javascript">//<![CDATA[
<?php
foreach ($this->criteria['icons'] as $k => $ic) {
echo ' $WH.ge(\'iconlist-icon' . $ic['itr'] . '\').appendChild(' . $ic['type'] . '.createIcon(' . $ic['id'] . ', 0, ' . (!empty($ic['count']) ? $ic['count'] : 0) . "));\n";
示例9: count
$this->brick('infobox');
?>
<div class="text">
<?php
$this->brick('headIcons');
$this->brick('redButtons');
?>
<h1><?php
echo $this->name;
?>
</h1>
<?php
echo $this->description;
echo '<h3>' . Lang::achievement('criteria') . ($this->criteria['reqQty'] ? ' – <small><b>' . Lang::achievement('reqNumCrt') . ' ' . $this->criteria['reqQty'] . ' ' . Lang::achievement('outOf') . ' ' . count($this->criteria['data']) . '</b></small>' : null) . "</h3>\n";
?>
<div style="float: left; margin-right: 25px">
<table class="iconlist">
<?php
foreach ($this->criteria['data'] as $i => $cr) {
echo '<tr><th' . (isset($cr['icon']) ? ' align="right" id="iconlist-icon' . $cr['icon'] . '"' : null) . '>';
if (!isset($cr['icon'])) {
echo '<ul><li><var> </var></li></ul>';
}
echo '</th><td><span class="tip" title="ID' . Lang::main('colon') . $cr['id'] . '">';
if (!empty($cr['link'])) {
echo '<a href="' . $cr['link']['href'] . '"' . (isset($cr['link']['quality']) ? ' class="q' . $cr['link']['quality'] . '"' : null) . '>' . Util::htmlEscape($cr['link']['text']) . '</a>';
}