public static function GetExtendedItemInfo($entry) { if (!is_array($entry)) { return false; } $data = DB::World()->select("\n SELECT\n `a`.`entry`,\n `a`.`name`,\n `a`.`displayid`,\n `a`.`Quality` AS `quality`,\n `a`.`SellPrice` AS `sellprice`,\n `a`.`BuyPrice` AS `buyprice`,\n `a`.`class`,\n `a`.`subclass`,\n `a`.`displayid`,\n `a`.`Flags`,\n `a`.`Flags2`,\n `a`.`armor`,\n `a`.`InventoryType` AS `slotbak`,\n `a`.`AllowableClass`,\n `a`.`AllowableRace`,\n `a`.`ItemLevel` AS `level`,\n `a`.`RequiredLevel` AS `reqlevel`,\n `b`.`icon`,\n %s\n FROM `item_template` AS `a`\n LEFT JOIN `DBPREFIX_icons` AS `b` ON `b`.`displayid` = `a`.`displayid`\n %s\n WHERE `a`.`entry` IN (%s)", WoW_Locale::GetLocaleID() != LOCALE_EN ? '`c`.`name_loc' . WoW_Locale::GetLocaleID() . '` AS `name_loc`' : 'NULL', WoW_Locale::GetLocaleID() != LOCALE_EN ? 'LEFT JOIN `locales_item` AS `c` ON `c`.`entry` = `a`.`entry`' : null, $entry); ///$items = array(); foreach ($data as &$item) { $item['id'] = $item['entry']; if (isset($item['name_loc']) && $item['name_loc'] != null) { // GetLocaleID() check is not required here $item['name'] = $item['name_loc']; unset($item['name_loc']); } if ($item['Flags2'] & ITEM_FLAGS2_ALLIANCE_ONLY) { $item['side'] = FACTION_ALLIANCE; } elseif ($item['Flags2'] & ITEM_FLAGS2_HORDE_ONLY) { $item['side'] = FACTION_HORDE; } else { $item['side'] = 3; // Thumb Up, RWJ! } if ($item['Flags'] & ITEM_FLAGS_HEROIC) { $item['heroic'] = 1; } if (is_array(WoW_Items::AllowableClasses($item['AllowableClass']))) { $item['reqclass'] = $item['AllowableClass']; unset($item['AllowableClass']); } if (is_array(WoW_Items::AllowableRaces($item['AllowableRace']))) { $item['reqrace'] = $item['AllowableRace']; unset($item['AllowableRace']); } if ($item['class'] == ITEM_CLASS_MISC && $item['subclass'] == ITEM_SUBCLASS_JUNK_MOUNT) { $item['modelviewer'] = '{"displayid":' . $item['displayid'] . ',"type": 1,"typeid":11147}'; } if (in_array($item['class'], array(ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON))) { $item['slot'] = $item['slotbak']; } else { unset($item['armor']); } $item['classs'] = $item['class']; unset($item['Flags'], $item['Flags2'], $item['AllowableClass'], $item['AllowableRace']); } return $data; }
$t = explode(':', $class_name); if (isset($t[1])) { $class_name = $t[0]; } if ($prev) { $classes_text .= ', '; } $classes_text .= sprintf(' <a href="%s/wow/game/class/%s" class="color-c%d">%s</a>', WoW::GetWoWPath(), $class['key'], $class_id, $class_name); $prev = true; } $classes_text .= '</li>'; echo $classes_text; } } if ($proto->AllowableRace > 0) { $races_data = WoW_Items::AllowableRaces($proto->AllowableRace); if (is_array($races_data)) { // Do not check this variable as if(!$races_data), because WoW_Items::AllowableRaces() returns TRUE if item can be equipped by all of the races. $races_text = '<li>' . WoW_Locale::GetString('template_item_allowable_races'); $prev = false; foreach ($races_data as $race_id => $race) { $race_name = WoW_Locale::GetString('character_race_' . $race_id); $t = explode(':', $race_name); if (isset($t[1])) { $race_name = $t[0]; } if ($prev) { $races_text .= ', '; } $races_text .= sprintf(' <a href="%s/wow/game/race/%s">%s</a>', WoW::GetWoWPath(), $race['key'], $race_name); $prev = true;