Skip to content

Commit 93cc424

Browse files
committed
menu more and tools
- items: allow 'upg' to be an array - filter: fixed logic error in checks - Markup: prevent handling of [menu], as PageTemplate is nyi - Power: advanced features (hide reagents or sellprice; recoloring, renaming, iconizing of links) - search: side-icon for titles - smarty: added template-vars to cache (has to be fixed sooner or later) - identify as HTML5 (fixed a strange bug with displaced list-pegs) - removed several typos
1 parent f236d7a commit 93cc424

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1074
-249
lines changed

config/aowow.xml.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
3+
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
4+
<ShortName>/*$shortName*/</ShortName>
5+
<Description>/*$name*/</Description>
6+
<Url
7+
type="text/html"
8+
method="get"
9+
template="/*HOST_URL*//?search={searchTerms}" />
10+
11+
<Url
12+
type="application/x-suggestions+json"
13+
method="get"
14+
template="/*HOST_URL*//?search={searchTerms}&amp;opensearch" />
15+
16+
<Image height="16" width="16" type="image/vnd.microsoft.icon">/*STATIC_URL*//images/logos/favicon.ico</Image>
17+
<Image height="16" width="16" type="image/gif">/*STATIC_URL*//images/icons/favicon.gif</Image>
18+
19+
</OpenSearchDescription>

crossdomain.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
2+
<cross-domain-policy>
3+
<site-control permitted-cross-domain-policies="all"/>
4+
<allow-access-from domain="*"/>
5+
</cross-domain-policy>

includes/types/basetype.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ public function urlize(array $override = [], array $addCr = [])
672672

673673
if (is_array($v) && !empty($v))
674674
$_[$k] = $k.'='.implode(':', $v);
675-
else if ($v === '')
675+
else if ($v !== '')
676676
$_[$k] = $k.'='.$v;
677677
}
678678

includes/types/item.class.php

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
416416
$_flags = $this->curTpl['flags'];
417417
$_class = $this->curTpl['class'];
418418
$_subClass = $this->curTpl['subClass'];
419+
$_slot = $this->curTpl['slot'];
419420
$causesScaling = false;
420421

421422
if (!empty($enhance['rand']))
@@ -440,6 +441,9 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
440441
}
441442
}
442443

444+
if (isset($enhance['sock']) && !in_array($_slot, [INVTYPE_WRISTS, INVTYPE_WAIST, INVTYPE_HANDS]))
445+
unset($enhance['sock']);
446+
443447
// IMPORTAT: DO NOT REMOVE THE HTML-COMMENTS! THEY ARE REQUIRED TO UPDATE THE TOOLTIP CLIENTSIDE
444448
$x = '';
445449

@@ -528,7 +532,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
528532
$x .= '<table width="100%"><tr>';
529533

530534
// Class
531-
$x .= '<td>'.Lang::$item['inventoryType'][$this->curTpl['slot']].'</td>';
535+
$x .= '<td>'.Lang::$item['inventoryType'][$_slot].'</td>';
532536

533537
// Subclass
534538
if ($_class == ITEM_CLASS_ARMOR && $_subClass > 0)
@@ -540,8 +544,8 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
540544

541545
$x .= '</tr></table>';
542546
}
543-
else if (($_ = $this->curTpl['slot']) && $_class != ITEM_CLASS_CONTAINER) // yes, slot can occur on random items and is then also displayed <_< .. excluding Bags >_>
544-
$x .= '<br />'.Lang::$item['inventoryType'][$this->curTpl['slot']].'<br />';
547+
else if ($_slot && $_class != ITEM_CLASS_CONTAINER) // yes, slot can occur on random items and is then also displayed <_< .. excluding Bags >_>
548+
$x .= '<br />'.Lang::$item['inventoryType'][$_slot].'<br />';
545549
else
546550
$x .= '<br />';
547551

@@ -930,7 +934,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
930934
foreach ($reagents->iterate() as $__)
931935
$reqReag[] = '<a href="?item='.$reagents->id.'">'.$reagents->getField('name', true).'</a> ('.$reagentItems[$reagents->id].')';
932936

933-
$xCraft .= '<br /><span class="q1">'.Lang::$game['requires2'].' '.implode(', ', $reqReag).'</span>';
937+
$xCraft .= '<div class="q1 whtt-reagents"><br />'.Lang::$game['requires2'].' '.implode(', ', $reqReag).'</div>';
934938
}
935939
}
936940
}
@@ -956,23 +960,23 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
956960
if ($this->curTpl['spellCharges1'] > 1 || $this->curTpl['spellCharges1'] < -1)
957961
$xMisc[] = '<span class="q1">'.abs($this->curTpl['spellCharges1']).' '.Lang::$item['charges'].'</span>';
958962

