diff --git a/includes/types/charclass.class.php b/includes/types/charclass.class.php index a3d574f0..2b9f9d1d 100644 --- a/includes/types/charclass.class.php +++ b/includes/types/charclass.class.php @@ -10,7 +10,7 @@ class CharClassList extends BaseType public static $brickFile = 'class'; public static $dataTable = '?_classes'; - protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_classes c'; + protected $queryBase = 'SELECT c.*, id AS ARRAY_KEY FROM ?_classes c'; public function __construct($conditions = []) { diff --git a/includes/types/charrace.class.php b/includes/types/charrace.class.php index 9fcfd4c5..163b0e2d 100644 --- a/includes/types/charrace.class.php +++ b/includes/types/charrace.class.php @@ -10,7 +10,7 @@ class CharRaceList extends BaseType public static $brickFile = 'race'; public static $dataTable = '?_races'; - protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_races r'; + protected $queryBase = 'SELECT r.*, id AS ARRAY_KEY FROM ?_races r'; public function getListviewData() { diff --git a/includes/types/currency.class.php b/includes/types/currency.class.php index f0437552..9cc752d0 100644 --- a/includes/types/currency.class.php +++ b/includes/types/currency.class.php @@ -10,7 +10,7 @@ class CurrencyList extends BaseType public static $brickFile = 'currency'; public static $dataTable = '?_currencies'; - protected $queryBase = 'SELECT *, c.id AS ARRAY_KEY FROM ?_currencies c'; + protected $queryBase = 'SELECT c.*, c.id AS ARRAY_KEY FROM ?_currencies c'; protected $queryOpts = array( 'c' => [['ic']], 'ic' => ['j' => ['?_icons ic ON ic.id = c.iconId', true], 's' => ', ic.name AS iconString'] diff --git a/includes/types/emote.class.php b/includes/types/emote.class.php index 523777d9..c641b7ea 100644 --- a/includes/types/emote.class.php +++ b/includes/types/emote.class.php @@ -10,7 +10,7 @@ class EmoteList extends BaseType public static $brickFile = 'emote'; public static $dataTable = '?_emotes'; - protected $queryBase = 'SELECT *, e.id AS ARRAY_KEY FROM ?_emotes e'; + protected $queryBase = 'SELECT e.*, e.id AS ARRAY_KEY FROM ?_emotes e'; public function __construct($conditions = []) { diff --git a/includes/types/pet.class.php b/includes/types/pet.class.php index 0b27cd2e..ea2bb2d5 100644 --- a/includes/types/pet.class.php +++ b/includes/types/pet.class.php @@ -12,7 +12,7 @@ class PetList extends BaseType public static $brickFile = 'pet'; public static $dataTable = '?_pet'; - protected $queryBase = 'SELECT *, p.id AS ARRAY_KEY FROM ?_pet p'; + protected $queryBase = 'SELECT p.*, p.id AS ARRAY_KEY FROM ?_pet p'; protected $queryOpts = array( 'p' => [['ic']], 'ic' => ['j' => ['?_icons ic ON p.iconId = ic.id', true], 's' => ', ic.name AS iconString'], diff --git a/includes/types/skill.class.php b/includes/types/skill.class.php index c9063b40..3a76b070 100644 --- a/includes/types/skill.class.php +++ b/includes/types/skill.class.php @@ -10,7 +10,7 @@ class SkillList extends BaseType public static $brickFile = 'skill'; public static $dataTable = '?_skillline'; - protected $queryBase = 'SELECT *, sl.id AS ARRAY_KEY FROM ?_skillline sl'; + protected $queryBase = 'SELECT sl.*, sl.id AS ARRAY_KEY FROM ?_skillline sl'; protected $queryOpts = array( 'sl' => [['ic']], 'ic' => ['j' => ['?_icons ic ON ic.id = sl.iconId', true], 's' => ', ic.name AS iconString'], diff --git a/includes/types/sound.class.php b/includes/types/sound.class.php index db13c372..75eba6c5 100644 --- a/includes/types/sound.class.php +++ b/includes/types/sound.class.php @@ -13,7 +13,7 @@ class SoundList extends BaseType public static $dataTable = '?_sounds'; public static $contribute = CONTRIBUTE_CO; - protected $queryBase = 'SELECT *, s.id AS ARRAY_KEY FROM ?_sounds s'; + protected $queryBase = 'SELECT s.*, s.id AS ARRAY_KEY FROM ?_sounds s'; private $fileBuffer = []; private static $fileTypes = array( diff --git a/includes/types/zone.class.php b/includes/types/zone.class.php index 1cc127f1..695b42c0 100644 --- a/includes/types/zone.class.php +++ b/includes/types/zone.class.php @@ -12,7 +12,7 @@ class ZoneList extends BaseType public static $brickFile = 'zone'; public static $dataTable = '?_zones'; - protected $queryBase = 'SELECT *, id AS ARRAY_KEY FROM ?_zones z'; + protected $queryBase = 'SELECT z.*, id AS ARRAY_KEY FROM ?_zones z'; public function __construct($conditions = [], $miscData = null) { diff --git a/pages/achievement.php b/pages/achievement.php index f5a0dba3..a8929bf9 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -99,6 +99,13 @@ class AchievementPage extends GenericPage $infobox[] = Lang::main('side').Lang::main('colon').Lang::game('si', SIDE_BOTH); } + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + // realm first available? if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH)) { diff --git a/pages/currency.php b/pages/currency.php index ca41130a..c68a2a30 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -56,9 +56,17 @@ class CurrencyPage extends GenericPage $infobox = Lang::getInfoBoxForFlags(intval($this->subject->getField('cuFlags'))); + // cap if ($_ = $this->subject->getField('cap')) $infobox[] = Lang::currency('cap').Lang::main('colon').Lang::nf($_); + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + /****************/ /* Main Content */ /****************/ diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 48ab8f53..28ab7ca7 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -665,8 +665,8 @@ class GenericPage { foreach ($data as $k => $v) { - // localizes expected fields - if (in_array($k, ['name', 'namefemale'])) + // localizes expected fields .. except for icons .. icons are special + if (in_array($k, ['name', 'namefemale']) && $struct[0] != 'g_icons') { $data[$k.'_'.User::$localeString] = $v; unset($data[$k]); @@ -754,8 +754,8 @@ class GenericPage public function extendGlobalData($data, $extra = null) // add jsGlobals or typeIds (can be mixed in one array: TYPE => [mixeddata]) to display on the page { - if ($data === null) - throw new ErrorException('ffffuuuu.....!'); + if ($data === null) + throw new ErrorException('ffffuuuu.....!'); foreach ($data as $type => $globals) { @@ -848,6 +848,7 @@ class GenericPage case TYPE_SKILL: $obj = new SkillList($cnd); break; case TYPE_CURRENCY: $obj = new CurrencyList($cnd); break; case TYPE_SOUND: $obj = new SoundList($cnd); break; + case TYPE_ICON: $obj = new IconList($cnd); break; // "um, eh":, he ums and ehs. case TYPE_USER: $obj = new UserList($cnd); break; case TYPE_EMOTE: $obj = new EmoteList($cnd); break; diff --git a/pages/item.php b/pages/item.php index 309a6c73..f108191c 100644 --- a/pages/item.php +++ b/pages/item.php @@ -144,6 +144,13 @@ class ItemPage extends genericPage if ($si != 3) $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($si == 1 ? 'alliance' : 'horde').']'.Lang::game('si', $si).'[/span]'; + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + // consumable / not consumable if (!$_slot) { diff --git a/pages/pet.php b/pages/pet.php index a6d9e933..7482f062 100644 --- a/pages/pet.php +++ b/pages/pet.php @@ -58,6 +58,13 @@ class PetPage extends GenericPage if ($this->subject->getField('exotic')) $infobox[] = '[url=?spell=53270]'.Lang::pet('exotic').'[/url]'; + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + /****************/ /* Main Content */ /****************/ diff --git a/pages/skill.php b/pages/skill.php index 86f35075..dd34ae3f 100644 --- a/pages/skill.php +++ b/pages/skill.php @@ -45,10 +45,24 @@ class SkillPage extends GenericPage protected function generateContent() { + /***********/ + /* Infobox */ + /**********/ + + $infobox = Lang::getInfoBoxForFlags(intval($this->subject->getField('cuFlags'))); + + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + /****************/ /* Main Content */ /****************/ + $this->infobox = $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null; $this->headIcons = [$this->subject->getField('iconString')]; $this->redButtons = array( BUTTON_WOWHEAD => true, diff --git a/pages/spell.php b/pages/spell.php index 1176aed9..f25ad75f 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -232,6 +232,13 @@ class SpellPage extends GenericPage if ($cost = $this->subject->getField('trainingCost')) $infobox[] = Lang::spell('trainingCost').Lang::main('colon').'[money='.$cost.'][/li]'; + // icon + if ($_ = $this->subject->getField('iconId')) + { + $infobox[] = Util::ucFirst(lang::game('icon')).Lang::main('colon').'[icondb='.$_.' name=true]'; + $this->extendGlobalIds(TYPE_ICON, $_); + } + // used in mode foreach ($this->difficulties as $n => $id) if ($id == $this->typeId) // "Mode" seems to be multilingual acceptable diff --git a/static/css/aowow.css b/static/css/aowow.css index 5356bc25..3523db63 100644 --- a/static/css/aowow.css +++ b/static/css/aowow.css @@ -948,6 +948,14 @@ a.dialog-right { #statweight-help div { position: absolute; right: -9px; top: -33px; } #fi_weight { margin-top: 10px; padding-top: 12px; border-top: 1px solid #484848; } +span.iconsmall, +span.iconmedium, +span.iconlarge, +span.iconblizzard { + display: inline-block; + vertical-align: middle; +} + .iconsmall, .iconmedium, .iconlarge, diff --git a/static/js/Markup.js b/static/js/Markup.js index 0cc4cd7f..729a65cc 100644 --- a/static/js/Markup.js +++ b/static/js/Markup.js @@ -1025,7 +1025,7 @@ var Markup = { if (g_icons[id] && g_icons[id].name) { - // href += '/' + $WH.urlize(g_icons[id].name); AoWoW - not used + // href += '/' + $WH.urlize(g_icons[id].name); AoWoW - SEO not used var icon = g_icons[id]; if (hasName) { diff --git a/static/js/global.js b/static/js/global.js index ed9d7114..0d829a10 100644 --- a/static/js/global.js +++ b/static/js/global.js @@ -17785,6 +17785,11 @@ ProgressBar.prototype.getContainer = function() var Icon = { sizes: ['small', 'medium', 'large'], sizes2: [18, 36, 56], + sizeIds: { + small: 0, + medium: 1, + large: 2 + }, premiumOffsets: [[-56, -36], [-56, 0], [0, 0]], premiumBorderClasses: ['-premium', '-gold', '', '-premiumred', '-red'], STANDARD_BORDER: 2, @@ -17794,9 +17799,9 @@ var Icon = { epic: '-q4', legendary: '-q5' }, - create: function(name, size, UNUSED, url, num, qty, noBorder, rel) { + create: function(name, size, UNUSED, url, num, qty, noBorder, rel, span) { var - icon = $WH.ce('div'), + icon = $WH.ce(span ? 'span' : 'div'), image = $WH.ce('ins'), tile = $WH.ce('del'); @@ -17829,9 +17834,11 @@ var Icon = { if (!avatarIcon) { icon.onclick = Icon.onClick; - var a = $WH.ce('a'); - a.href = "javascript:;"; - $WH.ae(icon, a); + if (url !== false) { + var a = $WH.ce('a'); + a.href = "javascript:;"; + $WH.ae(icon, a); + } } }