misc fixes:

spell:
 - removed weired break from tooltips
 - fixed time units being omitted by intval and subsequent cast to int

achievement:
 - casting id to int to avoid string-comparison in mysql (sped up load a lot)

localization:
 - fixed malformed file

infobox:
 - show video-options only when logged in

filter:
 - allow underscores in search (icon search)

search:
 - really fixed prepended quality for items
This commit is contained in:
Sarjuuk
2013-03-26 20:52:32 +01:00
parent 77889459b5
commit a3f1f2b549
7 changed files with 38 additions and 34 deletions

View File

@@ -4,7 +4,7 @@ if(!defined('AOWOW_REVISION'))
abstract class Filter
{
private static $pattern = "/[^\p{L}0-9\s\-\'\?\*]/ui";// delete any char not in unicode, number, hyphen, single quote or common wildcard
private static $pattern = "/[^\p{L}0-9\s_\-\'\?\*]/ui";// delete any char not in unicode, number, hyphen, single quote or common wildcard
private static $wildcards = ['*' => '%', '?' => '_'];
private static $criteria = ['cr', 'crs', 'crv']; // [cr]iterium, [cr].[s]ign, [cr].[v]alue

View File

@@ -934,7 +934,7 @@ class SpellList extends BaseType
$pos += strlen($result[0]);
$resolved = $this->resolveVariableString($result, $level, $interactive);
$str .= intVal($resolved) ? abs($resolved) : $resolved;
$str .= is_numeric($resolved) ? abs($resolved) : $resolved;
}
$str .= substr($data, $pos);
$str = str_replace('#', '$', $str); // reset marks
@@ -1074,8 +1074,6 @@ class SpellList extends BaseType
if ($this->curTpl['powerCostPerLevel'] > 0)
$x .= sprintf(Lang::$spell['costPerLevel'], $this->curTpl['powerCostPerLevel']);
$x .= '<br />';
if ($reqWrapper)
$x .= '</td><th>';

View File

@@ -33,7 +33,7 @@ define('CACHETYPE_SEARCH', 3);
define('SEARCH_TYPE_REGULAR', 0x10000000);
define('SEARCH_TYPE_OPEN', 0x20000000);
define('SEARCH_TYPE_JSON', 0x40000000);
define('SEARCH_MASK_OPEN', 0x001D807F); // open search
define('SEARCH_MASK_OPEN', 0x003DC0FF); // open search
define('SEARCH_MASK_ALL', 0x07FFFFFF); // normal search
// Databases

View File