959-
if ($sp = $this->curTpl['sellPrice'])
960-
$xMisc[] = '<span class="q1">'.Lang::$item['sellPrice'].Lang::$colon.Util::formatMoney($sp).'</span>';
961-
962963
// list required reagents
963964
if (isset($xCraft))
964965
$xMisc[] = $xCraft;
965966

966967
if ($xMisc)
967968
$x .= implode('<br />', $xMisc);
968969

970+
if ($sp = $this->curTpl['sellPrice'])
971+
$x .= '<div class="q1 whtt-sellprice">'.Lang::$item['sellPrice'].Lang::$colon.Util::formatMoney($sp).'</div>';
972+
969973
if (!$subOf)
970974
$x .= '</td></tr></table>';
971975

972976
// tooltip scaling
973977
if (!isset($xCraft))
974978
{
975-
$link = [$subOf ? $subOf : $this->id, 1]; // itemid, scaleMinLevel
979+
$link = [$subOf ? $subOf : $this->id, 1]; // itemId, scaleMinLevel
976980
if (isset($this->ssd[$this->id])) // is heirloom
977981
{
978982
array_push($link,
@@ -1885,26 +1889,17 @@ protected function createSQLForValues()
18851889
// upgrade for [form only]
18861890
if (isset($_v['upg']))
18871891
{
1888-
/* notice!
1889-
profiler can send $_GET['upg'] as an array
1890-
this should results in in N listviews-sets (weapons generate more more than one listview per slot) for N items
1891-
<div id="jkbfksdbl4"></div>
1892-
<div id="lkljbjkb574" class="listview"></div>
1893-
var tabsGroups = new Tabs({parent: $WH.ge('jkbfksdbl4')});
1894-
{template: 'item', id: 'ranged', name: 'Ranged', tabs: tabsGroups, parent: 'lkljbjkb574', hideCount: 1, note: $WH.sprintf(LANG.lvnote_viewmoreslot, '', 'sl=15;maxrl=80;si=1;ub=1;cr=161;crs=1;crv=0;upg=45498'), customFilter: fi_filterUpgradeListview, _upgradeIds: [45498], extraCols: fi_getExtraCols(fi_extraCols, 0, 0, 0), onAfterCreate: fi_addUpgradeIndicator, data:[]}
1895-
*/
1896-
18971892
// valid item?
1898-
if (!is_int($_v['upg']))
1893+
if (!is_int($_v['upg']) && !is_array($_v['upg']))
18991894
unset($_v['upg']);
19001895
else
19011896
{
1902-
$_ = DB::Aowow()->selectCell('SELECT slot FROM ?_items WHERE class IN (2, 3, 4) AND id = ?d', $_v['upg']);
1897+
$_ = DB::Aowow()->selectCol('SELECT id as ARRAY_KEY, slot FROM ?_items WHERE class IN (2, 3, 4) AND id IN (?a)', (array)$_v['upg']);
19031898
if ($_ === null)
19041899
unset($_v['upg']);
19051900
else
19061901
{
1907-
$this->formData['form']['upg'] = $_v['upg'];
1902+
$this->formData['form']['upg'] = $_;
19081903
if ($_)
19091904
$parts[] = ['slot', $_];
19101905
}

includes/utilities.php

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function display($tpl)
5959
$tv = &$this->_tpl_vars;
6060

6161
// fetch article & static infobox
62-
if ($tv['type'] && $tv['typeId'])
62+
if (isset($tv['type']) && isset($tv['typeId']))
6363
{
6464
$article = DB::Aowow()->selectRow(
6565
'SELECT SQL_CALC_FOUND_ROWS article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = ?d UNION ALL '.
@@ -70,7 +70,13 @@ public function display($tpl)
7070

7171
if ($article)
7272
{
73-
$tv['article'] = ['text' => Util::jsEscape($article['article'])];
73+
$replace = array(
74+
'script' => 'scr"+"ipt',
75+
'HOST_URL' => HOST_URL,
76+
'STATIC_URL' => STATIC_URL
77+
);
78+
$tv['article'] = ['text' => strtr(Util::jsEscape($article['article']), $replace)];
79+
7480
if (empty($tv['infobox']) && !empty($article['quickInfo']))
7581
$tv['infobox'] = $article['quickInfo'];
7682

@@ -247,7 +253,8 @@ public function saveCache($key, $data, $filter = null)
247253

248254
$file = $this->cache_dir.'data/'.$key;
249255

250-
$cacheData = time()." ".AOWOW_REVISION."\n";
256+
$cacheData = time()." ".AOWOW_REVISION."\n";
257+
$cacheData .= serialize($this->_tpl_vars)."\n"; // todo(med): this should not be nessecary, rework caching
251258
$cacheData .= serialize(str_replace(["\n", "\t"], ['\n', '\t'], $data));
252259

253260
if ($filter)
@@ -273,9 +280,12 @@ public function loadCache($key, &$data, &$filter = null)
273280
if ($expireTime <= time() || $rev < AOWOW_REVISION)
274281
return false;
275282

276-
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[1]));
277-
if (isset($cache[2]))
278-
$filter = unserialize($cache[2]);
283+
$this->_tpl_vars = unserialize($cache[1]);
284+
285+
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[2]));
286+
287+
if (isset($cache[3]))
288+
$filter = unserialize($cache[3]);
279289

280290
return true;
281291
}

index.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@
7777
else
7878
$smarty->error();
7979
break;
80+
case 'whats-new':
81+
case 'searchplugins':
82+
case 'searchbox':
83+
case 'tooltips':
84+
case 'help':
85+
case 'faq':
86+
case 'aboutus':
87+
require 'pages/more.php';
88+
break;
8089
case 'petcalc': // tool: pet talent calculator
8190
$petCalc = true;
8291
case 'talent': // tool: talent calculator

localization/locale_dede.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'ab' => ["J.", "M.", "W.", "Tag", "Std.", "Min.", "Sek.", "Ms."],
1818
),
1919
'main' => array(
20-
'help' => "Hilfe",
2120
'name' => "Name",
2221
'link' => "Link",
2322
'signIn' => "Anmelden / Registrieren",
@@ -107,7 +106,14 @@
107106
'talentCalc' => "Talentrechner",
108107
'petCalc' => "Begleiterrechner",
109108
'chooseClass' => "Wählt eine Klasse",
110-
'chooseFamily' => "Wählt eine Tierart"
109+
'chooseFamily' => "Wählt eine Tierart",
110+
111+
// help
112+
'help' => "Hilfe",
113+
'helpTopics' => array(
114+
"Wie man Kommentare schreibt", "Modellviewer", "Screenshots: Tipps & Tricks", "Gewichtung von Werten",
115+
"Talentrechner", "Gegenstandsvergleich", "Profiler"
116+
)
111117
),
112118
'search' => array(
113119
'search' => "Suche",

localization/locale_enus.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'ab' => ["yr", "mo", "wk", "day", "hr", "min", "sec", "ms"]
1313
),
1414
'main' => array(
15-
'help' => "Help",
1615
'name' => "name",
1716
'link' => "Link",
1817
'signIn' => "Log in / Register",
@@ -94,7 +93,14 @@
9493
'talentCalc' => "Talent Calculator",
9594
'petCalc' => "Hunter Pet Calculator",
9695
'chooseClass' => "Choose a class",
97-
'chooseFamily' => "Choose a pet family"
96+
'chooseFamily' => "Choose a pet family",
97+
98+
// help
99+
'help' => "Help",
100+
'helpTopics' => array(
101+
"Commenting and You", "Model Viewer", "Screenshots: Tips & Tricks", "Stat Weighting",
102+
"Talent Calculator", "Item Comparison", "Profiler"
103+
)
98104
),
99105
'search' => array(
100106
'search' => "Search",

localization/locale_eses.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'ab' => ["año", "mes", "sem", "", "h", "min", "seg", "ms"],
1818
),
1919
'main' => array(
20-
'help' => "Ayuda",
2120
'name' => "nombre",
2221
'link' => "Enlace",
2322
'signIn' => "Iniciar sesión / Registrarse",
@@ -99,7 +98,14 @@
9998
'talentCalc' => "Calculadora de talentos",
10099
'petCalc' => "Calculadora de mascotas",
101100
'chooseClass' => "Escoge una clase",
102-
'chooseFamily' => "Escoge una familia de mascota"
101+
'chooseFamily' => "Escoge una familia de mascota",
102+
103+
// help
104+
'help' => "Ayuda",
105+
'helpTopics' => array(
106+
"Los comentarios y tú", "Visualizador de modelos", "Capturas de pantalla: Sugerencias y trucos", "Medición de atributos",
107+
"Calculadora de talentos", "Comparación de objetos", "Perfiles"
108+
)
103109
),
104110
'search' => array(
105111
'search' => "Búsqueda",

localization/locale_frfr.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
'ab' => ["an", "mo", "sem", "jour", "h", "min", "s", "ms"]
1818
),
1919
'main' => array(
20-
'help' => "Aide",
2120
'name' => "nom",
2221
'link' => "Lien",
2322
'signIn' => "Se connecter / S'inscrire",
@@ -99,7 +98,14 @@
9998
'talentCalc' => "Calculateur de Talents",
10099
'petCalc' => "Calculateur de familiers",
101100
'chooseClass' => "Choisissez une classe",
102-
'chooseFamily' => "Choisissez un familier"
101+
'chooseFamily' => "Choisissez un familier",
102+
103+
// help
104+
'help' => "Aide",
105+
'helpTopics' => array(
106+
"Le guide du commentaire", "Visionneuse 3D", "Captures d'écran : Trucs et astuces", "Échelles de valeurs",
107+
"Calculateur de talents", "Comparaison d'objets", "Profiler"
108+
)
103109
),
104110
'search' => array(
105111
'search' => "Recherche",

0 commit comments

Comments
 (0)