mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
implemented Itemset detail page
- while the code and strings are there, no rules have been set concerning availability User: - HTTP_ACCEPT_LANGUAGE may not be set. Compare: - removed some relic code, that, once uppon a time, was used to link virtual item sets with real item sets or something.. Titles: - fixed a few forgotten changes Lang: - hide DND-entries for locks BaseType: - improved getField to automaticaly cast numerics to float - improved __construct to check for numeric instead of int
This commit is contained in:
@@ -5,6 +5,8 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class ItemsetList extends BaseType
|
||||
{
|
||||
use ListviewHelper;
|
||||
|
||||
private $classes = []; // used to build g_classes
|
||||
public $pieceToSet = []; // used to build g_items and search
|
||||
|
||||
@@ -20,13 +22,12 @@ class ItemsetList extends BaseType
|
||||
{
|
||||
$this->templates[$this->id]['classes'] = [];
|
||||
$this->templates[$this->id]['pieces'] = [];
|
||||
|
||||
for ($i = 1; $i < 12; $i++)
|
||||
{
|
||||
if ($this->curTpl['classMask'] & (1 << $i))
|
||||
if ($this->curTpl['classMask'] & (1 << ($i - 1)))
|
||||
{
|
||||
$this->classes[] = $i + 1;
|
||||
$this->templates[$this->id]['classes'][] = $i + 1;
|
||||
$this->classes[] = $i;
|
||||
$this->templates[$this->id]['classes'][] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,10 @@ class User
|
||||
$loc = isset(Util::$localeStrings[$loc]) ? $loc : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]))
|
||||
$loc = 0;
|
||||
else
|
||||
{
|
||||
$loc = strtolower(substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2));
|
||||
switch ($loc) {
|
||||
@@ -131,6 +135,7 @@ class User
|
||||
default: $loc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set
|
||||
self::$localeId = $loc;
|
||||
|
||||
@@ -94,8 +94,6 @@ define('ITEMINFO_SUBITEMS', 0x2);
|
||||
define('ITEMINFO_VENDOR', 0x4);
|
||||
define('ITEMINFO_LOOT', 0x8);
|
||||
|
||||
// Custom Flags for Types
|
||||
|
||||
/*
|
||||
* Game
|
||||
*/
|
||||
@@ -106,6 +104,7 @@ define('CUSTOM_HAS_SCREENSHOT', 0x02000000);
|
||||
define('CUSTOM_HAS_VIDEO', 0x04000000);
|
||||
define('CUSTOM_DISABLED', 0x08000000);
|
||||
define('CUSTOM_SERVERSIDE', 0x10000000);
|
||||
define('CUSTOM_UNAVAILABLE', 0x20000000);
|
||||
|
||||
// Custom Flags (per type)
|
||||
define('SPELL_CU_TALENT', 0x0001); // passive talent
|
||||
|
||||
@@ -117,7 +117,7 @@ abstract class BaseType
|
||||
$op = (isset($c[2]) && $c[2] == '!') ? 'NOT LIKE' : 'LIKE';
|
||||
$val = '"%'.$val.'%"';
|
||||
}
|
||||
else if (is_int($c[1]))
|
||||
else if (is_numeric($c[1]))
|
||||
{
|
||||
$op = (isset($c[2]) && $c[2] == '!') ? '<>' : '=';
|
||||
$val = Util::sqlEscape($c[1]);
|
||||
@@ -203,10 +203,11 @@ abstract class BaseType
|
||||
if (!$this->curTpl || (!$localized && !isset($this->curTpl[$field])))
|
||||
return '';
|
||||
|
||||
if (!$localized)
|
||||
return $this->curTpl[$field];
|
||||
else
|
||||
if ($localized)
|
||||
return Util::localizedString($this->curTpl, $field);
|
||||
|
||||
$value = $this->curTpl[$field];
|
||||
return is_numeric($value) ? floatVal($value) : $value;
|
||||
}
|
||||
|
||||
public function getMatches()
|
||||
@@ -307,6 +308,7 @@ trait listviewHelper
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Lang
|
||||
{
|
||||
public static $main;
|
||||
@@ -324,6 +326,7 @@ class Lang
|
||||
public static $maps;
|
||||
public static $npc;
|
||||
public static $pet;
|
||||
public static $quest;
|
||||
public static $spell;
|
||||
public static $talent;
|
||||
public static $title;
|
||||
@@ -376,6 +379,9 @@ class Lang
|
||||
}
|
||||
else if ($lock['type'.$i] == 2) // opened by skill
|
||||
{
|
||||
if (in_array($prop, [6, 7, 15, 19])) // dnd stuff
|
||||
continue;
|
||||
|
||||
$txt = DB::Aowow()->selectRow('SELECT * FROM ?_locktype WHERE id = ?d', $prop); // todo (low): convert to static text
|
||||
$name = Util::localizedString($txts, 'name');
|
||||
if (!$name)
|
||||
@@ -385,7 +391,7 @@ class Lang
|
||||
$name .= ' ('.$rnk.')';
|
||||
}
|
||||
|
||||
$locks[] = sprintf(Lang::$game['requires'], $n);
|
||||
$locks[$lock['type'.$i] == 1 ? $i : -$i] = sprintf(Lang::$game['requires'], $name);
|
||||
}
|
||||
|
||||
return $locks;
|
||||
@@ -479,9 +485,6 @@ class Lang
|
||||
if ($classMask == CLASS_MASK_ALL) // available to all classes
|
||||
return false;
|
||||
|
||||
if (!$classMask) // no restrictions left
|
||||
return false;
|
||||
|
||||
$tmp = [];
|
||||
$i = 1;
|
||||
|
||||
@@ -505,9 +508,6 @@ class Lang
|
||||
if ($raceMask == RACE_MASK_ALL) // available to all races (we don't display 'both factions')
|
||||
return false;
|
||||
|
||||
if (!$raceMask) // no restrictions left (we don't display 'both factions')
|
||||
return false;
|
||||
|
||||
$tmp = [];
|
||||
$side = 0;
|
||||
$i = 1;
|
||||
|
||||
@@ -12,6 +12,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
$lang = array(
|
||||
// page variables
|
||||
'main' => array(
|
||||
'name' => "Name",
|
||||
'link' => "Link",
|
||||
'signIn' => "Anmelden",
|
||||
'jsError' => "Stelle bitte sicher, dass JavaScript aktiviert ist.",
|
||||
@@ -21,7 +22,6 @@ $lang = array(
|
||||
'timeSQL' => "Zeit für MySQL-Queries",
|
||||
'noJScript' => "<b>Diese Seite macht ausgiebigen Gebrauch von JavaScript.</b><br />Bitte <a href=\"https://www.google.com/support/adsense/bin/answer.py?answer=12654\" target=\"_blank\">aktiviert JavaScript</a> in Eurem Browser.",
|
||||
'profiles' => "Deine Charaktere",
|
||||
'links' => "Links",
|
||||
'pageNotFound' => "Diese|Dieser|Dieses %s existiert nicht.", // todo: dämliche Fälle...
|
||||
'gender' => "Geschlecht",
|
||||
'sex' => [null, 'Mann', 'Frau'],
|
||||
@@ -70,11 +70,16 @@ $lang = array(
|
||||
'refineSearch' => "Tipp: Präzisiere deine Suche mit Durchsuchen einer <a href=\"javascript:;\" id=\"fi_subcat\">Unterkategorie</a>.",
|
||||
|
||||
// infobox
|
||||
'name' => "Name",
|
||||
'unavailable' => "Nicht für Spieler verfügbar",
|
||||
'disabled' => "Deaktiviert",
|
||||
'disabledHint' => "Kann nicht erhalten oder abgeschlossen werden.",
|
||||
'serverside' => "Serverseitig",
|
||||
'serversideHint' => "Diese Informationen sind nicht im Client enthalten und wurden durch Sniffing zusammengetragen und/oder erraten.",
|
||||
'serversideHint' => "Diese Informationen sind nicht im Client enthalten und wurden gesnifft und/oder erraten.",
|
||||
|
||||
// red buttons
|
||||
'links' => "Links",
|
||||
'compare' => "Vergleichen",
|
||||
'view3D' => "3D-Ansicht"
|
||||
),
|
||||
'search' => array(
|
||||
'search' => "Suche",
|
||||
@@ -286,6 +291,15 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> ist das <b>%s</b>. Es enthält %s Teile.",
|
||||
'_descTagless' => "<b>%s</b> ist ein Ausrüstungsset, das %s Teile enthält.",
|
||||
'_setBonuses' => "Setboni",
|
||||
'_conveyBonus' => "Das Tragen mehrerer Gegenstände aus diesem Set gewährt Eurem Charakter Boni.",
|
||||
'_pieces' => "Teile",
|
||||
'_unavailable' => "Dieses Ausrüstungsset ist nicht für Spieler verfügbar.",
|
||||
'_type' => "Art",
|
||||
'_tag' => "Tag",
|
||||
|
||||
'notes' => array(
|
||||
null, "Dungeon-Set 1", "Dungeon-Set 2", "Tier 1 Raid-Set",
|
||||
"Tier 2 Raid-Set", "Tier 3 Raid-Set", "Level 60 PvP-Set (Rar)", "Level 60 PvP-Set (Rar, alt)",
|
||||
@@ -297,7 +311,7 @@ $lang = array(
|
||||
"Arena-Set Saison 7", "Tier 10 Raid-Set", "Arena-Set Saison 8"
|
||||
),
|
||||
'types' => array(
|
||||
null, "Stoff", "Leder", "Schwere R\u00fcstung", "Platte", "Dolch", "Ring",
|
||||
null, "Stoff", "Leder", "Schwere Rüstung", "Platte", "Dolch", "Ring",
|
||||
"Faustwaffe", "Einhandaxt", "Einhandstreitkolben", "Einhandschwert", "Schmuck", "Amulett"
|
||||
)
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
$lang = array(
|
||||
// page variables
|
||||
'main' => array(
|
||||
'name' => "Name",
|
||||
'link' => "Link",
|
||||
'signIn' => "Sign in",
|
||||
'jsError' => "Please make sure you have javascript enabled.",
|
||||
@@ -16,7 +17,6 @@ $lang = array(
|
||||
'timeSQL' => "Time of MySQL queries",
|
||||
'noJScript' => "<b>This site makes extensive use of JavaScript.</b><br />Please <a href=\"https://www.google.com/support/adsense/bin/answer.py?answer=12654\" target=\"_blank\">enable JavaScript</a> in your browser.",
|
||||
'profiles' => "Your Characters",
|
||||
'links' => "Links",
|
||||
'pageNotFound' => "This %s doesn't exist.",
|
||||
'gender' => "Gender",
|
||||
'sex' => [null, 'Male', 'Female'],
|
||||
@@ -65,11 +65,16 @@ $lang = array(
|
||||
'refineSearch' => "Tip: Refine your search by browsing a <a href=\"javascript:;\" id=\"fi_subcat\">subcategory</a>.",
|
||||
|
||||
// infobox
|
||||
'name' => "Name",
|
||||
'unavailable' => "Not available to players",
|
||||
'disabled' => "Disabled",
|
||||
'disabledHint' => "Cannot be attained or completed",
|
||||
'serverside' => "Serverside",
|
||||
'serversideHint' => "These informations are not in the Client and have been provided by sniffing and/or guessing.",
|
||||
|
||||
// red buttons
|
||||
'links' => "Links",
|
||||
'compare' => "Compare",
|
||||
'view3D' => "View in 3D"
|
||||
),
|
||||
'search' => array(
|
||||
'search' => "Search",
|
||||
@@ -281,6 +286,15 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> is the <b>%s</b>. It contains %s pieces.",
|
||||
'_descTagless' => "<b>%s</b> is an item set that contains %s pieces.",
|
||||
'_setBonuses' => "Set Bonuses",
|
||||
'_conveyBonus' => "Wearing more pieces of this set will convey bonuses to your character.",
|
||||
'_pieces' => "pieces",
|
||||
'_unavailable' => "This item set is not available to players.",
|
||||
'_type' => "Type",
|
||||
'_tag' => "Tag",
|
||||
|
||||
'notes' => array(
|
||||
null, "Dungeon Set 1", "Dungeon Set 2", "Tier 1 Raid Set",
|
||||
"Tier 2 Raid Set", "Tier 3 Raid Set", "Level 60 PvP Rare Set", "Level 60 PvP Rare Set (Old)",
|
||||
|
||||
@@ -12,6 +12,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
$lang = array(
|
||||
// page variables
|
||||
'main' => array(
|
||||
'name' => "Nombre",
|
||||
'link' => "Enlace",
|
||||
'signIn' => "Iniciar sesión",
|
||||
'jsError' => "Por favor, asegúrese de que ha habilitado javascript.",
|
||||
@@ -21,7 +22,6 @@ $lang = array(
|
||||
'timeSQL' => "El tiempo para las consultas de MySQL",
|
||||
'noJScript' => "<b>Este sitio hace uso intenso de JavaScript.</b><br />Por favor <a href=\"https://www.google.com/support/adsense/bin/answer.py?answer=12654\" target=\"_blank\">habilita JavaScript</a> en tu navegador.",
|
||||
'profiles' => "Tus personajes", // translate.google :x
|
||||
'links' => "Enlaces",
|
||||
'pageNotFound' => "Este %s no existe.",
|
||||
'gender' => "Género",
|
||||
'sex' => [null, 'Hombre', 'Mujer'],
|
||||
@@ -62,11 +62,16 @@ $lang = array(
|
||||
'refineSearch' => "Sugerencia: Refina tu búsqueda llendo a una <a href=\"javascript:;\" id=\"fi_subcat\">subcategoría</a>.",
|
||||
|
||||
// infobox
|
||||
'name' => "Nombre",
|
||||
'unavailable' => "No está disponible a los jugadores",
|
||||
'disabled' => "[Disabled]",
|
||||
'disabledHint' => "[Cannot be attained or completed]",
|
||||
'serverside' => "[Serverside]",
|
||||
'serversideHint' => "[These informations are not in the Client and have been provided by sniffing and/or guessing.]",
|
||||
|
||||
// red buttons
|
||||
'links' => "Enlaces",
|
||||
'compare' => "Comparar",
|
||||
'view3D' => "Ver en 3D"
|
||||
),
|
||||
'search' => array(
|
||||
'search' => "Búsqueda",
|
||||
@@ -239,6 +244,15 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> es el <b>%s</b>. Contiene %s piezas.",
|
||||
'_descTagless' => "<b>%s</b> es un conjunto de objetos que tiene %s piezas.",
|
||||
'_setBonuses' => "Bonificación de conjunto",
|
||||
'_conveyBonus' => "Tener puestos mas objetos de este conjunto le aplicará una bonificación a tu personaje.",
|
||||
'_pieces' => "piezas",
|
||||
'_unavailable' => "Este conjunto de objetos no está disponible para jugadores.",
|
||||
'_type' => "Tipo",
|
||||
'_tag' => "Etiqueta",
|
||||
|
||||
'notes' => array(
|
||||
null, "Set de mazmorra 1", "Set de mazmorra 2", "Set de banda tier 1",
|
||||
"Set de banda tier 2", "Set de banda tier 3", "Set JcJ nivel 60 superior", "Set JcJ nivel 60 superior (obsoleto)",
|
||||
|
||||
@@ -12,6 +12,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
$lang = array(
|
||||
// page variables
|
||||
'main' => array(
|
||||
'name' => "Nom",
|
||||
'link' => "Lien",
|
||||
'signIn' => "S'enregistrer",
|
||||
'jsError' => "S'il vous plait, assurez vous d'avoir le javascript autorisé.",
|
||||
@@ -21,7 +22,6 @@ $lang = array(
|
||||
'timeSQL' => "Temps d'exécution des requêtes SQL",
|
||||
'noJScript' => "<b>Ce site requiert JavaScript pour fonctionner.</b><br />Veuillez <a href=\"https://www.google.com/support/adsense/bin/answer.py?answer=12654\" target=\"_blank\">activer JavaScript</a> dans votre navigateur.",
|
||||
'profiles' => "Vos personnages", // translate.google :x
|
||||
'links' => "Liens",
|
||||
'pageNotFound' => "Ce %s n'existe pas.",
|
||||
'gender' => "Genre",
|
||||
'sex' => [null, 'Homme', 'Femme'],
|
||||
@@ -62,11 +62,16 @@ $lang = array(
|
||||
'refineSearch' => "Astuce : Affinez votre recherche en utilisant une <a href=\"javascript:;\" id=\"fi_subcat\">sous-catégorie</a>.",
|
||||
|
||||
// infobox
|
||||
'name' => "Nom",
|
||||
'unavailable' => "Non disponible aux joueurs",
|
||||
'disabled' => "[Disabled]",
|
||||
'disabledHint' => "[Cannot be attained or completed]",
|
||||
'serverside' => "[Serverside]",
|
||||
'serversideHint' => "[These informations are not in the Client and have been provided by sniffing and/or guessing.]",
|
||||
|
||||
// red buttons
|
||||
'links' => "Liens",
|
||||
'compare' => "Comparer",
|
||||
'view3D' => "Voir en 3D"
|
||||
),
|
||||
'search' => array(
|
||||
'search' => "Recherche",
|
||||
@@ -238,6 +243,15 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> est le <b>%s</b>. Il contient %s pièces.",
|
||||
'_descTagless' => "<b>%s</b> est un ensemble d'objet qui contient %s pièces.",
|
||||
'_setBonuses' => "Bonus de l'ensemble",
|
||||
'_conveyBonus' => "Plus d'objets de cet ensemble sont équipés, plus votre personnage aura des bonus de caractéristiques.",
|
||||
'_pieces' => "pièces",
|
||||
'_unavailable' => "Cet objet n'est plus disponible aux joueurs.",
|
||||
'_type' => "Type",
|
||||
'_tag' => "Étiquette",
|
||||
|
||||
'notes' => array(
|
||||
null, "Ensemble de donjon 1", "Ensemble de donjon 2", "Ensemble de raid palier 1",
|
||||
"Ensemble de raid palier 2", "Ensemble de raid palier 3", "Ensemble JcJ niveau 60 supérieur", "Ensemble JcJ niveau 60 supérieur (désuet)",
|
||||
|
||||
@@ -12,6 +12,7 @@ if (!defined('AOWOW_REVISION'))
|
||||
$lang = array(
|
||||
// page variables
|
||||
'main' => array(
|
||||
'name' => "Название",
|
||||
'link' => "Ссылка",
|
||||
'signIn' => "Войти",
|
||||
'jsError' => "Для работы этого сайта необходим JavaScript.",
|
||||
@@ -21,7 +22,6 @@ $lang = array(
|
||||
'timeSQL' => "Время выполнения MySQL запросов",
|
||||
'noJScript' => "<b>Данный сайт активно использует технологию JavaScript.</b><br />Пожалуйста, <a href=\"https://www.google.com/support/adsense/bin/answer.py?answer=12654\" target=\"_blank\">Включите JavaScript</a> в вашем браузере.",
|
||||
'profiles' => "Ваши персонажи", // translate.google :x
|
||||
'links' => "Ссылки",
|
||||
'pageNotFound' => "Такое %s не существует.",
|
||||
'gender' => "Пол",
|
||||
'sex' => [null, 'Мужчина', 'Женщина'],
|
||||
@@ -62,11 +62,16 @@ $lang = array(
|
||||
'refineSearch' => "Совет: Уточните поиск, добавив <a href=\"javascript:;\" id=\"fi_subcat\">подкатегорию</a>.",
|
||||
|
||||
// infobox
|
||||
'name' => "Название",
|
||||
'unavailable' => "Недоступно игрокам",
|
||||
'disabled' => "[Disabled]",
|
||||
'disabledHint' => "[Cannot be attained or completed]",
|
||||
'serverside' => "[Serverside]",
|
||||
'serversideHint' => "[These informations are not in the Client and have been provided by sniffing and/or guessing.]",
|
||||
|
||||
// red buttons
|
||||
'links' => "Ссылки",
|
||||
'compare' => "Сравнить",
|
||||
'view3D' => "Посмотреть в 3D"
|
||||
),
|
||||
'search' => array(
|
||||
'search' => "Поиск",
|
||||
@@ -238,6 +243,15 @@ $lang = array(
|
||||
)
|
||||
),
|
||||
'itemset' => array(
|
||||
'_desc' => "<b>%s</b> — <b>%s</b>. Он состоит из %s предметов.",
|
||||
'_descTagless' => "<b>%s</b> — набор из %s предметов.",
|
||||
'_setBonuses' => "Бонус за комплект",
|
||||
'_conveyBonus' => "Ношение большего числа предметов из этого комплекта предоставит бонусы для вашего персонажа.",
|
||||
'_pieces' => "частей",
|
||||
'_unavailable' => "Этот набор предметов не доступен игрокам.",
|
||||
'_type' => "Тип",
|
||||
'_tag' => "Тэг",
|
||||
|
||||
'notes' => array(
|
||||
null, "Комплект подземелий 1", "Комплект подземелий 2", "Рейдовый комплект Tier 1",
|
||||
"Рейдовый комплект Tier 2", "Рейдовый комплект Tier 3", "PvP Комплект для 60 уровня", "PvP Комплект для 60 уровня (старая версия)",
|
||||
|
||||
@@ -3,10 +3,8 @@
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('invalid access');
|
||||
|
||||
$pageData = array(
|
||||
'items' => null,
|
||||
'summary' => '[]'
|
||||
);
|
||||
|
||||
$pageData = ['items' => null, 'summary' => '[]'];
|
||||
$compareString = '';
|
||||
|
||||
// prefer $_GET over $_COOKIE
|
||||
@@ -31,18 +29,8 @@ if ($compareString)
|
||||
$params[] = 0;
|
||||
|
||||
$outString[] = $params;
|
||||
|
||||
// MATCH() AGAINST() for integers would be nice...
|
||||
$res = DB::Aowow()->SelectRow(
|
||||
"SELECT id FROM ?_itemset WHERE
|
||||
item1 = ? OR item2 = ? OR item3 = ? OR item4 = ? OR item5 = ? OR
|
||||
item6 = ? OR item7 = ? OR item8 = ? OR item9 = ? OR item10 = ?",
|
||||
(int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0], (int)$params[0]
|
||||
);
|
||||
|
||||
if ($res)
|
||||
$piecesAssoc[(int)$params[0]] = $res['id'];
|
||||
}
|
||||
|
||||
$outSet[] = $outString;
|
||||
}
|
||||
$pageData['summary'] = json_encode($outSet, JSON_NUMERIC_CHECK);
|
||||
@@ -65,7 +53,7 @@ if ($compareString)
|
||||
}
|
||||
|
||||
|
||||
$page = array(
|
||||
$smarty->updatePageVars(array(
|
||||
'title' => Lang::$compare['compare'],
|
||||
'tab' => 1,
|
||||
'reqCSS' => array(
|
||||
@@ -79,10 +67,7 @@ $page = array(
|
||||
array('path' => 'template/js/swfobject.js'),
|
||||
array('path' => '?data=weight-presets.gems.enchants.itemsets'),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
$smarty->updatePageVars($page);
|
||||
));
|
||||
$smarty->assign('lvData', $pageData);
|
||||
$smarty->assign('lang', array_merge(Lang::$main, Lang::$compare));
|
||||
$smarty->assign('mysql', DB::Aowow()->getStatistics());
|
||||
|
||||
260
pages/itemset.php
Normal file
260
pages/itemset.php
Normal file
@@ -0,0 +1,260 @@
|
||||
<?php
|
||||
|
||||
if (!defined('AOWOW_REVISION'))
|
||||
die('illegal access');
|
||||
|
||||
|
||||
require 'includes/class.community.php';
|
||||
|
||||
$id = intVal($pageParam);
|
||||
$path = [0, 2];
|
||||
|
||||
$cacheKeyPage = implode('_', [CACHETYPE_PAGE, TYPE_ITEMSET, $id, -1, User::$localeId]);
|
||||
|
||||
if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
{
|
||||
$iSet = new ItemsetList(array(['id', $id]));
|
||||
if ($iSet->error)
|
||||
$smarty->notFound(Lang::$game['itemset']);
|
||||
|
||||
$iSet->reset();
|
||||
|
||||
$ta = $iSet->getField('contentGroup');
|
||||
$ty = $iSet->getField('type');
|
||||
$ev = $iSet->getField('holidayId');
|
||||
$sk = $iSet->getField('skillId');
|
||||
$mask = $iSet->getField('classMask');
|
||||
$rLvl = $iSet->getField('reqLevel');
|
||||
$name = $iSet->getField('name', true);
|
||||
$cnt = count($iSet->getField('pieces'));
|
||||
$unav = $iSet->getField('cuFlags') & CUSTOM_UNAVAILABLE;
|
||||
|
||||
$infobox = [];
|
||||
// unavailable (todo (low): set data)
|
||||
if ($unav)
|
||||
$infobox[] = Lang::$main['unavailable'];
|
||||
|
||||
// holiday
|
||||
if ($ev)
|
||||
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$ev.']'.WorldEventList::getName($ev).'[/url]';
|
||||
|
||||
// itemLevel
|
||||
if ($min = $iSet->getField('minLevel'))
|
||||
{
|
||||
$foo = Lang::$game['level'].Lang::$colon.$min;
|
||||
$max = $iSet->getField('maxLevel');
|
||||
|
||||
if ($min < $max)
|
||||
$foo .= ' - '.$max;
|
||||
|
||||
$infobox[] = $foo;
|
||||
}
|
||||
|
||||
// class
|
||||
if ($mask)
|
||||
{
|
||||
$foo = [];
|
||||
for ($i = 0; $i < 11; $i++)
|
||||
if ($mask & (1 << $i))
|
||||
$foo[] = (!fMod(count($foo) + 1, 3) ? '\n' : null) . '[class='.($i + 1).']';
|
||||
|
||||
$t = count($foo) == 1 ? Lang::$game['class'] : Lang::$game['classes'];
|
||||
$infobox[] = Util::ucFirst($t).Lang::$colon.implode(', ', $foo);
|
||||
}
|
||||
|
||||
// required level
|
||||
if ($rLvl)
|
||||
$infobox[] = sprintf(Lang::$game['reqLevel'], $rLvl);
|
||||
|
||||
// type
|
||||
if ($ty)
|
||||
$infobox[] = Lang::$itemset['_type'].lang::$colon.Lang::$itemset['types'][$ty];
|
||||
|
||||
// tag
|
||||
if ($ta)
|
||||
$infobox[] = Lang::$itemset['_tag'].Lang::$colon.'[url=?itemsets&filter=ta='.$ta.']'.Lang::$itemset['notes'][$ta].'[/url]';
|
||||
|
||||
// pieces + Summary
|
||||
$pieces = [];
|
||||
$eqList = [];
|
||||
$compare = [];
|
||||
$iList = new ItemList(array(['i.entry', array_keys($iSet->pieceToSet)]));
|
||||
$data = $iList->getListviewData(ITEMINFO_SUBITEMS | ITEMINFO_JSON);
|
||||
foreach ($data as $iId => $item)
|
||||
{
|
||||
while ($iList->id != $iId)
|
||||
$iList->iterate();
|
||||
|
||||
$slot = $iList->getField('InventoryType');
|
||||
$disp = $iList->getField('displayid');
|
||||
if ($slot && $disp)
|
||||
$eqList[] = [$slot, $disp];
|
||||
|
||||
$compare[] = $iId;
|
||||
|
||||
$pieces[] = array(
|
||||
'id' => $iId,
|
||||
'name' => $iList->getField('name', true),
|
||||
'quality' => $iList->getField('Quality'),
|
||||
'icon' => $iList->getField('icon'),
|
||||
'json' => json_encode($item, JSON_NUMERIC_CHECK)
|
||||
);
|
||||
}
|
||||
|
||||
// spells
|
||||
$foo = [];
|
||||
$spells = [];
|
||||
for ($i = 1; $i < 9; $i++)
|
||||
{
|
||||
$spl = $iSet->getField('spell'.$i);
|
||||
$qty = $iSet->getField('bonus'.$i);
|
||||
|
||||
if ($spl && $qty)
|
||||
{
|
||||
$foo[] = $spl;
|
||||
$spells[] = array( // cant use spell as index, would change order
|
||||
'id' => $spl,
|
||||
'bonus' => $qty,
|
||||
'desc' => ''
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// sort by required pieces ASC
|
||||
usort($spells, function($a, $b) {
|
||||
if ($a['bonus'] == $b['bonus'])
|
||||
return 0;
|
||||
|
||||
return ($a['bonus'] > $b['bonus']) ? 1 : -1;
|
||||
});
|
||||
|
||||
$setSpells = new SpellList(array(['s.id', $foo]));
|
||||
foreach ($spells as &$s)
|
||||
{
|
||||
while ($setSpells->id != $s['id'])
|
||||
$setSpells->iterate();
|
||||
|
||||
$s['desc'] = $setSpells->parseText('description');
|
||||
}
|
||||
|
||||
// path
|
||||
if ($mask)
|
||||
{
|
||||
for ($i = 0; $i < 11; $i++)
|
||||
{
|
||||
if ($mask & (1 << $i))
|
||||
{
|
||||
if ($mask == (1 << $i)) // only bit set, add path
|
||||
$path[] = $i;
|
||||
|
||||
break; // break anyway (cant set multiple classes)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$skill = '';
|
||||
if ($sk)
|
||||
{
|
||||
// todo (med): kill this Lang::monstrosity with Skills
|
||||
$spellLink = sprintf('<a href="?spells=11.%s">%s</a> (%s)', $sk, Lang::$spell['cat'][11][$sk][0], $iSet->getField('skillLevel'));
|
||||
$skill = ' – <small><b>'.sprintf(Lang::$game['requires'], $spellLink).'</b></small>';
|
||||
}
|
||||
|
||||
$pageData = array(
|
||||
'title' => $name, // for header
|
||||
'path' => $path,
|
||||
'infobox' => $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null,
|
||||
'article' => null, // todo (med): hmm, move to $smarty..?
|
||||
'pieces' => $pieces,
|
||||
'spells' => $spells,
|
||||
'view3D' => json_encode($eqList, JSON_NUMERIC_CHECK),
|
||||
'compare' => array(
|
||||
'qty' => $cnt,
|
||||
'items' => $compare,
|
||||
'level' => $rLvl
|
||||
),
|
||||
'page' => array(
|
||||
'name' => $name, // for page content
|
||||
'id' => $id,
|
||||
'bonusExt' => $skill,
|
||||
'description' => $ta ? sprintf(Lang::$itemset['_desc'], $name, Lang::$itemset['notes'][$ta], $cnt) : sprintf(Lang::$itemset['_descTagless'], $name, $cnt),
|
||||
'unavailable' => $unav
|
||||
)
|
||||
);
|
||||
|
||||
$iSet->addGlobalsToJscript($pageData);
|
||||
|
||||
// related sets (priority: 1: similar tag + class; 2: has event; 3: no tag + similar type, 4: similar type + profession)
|
||||
$rel = [];
|
||||
|
||||
if ($ta && count($path) == 3)
|
||||
{
|
||||
$rel[] = ['id', $id, '!'];
|
||||
$rel[] = ['classMask', 1 << end($path), '&'];
|
||||
$rel[] = ['contentGroup', (int)$ta];
|
||||
}
|
||||
else if ($ev)
|
||||
{
|
||||
$rel[] = ['id', $id, '!'];
|
||||
$rel[] = ['holidayId', 0, '!'];
|
||||
}
|
||||
else if ($sk)
|
||||
{
|
||||
$rel[] = ['id', $id, '!'];
|
||||
$rel[] = ['contentGroup', 0];
|
||||
$rel[] = ['skillId', 0, '!'];
|
||||
$rel[] = ['type', $ty];
|
||||
}
|
||||
else if (!$ta && $ty)
|
||||
{
|
||||
$rel[] = ['id', $id, '!'];
|
||||
$rel[] = ['contentGroup', 0];
|
||||
$rel[] = ['type', $ty];
|
||||
$rel[] = ['skillId', 0];
|
||||
}
|
||||
|
||||
if ($rel)
|
||||
{
|
||||
$relSets = new ItemsetList($rel);
|
||||
if (!$relSets->error)
|
||||
{
|
||||
$pageData['related'] = array(
|
||||
'data' => $relSets->getListviewData(),
|
||||
'params' => array(
|
||||
'id' => 'see-also',
|
||||
'name' => '$LANG.tab_seealso',
|
||||
'tabs' => '$tabsRelated'
|
||||
)
|
||||
);
|
||||
|
||||
$mask = $relSets->hasDiffFields(['classMask']);
|
||||
if (!$mask)
|
||||
$pageData['related']['params']['hiddenCols'] = "$['classes']";
|
||||
|
||||
$relSets->addGlobalsToJscript($pageData);
|
||||
}
|
||||
}
|
||||
|
||||
$smarty->saveCache($cacheKeyPage, $pageData);
|
||||
}
|
||||
|
||||
$smarty->updatePageVars(array(
|
||||
'title' => $pageData['title']." - ".Util::ucfirst(Lang::$game['itemset']),
|
||||
'path' => json_encode($pageData['path'], JSON_NUMERIC_CHECK),
|
||||
'tab' => 0, // for g_initHeader($tab)
|
||||
'type' => TYPE_ITEMSET, // 4:Itemset
|
||||
'typeId' => $id,
|
||||
'reqJS' => array(
|
||||
array('path' => 'template/js/Summary.js', 'conditional' => false),
|
||||
array('path' => 'template/js/swfobject.js', 'conditional' => false)
|
||||
)
|
||||
));
|
||||
|
||||
|
||||
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEMSET, $id)); // comments, screenshots, videos
|
||||
$smarty->assign('lang', array_merge(Lang::$main, Lang::$itemset));
|
||||
$smarty->assign('lvData', $pageData);
|
||||
$smarty->assign('mysql', DB::Aowow()->getStatistics());
|
||||
$smarty->display('itemset.tpl');
|
||||
|
||||
?>
|
||||
@@ -32,7 +32,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
$infobox[] = Lang::$main['gender'].Lang::$colon.'[span class='.($g == 2 ? 'female' : 'male').'-icon]'.Lang::$main['sex'][$g].'[/span]';
|
||||
|
||||
if ($e = $title->getField('eventId'))
|
||||
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$e.']'.WorldEvent::getName($e).'[/url]';
|
||||
$infobox[] = Lang::$game['eventShort'].Lang::$colon.'[url=?event='.$e.']'.WorldEventList::getName($e).'[/url]';
|
||||
|
||||
$pageData = array(
|
||||
'page' => array(
|
||||
@@ -58,7 +58,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
'id' => 'reward-from-quest',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'hiddenCols' => "$['experience', 'money']",
|
||||
'visibleCols' => "$['category']"
|
||||
'visibleCols' => "$['category']",
|
||||
'tabs' => '$tabsRelated'
|
||||
);
|
||||
break;
|
||||
case 12:
|
||||
@@ -71,7 +72,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
|
||||
'id' => 'reward-from-achievement',
|
||||
'name' => '$LANG.tab_rewardfrom',
|
||||
'visibleCols' => "$['category']",
|
||||
'sort' => "$['reqlevel', 'name']"
|
||||
'sort' => "$['reqlevel', 'name']",
|
||||
'tabs' => '$tabsRelated'
|
||||
);
|
||||
break;
|
||||
// case 13:
|
||||
|
||||
94
template/itemset.tpl
Normal file
94
template/itemset.tpl
Normal file
@@ -0,0 +1,94 @@
|
||||
{include file='header.tpl'}
|
||||
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
{if !empty($announcements)}
|
||||
{foreach from=$announcements item=item}
|
||||
{include file='bricks/announcement.tpl' an=$item}
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<script type="text/javascript">
|
||||
{include file='bricks/community.tpl'}
|
||||
var g_pageInfo = {ldelim}type: {$page.type}, typeId: {$page.typeId}, name: '{$lvData.page.name|escape:"quotes"}'{rdelim};
|
||||
g_initPath({$page.path});
|
||||
</script>
|
||||
|
||||
{include file='bricks/infobox.tpl'}
|
||||
|
||||
<div class="text">
|
||||
<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({ldelim} type: 4, typeId: {$lvData.page.id} {rdelim});"><em><b><i>{$lang.links}</i></b><span>{$lang.links}</span></em></a>
|
||||
<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({ldelim} type: 4, typeId: {$lvData.page.id}, equipList: {$lvData.view3D} {rdelim})"><em><b><i>{$lang.view3D}</i></b><span>{$lang.view3D}</span></em></a>
|
||||
<a href="javascript:;" class="button-red" onclick="this.blur(); su_addToSaved('{':'|implode:$lvData.compare.items}', {$lvData.compare.qty})"><em><b><i>{$lang.compare}</i></b><span>{$lang.compare}</span></em></a>
|
||||
<a href="{if $lvData.page.id > 0}http://old.wowhead.com/?{$query[0]}={$query[1]}{else}javascript:;{/if}" class="button-red{if $lvData.page.id < 0} button-red-disabled{/if}"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
|
||||
<h1>{$lvData.page.name}</h1>
|
||||
|
||||
{if $lvData.article}
|
||||
<div id="article-generic" class="left"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
Markup.printHtml("{$lvData.article}", "article-generic", {ldelim}mode:Markup.MODE_ARTICLE{rdelim});
|
||||
//]]></script>
|
||||
{/if}
|
||||
|
||||
{$lvData.page.description}
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
{section name=i loop=$lvData.pieces}
|
||||
g_items.add({$lvData.pieces[i].id}, {ldelim}name_{$user.language}:'{$lvData.pieces[i].name|escape:'javascript'}', quality:{$lvData.pieces[i].quality}, icon:'{$lvData.pieces[i].icon}', jsonequip:{$lvData.pieces[i].json}{rdelim});
|
||||
{/section}
|
||||
//]]></script>
|
||||
|
||||
<table class="iconlist">
|
||||
{section name=i loop=$lvData.pieces}
|
||||
<tr><th align="right" id="iconlist-icon{$smarty.section.i.index + 1}"></th><td><span class="q{$lvData.pieces[i].quality}"><a href="?item={$lvData.pieces[i].id}">{$lvData.pieces[i].name}</a></span></td></tr>
|
||||
{/section}
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
{section name=i loop=$lvData.pieces}
|
||||
ge('iconlist-icon{$smarty.section.i.index + 1}').appendChild(g_items.createIcon({$lvData.pieces[i].id}, 0, 0));
|
||||
{/section}
|
||||
</script>
|
||||
|
||||
{if $lvData.page.unavailable}
|
||||
<div class="pad"></div><b style="color: red">{$lang._unavailable}</b>
|
||||
{/if}
|
||||
|
||||
<h3>{$lang._setBonuses}{$lvData.page.bonusExt}</h3>
|
||||
|
||||
{$lang._conveyBonus}
|
||||
<ul>
|
||||
{section name=i loop=$lvData.spells}
|
||||
<li><div>{$lvData.spells[i].bonus} {$lang._pieces}: <a href="?spell={$lvData.spells[i].id}">{$lvData.spells[i].desc}</a></div></li>
|
||||
{/section}
|
||||
</ul>
|
||||
|
||||
<h2 class="clear">Summary</h2>
|
||||
|
||||
<div id="summary-generic"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
new Summary({ldelim} id: 'itemset', template: 'itemset', parent: 'summary-generic', groups: [[[{']],[['|implode:$lvData.compare.items}]]], level: {$lvData.compare.level}{rdelim});
|
||||
//]]></script>
|
||||
|
||||
<h2 class="clear">{$lang.related}</h2>
|
||||
</div>
|
||||
|
||||
<div id="tabs-generic"></div>
|
||||
<div id="listview-generic" class="listview"></div>
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var tabsRelated = new Tabs({ldelim}parent: ge('tabs-generic'){rdelim});
|
||||
{if !empty($lvData.related)} {include file='bricks/listviews/itemset.tpl' data=$lvData.related.data params=$lvData.related.params} {/if}
|
||||
new Listview({ldelim}template: 'comment', id: 'comments', name: LANG.tab_comments, tabs: tabsRelated, parent: 'listview-generic', data: lv_comments{rdelim});
|
||||
new Listview({ldelim}template: 'screenshot', id: 'screenshots', name: LANG.tab_screenshots, tabs: tabsRelated, parent: 'listview-generic', data: lv_screenshots{rdelim});
|
||||
if (lv_videos.length || (g_user && g_user.roles & (U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_VIDEO)))
|
||||
new Listview({ldelim}template: 'video', id: 'videos', name: LANG.tab_videos, tabs: tabsRelated, parent: 'listview-generic', data: lv_videos{rdelim});
|
||||
tabsRelated.flush();
|
||||
//]]></script>
|
||||
|
||||
{include file='bricks/contribute.tpl'}
|
||||
|
||||
</div><!-- main-contents -->
|
||||
</div><!-- main -->
|
||||
|
||||
{include file='footer.tpl'}
|
||||
@@ -1093,7 +1093,6 @@ Summary.prototype = {
|
||||
|
||||
if (col.id == 'name') {
|
||||
ae(th, this.selectLevel);
|
||||
if (this.editable) {
|
||||
|
||||
var s = ce('select');
|
||||
s.onchange = (function(s) {
|
||||
@@ -1113,7 +1112,6 @@ Summary.prototype = {
|
||||
ae(this.selectLevel, ct(LANG.su_level + ' '));
|
||||
ae(this.selectLevel, s);
|
||||
}
|
||||
}
|
||||
|
||||
if (col.group) {
|
||||
this.dragTargets.push(th);
|
||||
|
||||
@@ -3267,7 +3267,7 @@ function su_addToSaved(c, d, a, e) {
|
||||
title: LANG.dialog_compare,
|
||||
width: 400,
|
||||
height: 138,
|
||||
buttons: ["okay", "cancel"],
|
||||
buttons: [['okay', LANG.ok], ['cancel', LANG.cancel]],
|
||||
fields: [{
|
||||
id: "selecteditems",
|
||||
type: "caption",
|
||||
@@ -14713,6 +14713,8 @@ var ModelViewer = new function() {
|
||||
|
||||
if (!optBak.noPound) {
|
||||
var url = '#modelviewer';
|
||||
var foo = ge('view3D-button');
|
||||
if (!foo) {
|
||||
switch (optBak.type) {
|
||||
case 1: // npc
|
||||
url += ':1:' + optBak.displayId + ':' + (optBak.humanoid | 0);
|
||||
@@ -14727,6 +14729,7 @@ var ModelViewer = new function() {
|
||||
url += ':4:' + equipList.join(';');
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (race && sex) {
|
||||
url += ':' + race + '+' + sex;
|
||||
}
|
||||
@@ -15141,7 +15144,7 @@ var ModelViewer = new function() {
|
||||
readExtraPound(parts[1]);
|
||||
}
|
||||
else {
|
||||
var foo = ge('dsgndslgn464d');
|
||||
var foo = ge('view3D-button');
|
||||
if (foo) {
|
||||
foo.onclick();
|
||||
}
|
||||
@@ -16086,13 +16089,6 @@ var
|
||||
a.onclick = _processForm.bind(a, button[0]);
|
||||
a.className = 'dialog-' + button[0];
|
||||
ae(a, ct(button[1]));
|
||||
/* custom for lost buttons texture, no longer in use on 2.5.2012
|
||||
a.onclick = _processForm.bind(a, button);
|
||||
a.className = 'dialog-' + button;
|
||||
var sp = ce('span');
|
||||
sp.innerHTML = button;
|
||||
ae(a, sp);
|
||||
end custom */
|
||||
ae(dest, a);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user