Skip to content

Commit f236d7a

Browse files
committed
implemented grouping by itemlevel and slot for items
group by source won't require much additional work besides adding source to items in the first place search for multiple itemUpgrades are also yet to come
1 parent 1ced59c commit f236d7a

File tree

10 files changed

+270
-142
lines changed

10 files changed

+270
-142
lines changed

includes/kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// load config to constants
5050
$sets = DB::Aowow()->select('SELECT `key` AS ARRAY_KEY, intValue as i, strValue as s FROM ?_config');
5151
foreach ($sets as $k => $v)
52-
define('CFG_'.strtoupper($k), $v['i'] ? intVal($v['i']) : $v['s']);
52+
define('CFG_'.strtoupper($k), $v['s'] ? $v['s'] : intVal($v['i']));
5353

5454
define('STATIC_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1).'/static'); // points js to images & scripts (change here if you want to use a separate subdomain)
5555
define('HOST_URL', substr('http://'.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1)); // points js to executable files

includes/types/basetype.class.php

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ protected function extendQueryOpts($extra) // needs to be called fr
349349
// additional (str)
350350
case 'g': // group by
351351
case 'h': // having
352-
case 'o': // order by
353352
if (!empty($this->queryOpts[$tbl][$module]))
354353
$this->queryOpts[$tbl][$module] .= $value;
355354
else
@@ -364,9 +363,10 @@ protected function extendQueryOpts($extra) // needs to be called fr
364363
$this->queryOpts[$tbl][$module] = $value;
365364

366365
break;
367-
// replacement
366+
// replacement (str)
368367
case 'l': // limit
369368
case 's': // select
369+
case 'o': // order by
370370
$this->queryOpts[$tbl][$module] = $value;
371371
break;
372372
}
@@ -543,7 +543,7 @@ abstract class Filter
543543
private $cndSet = [];
544544

545545
protected $fiData = ['c' => [], 'v' =>[]];
546-
protected $formData = array( // data to fill form fields
546+
protected $formData = array( // data to fill form fields
547547
'form' => [], // base form - unsanitized
548548
'setCriteria' => [], // dynamic criteria list - index checked
549549
'setWeights' => [], // dynamic weights list - index checked
@@ -581,20 +581,8 @@ public function __construct()
581581
}
582582
}
583583

584-
// create get-data
585-
$tmp = [];
586-
foreach (array_merge($this->fiData['c'], $this->fiData['v']) as $k => $v)
587-
{
588-
if ($v === '')
589-
continue;
590-
else if (is_array($v))
591-
$tmp[$k] = $k."=".implode(':', $v);
592-
else
593-
$tmp[$k] = $k."=".$v;
594-
}
595-
596584
// do get request
597-
header('Location: '.HOST_URL.'?'.$_SERVER['QUERY_STRING'].'='.implode(';', $tmp));
585+
header('Location: '.HOST_URL.'?'.$_SERVER['QUERY_STRING'].'='.$this->urlize());
598586
}
599587
// sanitize input and build sql
600588
else if (!empty($_GET['filter']))
@@ -674,6 +662,23 @@ public function __construct()
674662
}
675663
}
676664