@@ -162,13 +162,16 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'type' => $crt['type'],
);
$obj = (int)$crt['value1'];
$qty = (int)$crt['value2'];
switch ($crt['type'])
{
// link to npc
case ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE:
case ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE:
$tmp['link'] = array(
'href' => '?npc='.$crt['value1'],
'href' => '?npc='.$obj,
'text' => $crtName,
);
$tmp['extra_text'] = Lang::$achievement['slain'];
@@ -179,7 +182,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_PLAY_ARENA:
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
case ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP:
if ($zoneId = DB::Aowow()->selectCell('SELECT areatableID FROM ?_zones WHERE mapID = ? LIMIT 1', $crt['value1']))
if ($zoneId = DB::Aowow()->selectCell('SELECT areatableID FROM ?_zones WHERE mapID = ? LIMIT 1', $obj))
$tmp['link'] = array(
'href' => '?zone='.$zoneId,
'text' => $crtName,
@@ -191,7 +194,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE:
case ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA:
$tmp['link'] = array(
'href' => '?zone='.$crt['value1'],
'href' => '?zone='.$obj,
'text' => $crtName,
);
break;
@@ -201,21 +204,21 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE:
$tmp['link'] = array(
'href' => '?skill='.$crt['value1'],
'href' => '?skill='.$obj,
'text' => $crtName,
);
break;
// link to class
case ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS:
$tmp['link'] = array(
'href' => '?class='.$crt['value1'],
'href' => '?class='.$obj,
'text' => $crtName,
);
break;
// link to race
case ACHIEVEMENT_CRITERIA_TYPE_HK_RACE:
$tmp['link'] = array(
'href' => '?race='.$crt['value1'],
'href' => '?race='.$obj,
'text' => $crtName,
);
break;
@@ -226,23 +229,23 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// link to achivement (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_ACHIEVEMENT:
$tmp['link'] = array(
'href' => '?achievement='.$crt['value1'],
'href' => '?achievement='.$obj,
'text' => $crtName,
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_achievements',
'id' => $crt['value1'],
'id' => $obj,
);
if ($crtAcv = new AchievementList(array(['id', $crt['value1']])))
if ($crtAcv = new AchievementList(array(['id', $obj])))
$crtAcv->addGlobalsToJscript($pageData);
break;
// link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
$crtName = Quest::getName($crt['value1']);
$crtName = Quest::getName($obj);
$tmp['link'] = array(
'href' => '?quest='.$crt['value1'],
'href' => '?quest='.$obj,
'text' => $crtName ? $crtName : $crtName,
);
break;
@@ -252,18 +255,18 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
$crtSpl = new SpellList(array(['id', $crt['value1']]));
$crtSpl = new SpellList(array(['id', $obj]));
$crtSpl->addGlobalsToJscript($pageData);
$text = $crtName ? $crtName : $crtSpl->names[$crtSpl->id];
$tmp['link'] = array(
'href' => '?spell='.$crt['value1'],
'href' => '?spell='.$obj,
'text' => $text
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_spells',
'id' => $crt['value1'],
'id' => $obj,
);
break;
// link to item (/w icon)
@@ -271,44 +274,44 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
$crtItm = new ItemList(array(['id', $crt['value1']]));
$crtItm = new ItemList(array(['id', $obj]));
$crtItm->addGlobalsToJscript($pageData);
$text = $crtName ? $crtName : $crtItm->names[$crtItm->id];
$tmp['link'] = array(
'href' => '?item='.$crt['value1'],
'href' => '?item='.$obj,
'text' => $text,
'quality' => $crtItm->getField('Quality'),
'count' => $crt['value2'],
'count' => $qty,
);
$tmp['icon'] = $iconId;
$pageData['page']['icons'][] = array(
'itr' => $iconId++,
'type' => 'g_items',
'id' => $crt['value1'],
'count' => $crt['value2'],
'id' => $obj,
'count' => $qty,
);
break;
// link to faction (/w target reputation)
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
$crtName = Faction::getName($crt['value1']);
$crtName = Faction::getName($obj);
$tmp['link'] = array(
'href' => '?faction='.$crt['value1'],
'href' => '?faction='.$obj,
'text' => $crtName ? $crtName : $crtName,
);
$tmp['extra_text'] = ' ('.Lang::getReputationLevelForPoints($crt['value2']).')';
$tmp['extra_text'] = ' ('.Lang::getReputationLevelForPoints($qty).')';
break;
// link to GObject
case ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT:
case ACHIEVEMENT_CRITERIA_TYPE_FISH_IN_GAMEOBJECT:
$tmp['link'] = array(
'href' => '?object='.$crt['value1'],
'href' => '?object='.$obj,
'text' => $crtName,
);
break;
default:
$tmp['standard'] = true;
// Add a gold coin icon
$tmp['extra_text'] = $displayMoney ? Util::formatMoney($crt['value2']) : $crtName;
$tmp['extra_text'] = $displayMoney ? Util::formatMoney($qty) : $crtName;
break;
}
// If the right column

View File

@@ -288,9 +288,11 @@ if ($searchMask & 0x40)
{
while ($items->iterate())
{
$data[$items->id]['name'] = substr($data[$items->id]['name'], 1);
$data[$items->id]['param1'] = '"'.$items->getField('icon').'"';
$data[$items->id]['param2'] = $items->getField('Quality');
if ($searchMask & SEARCH_TYPE_OPEN)
$data[$items->id]['name'] = substr($data[$items->id]['name'], 1);
}
$found['item'] = array(

View File

@@ -3,11 +3,11 @@
<tr><td><div class="infobox-spacer"></div><div id="infobox-contents0"></div></td></tr>
<tr><th id="infobox-screenshots">{$lang.screenshots}</th></tr>
<tr><td><div class="infobox-spacer"></div><div id="infobox-sticky-ss"></div></td></tr>
<tr><th id="infobox-videos">{$lang.videos}</th></tr>
<tr><td><div class="infobox-spacer"></div><div id="infobox-sticky-vi"></div></td></tr>
{if $user.id > 0} <tr><th id="infobox-videos">{$lang.videos}</th></tr>
<tr><td><div class="infobox-spacer"></div><div id="infobox-sticky-vi"></div></td></tr>{/if}
</table>
<script type="text/javascript">ss_appendSticky()</script>
<script type="text/javascript">vi_appendSticky()</script>
{if $user.id > 0} <script type="text/javascript">vi_appendSticky()</script>{/if}
<script type="text/javascript">
Markup.printHtml("{$lvData.infobox}", "infobox-contents0", {ldelim}mode:Markup.MODE_QUICKFACTS{rdelim});
</script>

View File

@@ -2409,9 +2409,10 @@ var LANG = {
message_fillsomecriteria: "Vous devez utiliser au moins un critère.",
tooltip_jconlygems: "Si coché, les gemmes pour joailler, <br />\nvont aussi être utilisé pour déterminer les meilleurs<br />\ngemmes possible pour le score pondéré d'un objet.",fidropdowns:{yn:[[1,"Oui"],
tooltip_jconlygems: "Si coché, les gemmes pour joailler, <br />\nvont aussi être utilisé pour déterminer les meilleurs<br />\ngemmes possible pour le score pondéré d'un objet.",
tooltip_genericrating: "<span class=\"q2\">Equipé: Augmente votre $1 de <!--rtg$2-->$3&nbsp;<small>(<!--rtg%$2-->0&nbsp;@&nbsp;L<!--lvl-->0)</small>.</span><br />",
fidropdowns:{yn:[[1,"Oui"],
[2,"Non"]],num:[[1,">"],
[2,">="],
[3,"="],