本文整理汇总了PHP中Lang::quest方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::quest方法的具体用法?PHP Lang::quest怎么用?PHP Lang::quest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::quest方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateTitle
protected function generateTitle()
{
array_unshift($this->title, $this->name);
if (isset($this->category[1])) {
array_unshift($this->title, Lang::quest('cat', $this->category[0], $this->category[1]));
} else {
if (isset($this->category[0])) {
$c0 = Lang::quest('cat', $this->category[0]);
array_unshift($this->title, is_array($c0) ? $c0[0] : $c0);
}
}
}
示例2: fi_submit
<form action="?quests<?php
echo $this->subCat;
?>
&filter" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
<div class="rightpanel">
<div style="float: left"><?php
echo Lang::game('type') . Lang::main('colon');
?>
</div><small><a href="javascript:;" onclick="document.forms['fi'].elements['ty[]'].selectedIndex = -1; return false" onmousedown="return false"><?php
echo Lang::main('clear');
?>
</a></small>
<div class="clear"></div>
<select name="ty[]" size="6" multiple="multiple" class="rightselect">
<?php
foreach (Lang::quest('questInfo') as $i => $str) {
echo ' <option value="' . $i . '"' . (isset($f['ty']) && in_array($i, (array) $f['ty']) ? ' selected' : null) . '>' . $str . "</option>\n";
}
?>
</select>
</div>
<table>
<tr>
<td><?php
echo Util::ucFirst(Lang::main('name')) . Lang::main('colon');
?>
</td>
<td colspan="3">
<table><tr>
<td> <input type="text" name="na" size="30" <?php
示例3: createMail
private function createMail(&$attachmentTab, $startEnd)
{
$mail = [];
if ($_ = $this->subject->getField('rewardMailTemplateId')) {
$delay = $this->subject->getField('rewardMailDelay');
$letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailtemplate WHERE id = ?d', $_);
$mail = array('delay' => $delay ? sprintf(Lang::quest('mailIn'), Util::formatTime($delay * 1000)) : null, 'sender' => null, 'text' => $letter ? Util::parseHtmlText(Util::localizedString($letter, 'text')) : null, 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject')));
foreach ($startEnd as $se) {
if (!($se['method'] & 0x2) || $se['type'] != TYPE_NPC) {
continue;
}
if ($_ = CreatureList::getName($se['typeId'])) {
$mail['sender'] = sprintf(Lang::quest('mailBy'), $se['typeId'], $_);
break;
}
}
$extraCols = ['Listview.extraCols.percent'];
$mailLoot = new Loot();
if ($mailLoot->getByContainer(LOOT_MAIL, $_)) {
$this->extendGlobalData($mailLoot->jsGlobals);
$attachmentTab = array('file' => 'item', 'data' => $mailLoot->getResult(), 'params' => array('name' => '[Mail Attachments]', 'id' => 'mail-attachments', 'extraCols' => "\$[" . implode(', ', array_merge($extraCols, $mailLoot->extraCols)) . "]", 'hiddenCols' => "\$['side', 'slot', 'reqlevel']"));
}
}
return $mail;
}
示例4: createMail
private function createMail(&$reqCss = false)
{
$mail = [];
if ($_ = $this->subject->getField('mailTemplate')) {
$letter = DB::Aowow()->selectRow('SELECT * FROM ?_mailtemplate WHERE id = ?d', $_);
if (!$letter) {
return [];
}
$reqCss = true;
$mail = array('delay' => null, 'sender' => null, 'subject' => Util::parseHtmlText(Util::localizedString($letter, 'subject', true)), 'text' => Util::parseHtmlText(Util::localizedString($letter, 'text', true)));
} else {
if ($_ = Util::parseHtmlText($this->subject->getField('text', true, true))) {
$reqCss = true;
$mail = array('delay' => null, 'sender' => null, 'subject' => Util::parseHtmlText($this->subject->getField('subject', true, true)), 'text' => $_);
}
}
if ($_ = CreatureList::getName($this->subject->getField('sender'))) {
$mail['sender'] = sprintf(Lang::quest('mailBy'), $this->subject->getField('sender'), $_);
}
return $mail;
}
示例5: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Quartermaster if any
if ($ids = $this->subject->getField('qmNpcIds')) {
$this->extendGlobalIds(TYPE_NPC, $ids);
$qmStr = Lang::faction('quartermaster') . Lang::main('colon');
if (count($ids) == 1) {
$qmStr .= '[npc=' . $ids[0] . ']';
} else {
if (count($ids) > 1) {
$qmStr .= '[ul]';
foreach ($ids as $id) {
$qmStr .= '[li][npc=' . $id . '][/li]';
}
$qmStr .= '[/ul]';
}
}
$infobox[] = $qmStr;
}
// side if any
if ($_ = $this->subject->getField('side')) {
$infobox[] = Lang::main('side') . Lang::main('colon') . '[span class=icon-' . ($_ == 1 ? 'alliance' : 'horde') . ']' . Lang::game('si', $_) . '[/span]';
}
/****************/
/* Main Content */
/****************/
$this->extraText = '';
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true);
// Spillover Effects
/* todo (low): also check on reputation_spillover_template (but its data is identical to calculation below
$rst = DB::World()->selectRow('SELECT
CONCAT_WS(" ", faction1, faction2, faction3, faction4) AS faction,
CONCAT_WS(" ", rate_1, rate_2, rate_3, rate_4) AS rate,
CONCAT_WS(" ", rank_1, rank_2, rank_3, rank_4) AS rank
FROM reputation_spillover_template WHERE faction = ?d', $this->typeId);
*/
$conditions = array(['id', $this->typeId, '!'], ['repIdx', -1, '!']);
if ($p = $this->subject->getField('parentFactionId')) {
// linked via parent
$conditions[] = ['OR', ['id', $p], ['parentFactionId', $p]];
} else {
// self as parent
$conditions[] = ['parentFactionId', $this->typeId];
}
$spillover = new FactionList($conditions);
$this->extendGlobalData($spillover->getJSGlobals());
$buff = '';
foreach ($spillover->iterate() as $spillId => $__) {
if ($val = $spillover->getField('spilloverRateIn') * $this->subject->getField('spilloverRateOut') * 100) {
$buff .= '[tr][td][faction=' . $spillId . '][/td][td][span class=q' . ($val > 0 ? '2]+' : '10]') . $val . '%[/span][/td][td]' . Lang::game('rep', $spillover->getField('spilloverMaxRank')) . '[/td][/tr]';
}
}
if ($buff) {
$this->extraText .= '[h3 class=clear]' . Lang::faction('spillover') . '[/h3][div margin=15px]' . Lang::faction('spilloverDesc') . '[/div][table class=grid width=400px][tr][td width=150px][b]' . Util::ucFirst(Lang::game('faction')) . '[/b][/td][td width=100px][b]' . Lang::spell('_value') . '[/b][/td][td width=150px][b]' . Lang::faction('maxStanding') . '[/b][/td][/tr]' . $buff . '[/table]';
}
// reward rates (ultimately this should be calculated into each reward display)
if ($rates = DB::World()->selectRow('SELECT * FROM reputation_reward_rate WHERE faction = ?d', $this->typeId)) {
$buff = '';
foreach ($rates as $k => $v) {
if ($v == 1) {
continue;
}
switch ($k) {
case 'quest_rate':
$buff .= '[tr][td]' . Lang::game('quests') . Lang::main('colon') . '[/td]';
break;
case 'quest_daily_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('daily') . ')' . Lang::main('colon') . '[/td]';
break;
case 'quest_weekly_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('weekly') . ')' . Lang::main('colon') . '[/td]';
break;
case 'quest_monthly_rate':
$buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('monthly') . ')' . Lang::main('colon') . '[/td]';
break;
case 'creature_rate':
$buff .= '[tr][td]' . Lang::game('npcs') . Lang::main('colon') . '[/td]';
break;
case 'spell_rate':
$buff .= '[tr][td]' . Lang::game('spells') . Lang::main('colon') . '[/td]';
break;
}
$buff .= '[td width=35px align=right][span class=q' . ($v < 1 ? '10]' : '2]+') . intVal(($v - 1) * 100) . '%[/span][/td][/tr]';
}
if ($buff) {
$this->extraText .= '[h3 class=clear]' . Lang::faction('customRewRate') . '[/h3][table]' . $buff . '[/table]';
}
}
// factionchange-equivalent
if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_reputations WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) {
$altFac = new FactionList(array(['id', abs($pendant)]));
if (!$altFac->error) {
$this->transfer = sprintf(Lang::faction('_transfer'), $altFac->id, $altFac->getField('name', true), $pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2));
}
//.........这里部分代码省略.........
示例6: sprintf
<?php
if ($m = $this->mail) {
echo ' <h3>' . sprintf(Lang::quest('mailDelivery'), $m['sender'], $m['delay']) . "</h3>\n";
if ($m['subject']) {
echo ' <div class="book"><div class="page">' . $m['subject'] . "</div></div>\n";
}
if ($m['text']) {
echo ' <div class="book"><div class="page">' . $m['text'] . "</div></div>\n";
}
}
示例7: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return null;
}
$title = Util::jsEscape($this->getField('name', true));
$level = $this->curTpl['level'];
if ($level < 0) {
$level = 0;
}
$x = '';
if ($level) {
$level = sprintf(Lang::quest('questLevel'), $level);
if ($this->curTpl['flags'] & QUEST_FLAG_DAILY) {
// daily
$level .= ' ' . Lang::quest('daily');
}
$x .= '<table><tr><td><table width="100%"><tr><td><b class="q">' . $title . '</b></td><th><b class="q0">' . $level . '</b></th></tr></table></td></tr></table>';
} else {
$x .= '<table><tr><td><b class="q">' . $title . '</b></td></tr></table>';
}
$x .= '<table><tr><td><br />' . $this->parseText('objectives');
$xReq = '';
for ($i = 1; $i < 5; $i++) {
$ot = $this->getField('objectiveText' . $i, true);
$rng = $this->curTpl['reqNpcOrGo' . $i];
$rngQty = $this->curTpl['reqNpcOrGoCount' . $i];
if ($rngQty < 1 && (!$rng || $ot)) {
continue;
}
if ($ot) {
$name = $ot;
} else {
$name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng);
}
$xReq .= '<br /> - ' . Util::jsEscape($name) . ($rngQty > 1 ? ' x ' . $rngQty : null);
}
for ($i = 1; $i < 7; $i++) {
$ri = $this->curTpl['reqItemId' . $i];
$riQty = $this->curTpl['reqItemCount' . $i];
if (!$ri || $riQty < 1) {
continue;
}
$xReq .= '<br /> - ' . Util::jsEscape(ItemList::getName($ri)) . ($riQty > 1 ? ' x ' . $riQty : null);
}
if ($et = $this->getField('end', true)) {
$xReq .= '<br /> - ' . Util::jsEscape($et);
}
if ($_ = $this->getField('rewardOrReqMoney')) {
if ($_ < 0) {
$xReq .= '<br /> - ' . Lang::quest('money') . Lang::main('colon') . Util::formatMoney(abs($_));
}
}
if ($xReq) {
$x .= '<br /><br /><span class="q">' . Lang::quest('requirements') . Lang::main('colon') . '</span>' . $xReq;
}
$x .= '</td></tr></table>';
return $x;
}
示例8: number_format
echo ' <h3>' . Lang::main('gains') . "</h3>\n";
echo ' ' . Lang::quest('gainsDesc') . Lang::main('colon') . "\n";
echo " <ul>\n";
if (!empty($g['xp'])) {
echo ' <li><div>' . number_format($g['xp']) . ' ' . Lang::quest('experience') . "</div></li>\n";
}
if (!empty($g['rep'])) {
foreach ($g['rep'] as $r) {
echo ' <li><div>' . ($r['qty'] < 0 ? '<b class="q10">' . $r['qty'] . '</b>' : $r['qty']) . ' ' . Lang::npc('repWith') . ' <a href="?faction=' . $r['id'] . '">' . $r['name'] . "</a></div></li>\n";
}
}
if (!empty($g['title'])) {
echo ' <li><div>' . sprintf(Lang::quest('theTitle'), $g['title']) . "</div></li>\n";
}
if (!empty($g['tp'])) {
echo ' <li><div>' . $g['tp'] . ' ' . Lang::quest('bonusTalents') . "</div></li>\n";
}
echo " </ul>\n";
}
$this->brick('mail');
if (!empty($this->transfer)) {
echo " <div class=\"pad\"></div>\n " . $this->transfer . "\n";
}
?>
<h2 class="clear"><?php
echo Lang::main('related');
?>
</h2>
</div>
<?php