665+
public function urlize(array $override = [], array $addCr = [])
666+
{
667+
$_ = [];
668+
foreach (array_merge($this->fiData['c'], $this->fiData['v'], $override) as $k => $v)
669+
{
670+
if (isset($addCr[$k]))
671+
$v = $v ? array_merge((array)$v, (array)$addCr[$k]) : $addCr[$k];
672+
673+
if (is_array($v) && !empty($v))
674+
$_[$k] = $k.'='.implode(':', $v);
675+
else if ($v === '')
676+
$_[$k] = $k.'='.$v;
677+
}
678+
679+
return implode(';', $_);
680+
}
681+
677682
// todo: kill data, that is unexpected or points to wrong indizes
678683
private function evaluateFilter()
679684
{

localization/locale_dede.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@
180180
'modes' => ['Normal / Normal 10', 'Heroisch / Normal 25', 'Heroisch 10', 'Heroisch 25'],
181181
'expansions' => array("Classic", "The Burning Crusade", "Wrath of the Lich King"),
182182
'stats' => array("Stärke", "Beweglichkeit", "Ausdauer", "Intelligenz", "Willenskraft"),
183+
'sources' => array(
184+
null, "Hergestellt", "Drop", "PvP", "Quest", "Händler", "Lehrer", "Entdeckung",
185+
"Einlösung", "Talent", "Startausrüstung", "Ereignis", "Erfolg"
186+
),
183187
'languages' => array(
184188
1 => "Orcisch", 2 => "Darnassisch", 3 => "Taurisch", 6 => "Zwergisch", 7 => "Gemeinsprache", 8 => "Dämonisch", 9 => "Titanisch", 10 => "Thalassisch",
185189
11 => "Drachisch", 12 => "Kalimagisch", 13 => "Gnomisch", 14 => "Trollisch", 33 => "Gossensprache", 35 => "Draeneiisch", 36 => "Zombie", 37 => "Gnomenbinär", 38 => "Goblinbinär"
@@ -614,6 +618,7 @@
614618
'usableBy' => "Benutzbar von",
615619
'buyout' => "Sofortkaufpreis",
616620
'each' => "Stück",
621+
'tabOther' => "Anderes",
617622
'gems' => "Edelsteine",
618623
'socketBonus' => "Sockelbonus",
619624
'socket' => array (

localization/locale_enus.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@
167167
'modes' => ['Normal / Normal 10', 'Heroic / Normal 25', 'Heroic 10', 'Heroic 25'],
168168
'expansions' => array("Classic", "The Burning Crusade", "Wrath of the Lich King"),
169169
'stats' => array("Strength", "Agility", "Stamina", "Intellect", "Spirit"),
170+
'sources' => array(
171+
null, "Crafted", "Drop", "PvP", "Quest", "Vendor", "Trainer", "Discovery",
172+
"Redemption", "Talent", "Starter", "Event", "Achievement"
173+
),
170174
'languages' => array(
171-
1 => "Orcish", 2 => "Darnassian", 3 => "Taurahe", 6 => "Dwarvish", 7 => "Common", 8 => "Demonic", 9 => "Titan", 10 => "Thalassian",
175+
1 => "Orcish", 2 => "Darnassian", 3 => "Taurahe", 6 => "Dwarvish", 7 => "Common", 8 => "Demonic", 9 => "Titan", 10 => "Thalassian",
172176
11 => "Draconic", 12 => "Kalimag", 13 => "Gnomish", 14 => "Troll", 33 => "Gutterspeak", 35 => "Draenei", 36 => "Zombie", 37 => "Gnomish Binary", 38 => "Goblin Binary"
173177
),
174178
'gl' => array(null, "Major", "Minor"),
@@ -199,8 +203,8 @@
199203
"Critter", "Mechanical", "Not specified", "Totem", "Non-combat Pet", "Gas Cloud"
200204
),
201205
'fa' => array(
202-
1 => "Wolf", 2 => "Cat", 3 => "Spider", 4 => "Bear", 5 => "Boar", 6 => "Crocolisk", 7 => "Carrion Bird", 8 => "Crab",
203-
9 => "Gorilla", 11 => "Raptor", 12 => "Tallstrider", 20 => "Scorpid", 21 => "Turtle", 24 => "Bat", 25 => "Hyena", 26 => "Bird of Prey",
206+
1 => "Wolf", 2 => "Cat", 3 => "Spider", 4 => "Bear", 5 => "Boar", 6 => "Crocolisk", 7 => "Carrion Bird", 8 => "Crab",
207+
9 => "Gorilla", 11 => "Raptor", 12 => "Tallstrider", 20 => "Scorpid", 21 => "Turtle", 24 => "Bat", 25 => "Hyena", 26 => "Bird of Prey",
204208
27 => "Wind Serpent", 30 => "Dragonhawk", 31 => "Ravager", 32 => "Warp Stalker", 33 => "Sporebat", 34 => "Nether Ray", 35 => "Serpent", 37 => "Moth",
205209
38 => "Chimaera", 39 => "Devilsaur", 41 => "Silithid", 42 => "Worm", 43 => "Rhino", 44 => "Wasp", 45 => "Core Hound", 46 => "Spirit Beast"
206210
),
@@ -604,6 +608,7 @@
604608
'usableBy' => "Usable by",
605609
'buyout' => "Buyout price",
606610
'each' => "each",
611+
'tabOther' => "Other",
607612
'gems' => "Gems",
608613
'socketBonus' => "Socket Bonus",
609614
'socket' => array(

localization/locale_eses.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
'modes' => ['Normal / Normal 10', 'Heroico / Normal 25', 'Heróico 10', 'Heróico 25'],
173173
'expansions' => array("World of Warcraft", "The Burning Crusade", "Wrath of the Lich King"),
174174
'stats' => array("Fuerza", "Agilidad", "Aguante", "Intelecto", "Espíritu"),
175+
'sources' => array(
176+
null, "Creado", "Encontrado", "JcJ", "Misión", "Vendedor", "Entrenador", "Descubierto",
177+
"Redención", "Talento", "Habilidad Inicial", "Evento", "Logro"
178+
),
175179
'languages' => array(
176180
1 => "Orco", 2 => "Darnassiano", 3 => "Taurahe", 6 => "Enánico", 7 => "Lengua común", 8 => "Demoníaco", 9 => "Titánico", 10 => "Thalassiano",
177181
11 => "Dracónico", 12 => "Kalimag", 13 => "Gnomótico", 14 => "Trol", 33 => "Viscerálico", 35 => "Draenei", 36 => "Zombie", 37 => "Binario gnomo", 38 => "Binario goblin"
@@ -572,6 +576,7 @@
572576
'usableBy' => "Usable por",
573577
'buyout' => "Precio de venta en subasta",
574578
'each' => "cada uno",
579+
'tabOther' => "Otros",
575580
'gems' => "Gemas",
576581
'socketBonus' => "Bono de ranura",
577582
'socket' => array(

localization/locale_frfr.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
'modes' => ['Standard / Normal 10', 'Héroïque / Normal 25', '10 héroïque', '25 héroïque'],
173173
'expansions' => array("Classique", "The Burning Crusade", "Wrath of the Lich King"),
174174
'stats' => array("Force", "Agilité", "Endurance", "Intelligence", "Esprit"),
175+
'sources' => array(
176+
null, "Fabriqué", "Butin", "JcJ", "Quête", "Vendeur", "Maître", "Découverte",
177+
"Échange d'un code", "Talent", "Débutant", "Événement", "Haut fait"
178+
),
175179
'languages' => array(
176180
1 => "Orc", 2 => "Darnassien", 3 => "Taurahe", 6 => "Nain", 7 => "Commun", 8 => "Démoniaque", 9 => "Titan", 10 => "Thalassien",
177181
11 => "Draconique", 12 => "Kalimag", 13 => "Gnome", 14 => "Troll", 33 => "Bas-parler", 35 => "Draeneï", 36 => "Zombie", 37 => "Binaire gnome", 38 => "Binaire gobelin"
@@ -572,6 +576,7 @@
572576
'usableBy' => "Utilisable par",
573577
'buyout' => "Vente immédiate",
574578
'each' => "chacun",
579+
'tabOther' => "Autre",
575580
'gems' => "Gemmes",
576581
'socketBonus' => "Bonus de châsse",
577582
'socket' => array(

localization/locale_ruru.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
'modes' => ['Обычный / 10-норм.', 'Героический / 25-норм.', '10-героич', '25-героич'],
173173
'expansions' => array("World of Warcraft", "The Burning Crusade", "Wrath of the Lich King"),
174174
'stats' => array("к силе", "к ловкости", "к выносливости", "к интеллекту", "к духу"),
175+
'sources' => array(
176+
null, "Ремесло", "Добыча", "PvP", "Задание", "Продавец", "Тренер", "Открытие",
177+
"Рекламная акция", "Талант", "Начальное заклинание", "Мероприятие", "Достижение"
178+
),
175179
'languages' => array(
176180
1 => "орочий", 2 => "дарнасский", 3 => "таурахэ", 6 => "дворфийский", 7 => "всеобщий", 8 => "язык демонов", 9 => "язык титанов", 10 => "талассийский",
177181
11 => "драконий", 12 => "калимаг", 13 => "гномский", 14 => "язык троллей", 33 => "наречие нежити", 35 => "дренейский", 36 => "наречие зомби", 37 => "машинный гномский", 38 => "машинный гоблинский"
@@ -572,6 +576,7 @@
572576
'usableBy' => "Используется (кем)",
573577
'buyout' => "Цена выкупа",
574578
'each' => "каждый",
579+
'tabOther' => "Другое",
575580
'gems' => "Самоцветы",
576581
'socketBonus' => "При соответствии цвета",
577582
'socket' => array(

0 commit comments

Comments
 (0)