- added announcements to titles and error-page

- file inclusion:
    - now only require without brackets
    - classes for ListTypes are auto-loaded
- (minor) empty array to new syntax (php5+)
This commit is contained in:
Sarjuuk
2013-03-04 20:54:03 +01:00
parent a20703f35b
commit 3f69a9ab49
25 changed files with 164 additions and 164 deletions

View File

@@ -54,7 +54,7 @@ class Achievement extends BaseType
{ {
$result = DB::Aowow()->Select('SELECT * FROM ?_achievementcriteria WHERE `refAchievement` = ? ORDER BY `order` ASC', $this->Id); $result = DB::Aowow()->Select('SELECT * FROM ?_achievementcriteria WHERE `refAchievement` = ? ORDER BY `order` ASC', $this->Id);
if (!$result) if (!$result)
return array(); return [];
if (is_array($result[0])) if (is_array($result[0]))
$this->criteria = $result; $this->criteria = $result;
@@ -108,8 +108,8 @@ class Achievement extends BaseType
return $this->tooltip; return $this->tooltip;
$criteria = $this->getCriteria(); $criteria = $this->getCriteria();
$tmp = array(); $tmp = [];
$rows = array(); $rows = [];
$i = 0; $i = 0;
foreach ($criteria as $_row) foreach ($criteria as $_row)
{ {
@@ -224,7 +224,7 @@ class AchievementList extends BaseTypeList
//"rewards":[[11,137],[3,138]] [what, entry] 3:item; 11:title, 6:spell(unused) //"rewards":[[11,137],[3,138]] [what, entry] 3:item; 11:title, 6:spell(unused)
if (!empty($acv->template['rewardIds'])) if (!empty($acv->template['rewardIds']))
{ {
$rewards = array(); $rewards = [];
$rewIds = explode(" ", $acv->template['rewardIds']); $rewIds = explode(" ", $acv->template['rewardIds']);
foreach ($rewIds as $rewId) foreach ($rewIds as $rewId)
$rewards[] = ($rewId > 0 ? "[3,".$rewId."]" : ($rewId < 0 ? "[11,".-$rewId."]" : NULL)); $rewards[] = ($rewId > 0 ? "[3,".$rewId."]" : ($rewId < 0 ? "[11,".-$rewId."]" : NULL));
@@ -322,7 +322,7 @@ class AchievementList extends BaseTypeList
$series |= DB::Aowow()->SelectCell('SELECT Id FROM ?_achievement WHERE parent = ?d', $acv->Id); $series |= DB::Aowow()->SelectCell('SELECT Id FROM ?_achievement WHERE parent = ?d', $acv->Id);
// set rewards // set rewards
$rewardIds = array(); $rewardIds = [];
if ($rStr = $acv->template['reward_loc0']) if ($rStr = $acv->template['reward_loc0'])
{ {

View File

@@ -15,14 +15,14 @@ class CommunityContent
private function getComments($type, $typeId) private function getComments($type, $typeId)
{ {
// comments // comments
return array(); return [];
} }
private function getVideos($type, $typeId) private function getVideos($type, $typeId)
{ {
return DB::Aowow()->Query(" return DB::Aowow()->Query("
SELECT SELECT
v.Id, v.Id,
a.displayName AS user, a.displayName AS user,
v.date, v.date,
v.videoId, v.videoId,

View File

@@ -11,9 +11,9 @@ if (!defined('AOWOW_REVISION'))
class DB class DB
{ {
private static $interfaceCache = array(); private static $interfaceCache = [];
private static $optionsCache = array(); private static $optionsCache = [];
private static $connectionCache = array(); private static $connectionCache = [];
private static function createConnectSyntax(&$options) private static function createConnectSyntax(&$options)
{ {

View File

@@ -176,7 +176,7 @@ class Item extends BaseType
rand: >0: randomPropId; <0: randomSuffixId rand: >0: randomPropId; <0: randomSuffixId
interactive (set to place javascript/anchors to manipulate level and ratings or link to filters (static tooltips vs popup tooltip)) interactive (set to place javascript/anchors to manipulate level and ratings or link to filters (static tooltips vs popup tooltip))
*/ */
public function createTooltip($enhance = array(), $interactive = false) public function createTooltip($enhance = [], $interactive = false)
{ {
if (!empty($this->tooltip)) if (!empty($this->tooltip))
return $this->tooltip; return $this->tooltip;
@@ -404,7 +404,7 @@ class Item extends BaseType
); );
} }
else else
$enhance['gems'] = array(); $enhance['gems'] = [];
// zero fill empty sockets // zero fill empty sockets
$sockCount = $this->json['nsockets'] + (isset($enhance['sock']) ? 1 : 0); $sockCount = $this->json['nsockets'] + (isset($enhance['sock']) ? 1 : 0);
@@ -561,14 +561,14 @@ class Item extends BaseType
// todo: aaaand another one for optimization // todo: aaaand another one for optimization
$craftSpell = new Spell($this->template['spellid_2']); $craftSpell = new Spell($this->template['spellid_2']);
$craftItem = new Item($craftSpell->template["effect1CreateItemId"]); $craftItem = new Item($craftSpell->template["effect1CreateItemId"]);
$reagentItems = array(); $reagentItems = [];
for ($i = 1; $i <= 8; $i++) for ($i = 1; $i <= 8; $i++)
if ($craftSpell->template["reagent".$i]) if ($craftSpell->template["reagent".$i])
$reagentItems[$craftSpell->template["reagent".$i]] = $craftSpell->template["reagentCount".$i]; $reagentItems[$craftSpell->template["reagent".$i]] = $craftSpell->template["reagentCount".$i];
$reagents = new ItemList(array(['i.entry', array_keys($reagentItems)])); $reagents = new ItemList(array(['i.entry', array_keys($reagentItems)]));
$reqReag = array(); $reqReag = [];
foreach ($reagents->container as $r) foreach ($reagents->container as $r)
$reqReag[] = '<a href="?item='.$r->Id.'">'.$r->name.'</a> ('.$reagentItems[$r->Id].')'; $reqReag[] = '<a href="?item='.$r->Id.'">'.$r->name.'</a> ('.$reagentItems[$r->Id].')';
@@ -580,7 +580,7 @@ class Item extends BaseType
// Item Set // Item Set
$tmpX = ''; $tmpX = '';
$pieces = array(); $pieces = [];
$itemset = DB::Aowow()->selectRow(' $itemset = DB::Aowow()->selectRow('
SELECT SELECT
* *
@@ -605,7 +605,7 @@ class Item extends BaseType
} }
$tmpX .= implode('<br />', $pieces); $tmpX .= implode('<br />', $pieces);
$x .= '<br /><span class="q"><a href="?itemset='.$itemset['itemsetID'].'" class="q">'.Util::localizedString($itemset, 'name').'</a> (0/'.$num.')</span>'; $x .= '<br /><span class="q"><a href="?itemset='.$itemset['Id'].'" class="q">'.Util::localizedString($itemset, 'name').'</a> (0/'.$num.')</span>';
if ($itemset['skillID']) // bonus requires skill to activate if ($itemset['skillID']) // bonus requires skill to activate
{ {
@@ -843,7 +843,7 @@ class Item extends BaseType
if ($this->json['socketbonus'] > 0) if ($this->json['socketbonus'] > 0)
{ {
$enh = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?;', $this->json['socketbonus']); $enh = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?;', $this->json['socketbonus']);
$this->json['socketbonusstat'] = array(); $this->json['socketbonusstat'] = [];
$socketbonusstat = Util::parseItemEnchantment($enh); $socketbonusstat = Util::parseItemEnchantment($enh);
foreach ($socketbonusstat as $k => $v) foreach ($socketbonusstat as $k => $v)
$this->json['socketbonusstat'][] = '"'.$k.'":'.$v; $this->json['socketbonusstat'][] = '"'.$k.'":'.$v;
@@ -874,8 +874,8 @@ class Item extends BaseType
foreach ($subItems as $k => $sI) foreach ($subItems as $k => $sI)
{ {
$jsonEquip = array(); $jsonEquip = [];
$jsonText = array(); $jsonText = [];
for ($i = 1; $i < 6; $i++) for ($i = 1; $i < 6; $i++)
{ {
if ($sI['enchantId'.$i] <= 0) if ($sI['enchantId'.$i] <= 0)

View File

@@ -655,7 +655,7 @@ class Spell extends BaseType
public function getTooltip() public function getTooltip()
{ {
// get reagents // get reagents
$reagents = array(); $reagents = [];
for ($j = 1; $j <= 8; $j++) for ($j = 1; $j <= 8; $j++)
{ {
if($this->template['reagent'.$j] <= 0) if($this->template['reagent'.$j] <= 0)
@@ -670,7 +670,7 @@ class Spell extends BaseType
$reagents = array_reverse($reagents); $reagents = array_reverse($reagents);
// get tools // get tools
$tools = array(); $tools = [];
for ($i = 1; $i <= 2; $i++) for ($i = 1; $i <= 2; $i++)
{ {
// Tools // Tools

View File

@@ -6,17 +6,23 @@ if (!defined('AOWOW_REVISION'))
ini_set('serialize_precision', 4); ini_set('serialize_precision', 4);
require('includes/defines.php'); require 'includes/defines.php';
require('config/config.php'); require 'config/config.php';
$e = !!$AoWoWconf['debug'] ? (E_ALL & ~(E_DEPRECATED|E_USER_DEPRECATED|E_STRICT)) : 0; $e = !!$AoWoWconf['debug'] ? (E_ALL & ~(E_DEPRECATED|E_USER_DEPRECATED|E_STRICT)) : 0;
error_reporting($e); error_reporting($e);
require('includes/Smarty-2.6.26/libs/Smarty.class.php'); // Libraray: http://www.smarty.net/ require 'includes/Smarty-2.6.26/libs/Smarty.class.php'; // Libraray: http://www.smarty.net/
require('includes/DbSimple/Generic.php'); // Libraray: http://en.dklab.ru/lib/DbSimple require 'includes/DbSimple/Generic.php'; // Libraray: http://en.dklab.ru/lib/DbSimple
require('includes/utilities.php'); require 'includes/utilities.php';
require('includes/class.user.php'); require 'includes/class.user.php';
require('includes/class.database.php'); require 'includes/class.database.php';
// autoload any List-Classes
spl_autoload_register(function ($class) {
if (!strpos($class, 'Mysql') && !strpos($class, 'Filter'))
require 'includes/class.'.strtr($class, ['List' => '']).'.php';
});
// debug: measure execution times // debug: measure execution times
Util::execTime(!!$AoWoWconf['debug']); Util::execTime(!!$AoWoWconf['debug']);
@@ -24,7 +30,7 @@ Util::execTime(!!$AoWoWconf['debug']);
// Setup Smarty // Setup Smarty
class Smarty_AoWoW extends Smarty class Smarty_AoWoW extends Smarty
{ {
var $config = array(); var $config = [];
public function __construct($config) public function __construct($config)
{ {
@@ -87,7 +93,7 @@ class Smarty_AoWoW extends Smarty
if (!$cache) if (!$cache)
return false; return false;
$cache = explode("\n", $cache); $cache = explode("\n", $cache, 2);
@list($time, $rev) = explode(' ', $cache[0]); @list($time, $rev) = explode(' ', $cache[0]);
$expireTime = $time + $this->config['page']['cacheTimer']; $expireTime = $time + $this->config['page']['cacheTimer'];

View File

@@ -134,7 +134,7 @@ class BaseTypeList
public function getListviewData() public function getListviewData()
{ {
$data = array(); $data = [];
// no extra queries required, just call recursively // no extra queries required, just call recursively
foreach ($this->container as $type) foreach ($this->container as $type)
$data[] = $type->getListviewData(); $data[] = $type->getListviewData();
@@ -177,7 +177,7 @@ class Lang
public static function load($loc) public static function load($loc)
{ {
if (@(require 'localization/locale_'.$loc.'.php')) !== 1 if (@(require 'localization/locale_'.$loc.'.php') !== 1)
die('File for localization '.$loc.' not found.'); die('File for localization '.$loc.' not found.');
foreach ($lang as $k => $v) foreach ($lang as $k => $v)
@@ -187,7 +187,7 @@ class Lang
// todo: expand // todo: expand
public static function getInfoBoxForFlags($flags) public static function getInfoBoxForFlags($flags)
{ {
$tmp = array(); $tmp = [];
if ($flags & CUSTOM_DISABLED) if ($flags & CUSTOM_DISABLED)
$tmp[] = '<span class="tip" onmouseover="Tooltip.showAtCursor(event, \''.self::$main['disabledHint'].'\', 0, 0, \'q\')" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">'.self::$main['disabled'].'</span>'; $tmp[] = '<span class="tip" onmouseover="Tooltip.showAtCursor(event, \''.self::$main['disabledHint'].'\', 0, 0, \'q\')" onmousemove="Tooltip.cursorUpdate(event)" onmouseout="Tooltip.hide()">'.self::$main['disabled'].'</span>';
@@ -216,7 +216,7 @@ class Lang
{ {
$stanceMask &= 0x1F84F213E; // clamp to available stances/forms.. $stanceMask &= 0x1F84F213E; // clamp to available stances/forms..
$tmp = array(); $tmp = [];
$i = 1; $i = 1;
while ($stanceMask) while ($stanceMask)
@@ -236,7 +236,7 @@ class Lang
{ {
$schoolMask &= 0x7F; // clamp to available schools.. $schoolMask &= 0x7F; // clamp to available schools..
$tmp = array(); $tmp = [];
$i = 1; $i = 1;
while ($schoolMask) while ($schoolMask)
@@ -262,7 +262,7 @@ class Lang
if (!$classMask) // no restrictions left if (!$classMask) // no restrictions left
return false; return false;
$tmp = array(); $tmp = [];
$i = 1; $i = 1;
while ($classMask) while ($classMask)
@@ -288,7 +288,7 @@ class Lang
if (!$raceMask) // no restrictions left (we don't display 'both factions') if (!$raceMask) // no restrictions left (we don't display 'both factions')
return false; return false;
$tmp = array(); $tmp = [];
$side = 0; $side = 0;
$i = 1; $i = 1;
@@ -955,7 +955,7 @@ class Util
public static function parseTime($sec) public static function parseTime($sec)
{ {
$time = array(); $time = [];
if ($sec >= 3600 * 24) if ($sec >= 3600 * 24)
{ {
@@ -990,7 +990,7 @@ class Util
public static function formatTime($base, $short = false) public static function formatTime($base, $short = false)
{ {
$s = self::parseTime($base / 1000); $s = self::parseTime($base / 1000);
$fmt = array(); $fmt = [];
if ($short) if ($short)
{ {
@@ -1159,7 +1159,7 @@ class Util
if (!$enchant || empty($enchant)) if (!$enchant || empty($enchant))
return false; return false;
$jsonStats = array(); $jsonStats = [];
for ($h = 1; $h <= 3; $h++) for ($h = 1; $h <= 3; $h++)
{ {
if (isset($amountOverride)) // itemSuffixes have dynamic amount if (isset($amountOverride)) // itemSuffixes have dynamic amount
@@ -1210,7 +1210,7 @@ class Util
} }
// check if we use these mods // check if we use these mods
$return = array(); $return = [];
foreach ($jsonStats as $k => $v) foreach ($jsonStats as $k => $v)
{ {
if ($str = Util::$itemMods[$k]) if ($str = Util::$itemMods[$k])

View File

@@ -109,8 +109,8 @@ $lang = array(
'resetForm' => "Reiniciar formulario", 'resetForm' => "Reiniciar formulario",
'refineSearch' => "Sugerencia: Refina tu búsqueda llendo a una <a href=\"javascript:;\" id=\"fi_subcat\">subcategoría</a>.", 'refineSearch' => "Sugerencia: Refina tu búsqueda llendo a una <a href=\"javascript:;\" id=\"fi_subcat\">subcategoría</a>.",
), ),
'error' => array(), 'error' => [],
'account' => array(), 'account' => [],
'talent' => array( 'talent' => array(
'talentCalc' => "Calculadora de talentos", 'talentCalc' => "Calculadora de talentos",
'petCalc' => "Calculadora de mascotas", 'petCalc' => "Calculadora de mascotas",

View File

@@ -114,7 +114,7 @@ $lang = array(
'goStart' => "Return to the <a href=\"index.php\">homepage</a>", 'goStart' => "Return to the <a href=\"index.php\">homepage</a>",
'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>", 'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>",
), ),
'account' => array(), 'account' => [],
'achievement' => array( 'achievement' => array(
'achievements' => "hauts faits", 'achievements' => "hauts faits",
'criteria' => "Critères", 'criteria' => "Critères",

View File

@@ -114,7 +114,7 @@ $lang = array(
'goStart' => "Return to the <a href=\"index.php\">homepage</a>", 'goStart' => "Return to the <a href=\"index.php\">homepage</a>",
'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>", 'goForum' => "Feedback <a href=\"?forums&board=1\">forum</a>",
), ),
'account' => array(), 'account' => [],
'achievement' => array( 'achievement' => array(
'achievements' => "достижения", 'achievements' => "достижения",
'criteria' => "Критерий", 'criteria' => "Критерий",

View File

@@ -25,11 +25,6 @@ if (!defined('AOWOW_REVISION'))
// Ajax can't handle debug, force to false // Ajax can't handle debug, force to false
$AoWoWconf['debug'] = false; $AoWoWconf['debug'] = false;
require_once('includes/kernel.php');
// require_once('includes/class.filter.php');
require_once('includes/class.item.php');
require_once('includes/class.spell.php');
header("Content-type: text/javascript"); header("Content-type: text/javascript");
// Receives requests from at least 3 characters (although vovhede and 1 character) // Receives requests from at least 3 characters (although vovhede and 1 character)
@@ -42,14 +37,14 @@ if (strlen($_query) < 3)
echo "[\"".str_replace('"', '\"', $_query)."\", [\n"; echo "[\"".str_replace('"', '\"', $_query)."\", [\n";
// Item Comparison search // Item Comparison search
$foundItems = array(); $foundItems = [];
$foundSets = array(); $foundSets = [];
$pieceAssoc = array(); $pieceAssoc = [];
if ($_type & 0x10) { if ($_type & 0x10) {
$rows = DB::Aowow()->Select(' $rows = DB::Aowow()->Select('
SELECT SELECT
itemsetID as id, id,
refSetId as idbak, refSetId as idbak,
CONCAT(7 - quality, ?#) as name, CONCAT(7 - quality, ?#) as name,
minlevel, minlevel,
@@ -70,9 +65,10 @@ if ($_type & 0x10) {
); );
// parse items, create class-array // parse items, create class-array
foreach ($rows as $row) foreach ($rows as $row)
{ {
$row['pieces'] = array(); $row['pieces'] = [];
for ($i=1; $i<=10; $i++) for ($i=1; $i<=10; $i++)
{ {
if ($row['item'.$i]) if ($row['item'.$i])
@@ -83,7 +79,7 @@ if ($_type & 0x10) {
unset($row['item'.$i]); unset($row['item'.$i]);
} }
} }
$row['classes'] = array(); $row['classes'] = [];
for ($i = 1; $i < 12; $i++) for ($i = 1; $i < 12; $i++)
if ($row['reqclass'] & (1 << $i)) if ($row['reqclass'] & (1 << $i))
$row['classes'][] = $i + 1; $row['classes'][] = $i + 1;
@@ -94,17 +90,17 @@ if ($_type & 0x10) {
} }
if ($_type & 0x18) { // 3 | 4 if ($_type & 0x18) { // 3 | 4
$conditions = array( $conditions = array(
array('i.class', 'IN', [2, 4]), array('i.class', [2, 4]),
empty($foundItems) ? array(User::$localeId ? 'name_loc'.User::$localeId : 'name', 'LIKE', '%'.$_query.'%') : array('i.entry', 'IN', $foundItems) empty($foundItems) ? array(User::$localeId ? 'name_loc'.User::$localeId : 'name', $_query) : array('i.entry', $foundItems)
); );
$iList = new ItemList($conditions); $iList = new ItemList($conditions);
$items = array(); $items = [];
foreach ($iList->itemList as $id => $item) foreach ($iList->container as $id => $item)
{ {
$item->getJsonStats($pieceAssoc); $item->getJsonStats($pieceAssoc);
$stats = array(); $stats = [];
foreach ($item->json as $k => $v) foreach ($item->json as $k => $v)
{ {
if (!$v && $k != 'classs' && $k != 'subclass') if (!$v && $k != 'classs' && $k != 'subclass')
@@ -123,7 +119,7 @@ if ($_type & 0x18) { // 3 | 4
$i = 0; $i = 0;
foreach ($foundSets as $single) foreach ($foundSets as $single)
{ {
$set = array(); $set = [];
foreach ($single as $key => $value) foreach ($single as $key => $value)
{ {
if ((is_numeric($value) && $value == 0) || $value === "false") if ((is_numeric($value) && $value == 0) || $value === "false")

View File

@@ -3,14 +3,11 @@
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('invalid access'); die('invalid access');
require 'includes/class.item.php';
require 'includes/class.spell.php';
require 'includes/class.faction.php'; // items may require a faction to use/own
$pageData = array( $pageData = array(
'summary' => '[]', 'summary' => '[]',
'items' => [] 'items' => []
); );
$compareString = '';
// prefer $_GET over $_COOKIE // prefer $_GET over $_COOKIE
if (!empty($_GET['compare'])) if (!empty($_GET['compare']))
@@ -21,11 +18,11 @@ else if (!empty($_COOKIE['compare_groups']))
if ($compareString) if ($compareString)
{ {
$sets = explode(";", $compareString); $sets = explode(";", $compareString);
$items = array(); $items = [];
foreach ($sets as $set) foreach ($sets as $set)
{ {
$itemsting = explode(":", $set); $itemsting = explode(":", $set);
$outString = array(); $outString = [];
foreach ($itemsting as $substring) foreach ($itemsting as $substring)
{ {
$params = explode(".", $substring); $params = explode(".", $substring);
@@ -37,14 +34,14 @@ if ($compareString)
// MATCH() AGAINST() for integers would be nice... // MATCH() AGAINST() for integers would be nice...
$res = DB::Aowow()->SelectRow( $res = DB::Aowow()->SelectRow(
"SELECT itemsetID FROM ?_itemset WHERE "SELECT Id FROM ?_itemset WHERE
item1 = ? OR item2 = ? OR item3 = ? OR item4 = ? OR item5 = ? OR item1 = ? OR item2 = ? OR item3 = ? OR item4 = ? OR item5 = ? OR
item6 = ? OR item7 = ? OR item8 = ? OR item9 = ? OR item10 = ?", 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] (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) if ($res)
$piecesAssoc[(int)$params[0]] = $res['itemsetID']; $piecesAssoc[(int)$params[0]] = $res['Id'];
} }
$outSet[] = "[".implode(',', $outString)."]"; $outSet[] = "[".implode(',', $outString)."]";
} }
@@ -54,7 +51,7 @@ if ($compareString)
foreach ($iList->container as $item) foreach ($iList->container as $item)
{ {
$item->getJsonStats(); $item->getJsonStats();
$stats = array(); $stats = [];
foreach ($item->json as $k => $v) foreach ($item->json as $k => $v)
$stats[] = is_numeric($v) || $v[0] == "{" ? '"'.$k.'":'.$v.'' : '"'.$k.'":"'.$v.'"'; $stats[] = is_numeric($v) || $v[0] == "{" ? '"'.$k.'":'.$v.'' : '"'.$k.'":"'.$v.'"';

View File

@@ -3,7 +3,15 @@
if (!defined('AOWOW_REVISION')) if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
// Announcements
$announcements = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE flags & 0x10 AND (page = "*")');
foreach ($announcements as $k => $v)
$announcements[$k]['text'] = Util::localizedString($v, 'text');
$smarty->assign('lang', array_merge(Lang::$main, Lang::$error)); $smarty->assign('lang', array_merge(Lang::$main, Lang::$error));
$smarty->assign('announcements', $announcements);
$smarty->assign('mysql', DB::Aowow()->getStatistics());
$smarty->display('error.tpl'); $smarty->display('error.tpl');
exit(); exit();

View File

@@ -5,14 +5,10 @@ if (!defined('AOWOW_REVISION'))
// require 'includes/game.php'; // require 'includes/game.php';
require 'includes/class.spell.php';
// require 'includes/allquests.php'; // require 'includes/allquests.php';
require 'includes/class.item.php';
// require 'includes/allnpcs.php'; // require 'includes/allnpcs.php';
// require 'includes/allobjects.php'; // require 'includes/allobjects.php';
// require 'includes/class.community.php'; // wo dont need those .. yet // require 'includes/class.community.php'; // wo dont need those .. yet
// require 'includes/class.achievement.php';
require 'includes/class.faction.php';
$id = intVal($pageParam); $id = intVal($pageParam);
$item = new Item($id); $item = new Item($id);
@@ -30,7 +26,7 @@ else if (isset($_GET['power']))
Util::powerUseLocale($_GET['domain']); Util::powerUseLocale($_GET['domain']);
$enh = array(); $enh = [];
$itemString = $id; $itemString = $id;
if (isset($_GET['rand'])) if (isset($_GET['rand']))
@@ -54,7 +50,8 @@ else if (isset($_GET['power']))
$itemString .= 's'; $itemString .= 's';
} }
$cacheKeyTooltip = implode(':', [CACHETYPE_TOOLTIP, TYPE_ITEM, $itemString, -1, User::$localeId]); // : are not accepted in filenames
$cacheKeyTooltip = implode('_', [CACHETYPE_TOOLTIP, TYPE_ITEM, str_replace(':', ',', $itemString), -1, User::$localeId]);
// output json for tooltips // output json for tooltips
if (!$smarty->loadCache($cacheKeyTooltip, $x)) if (!$smarty->loadCache($cacheKeyTooltip, $x))
@@ -93,7 +90,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_cr = drop('creature_loot_template', $item['entry']); $drops_cr = drop('creature_loot_template', $item['entry']);
if($drops_cr) if($drops_cr)
{ {
$item['droppedby'] = array(); $item['droppedby'] = [];
foreach($drops_cr as $lootid => $drop) foreach($drops_cr as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -127,9 +124,9 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_go = drop('gameobject_loot_template', $item['entry']); $drops_go = drop('gameobject_loot_template', $item['entry']);
if($drops_go) if($drops_go)
{ {
$item['containedinobject'] = array(); $item['containedinobject'] = [];
$item['minedfromobject'] = array(); $item['minedfromobject'] = [];
$item['gatheredfromobject'] = array(); $item['gatheredfromobject'] = [];
foreach($drops_go as $lootid => $drop) foreach($drops_go as $lootid => $drop)
{ {
// Сундуки // Сундуки
@@ -195,21 +192,21 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_soldby) if($rows_soldby)
{ {
$item['soldby'] = array(); $item['soldby'] = [];
foreach($rows_soldby as $i => $row) foreach($rows_soldby as $i => $row)
{ {
$item['soldby'][$i] = array(); $item['soldby'][$i] = [];
$item['soldby'][$i] = creatureinfo2($row); $item['soldby'][$i] = creatureinfo2($row);
$item['soldby'][$i]['stock'] = ($row['stock'] == 0 ? -1 : $row['stock']); $item['soldby'][$i]['stock'] = ($row['stock'] == 0 ? -1 : $row['stock']);
if($row['ExtendedCost']) if($row['ExtendedCost'])
{ {
$item['soldby'][$i]['cost'] = array(); $item['soldby'][$i]['cost'] = [];
$extcost = $DB->selectRow('SELECT * FROM ?_item_extended_cost WHERE extendedcostID=?d LIMIT 1', abs($row['ExtendedCost'])); $extcost = $DB->selectRow('SELECT * FROM ?_item_extended_cost WHERE extendedcostID=?d LIMIT 1', abs($row['ExtendedCost']));
if($extcost['reqhonorpoints']) if($extcost['reqhonorpoints'])
$item['soldby'][$i]['cost']['honor'] = ($row['A'] == 1 ? 1 : -1) * $extcost['reqhonorpoints']; $item['soldby'][$i]['cost']['honor'] = ($row['A'] == 1 ? 1 : -1) * $extcost['reqhonorpoints'];
if($extcost['reqarenapoints']) if($extcost['reqarenapoints'])
$item['soldby'][$i]['cost']['arena'] = $extcost['reqarenapoints']; $item['soldby'][$i]['cost']['arena'] = $extcost['reqarenapoints'];
$item['soldby'][$i]['cost']['items'] = array(); $item['soldby'][$i]['cost']['items'] = [];
for ($j=1;$j<=5;$j++) for ($j=1;$j<=5;$j++)
if(($extcost['reqitem'.$j]>0) and ($extcost['reqitemcount'.$j]>0)) if(($extcost['reqitem'.$j]>0) and ($extcost['reqitemcount'.$j]>0))
{ {
@@ -242,7 +239,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_qr) if($rows_qr)
{ {
$item['objectiveof'] = array(); $item['objectiveof'] = [];
foreach($rows_qr as $row) foreach($rows_qr as $row)
$item['objectiveof'][] = GetQuestInfo($row, 0xFFFFFF); $item['objectiveof'][] = GetQuestInfo($row, 0xFFFFFF);
} }
@@ -262,7 +259,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_qp) if($rows_qp)
{ {
$item['providedfor'] = array(); $item['providedfor'] = [];
foreach($rows_qp as $row) foreach($rows_qp as $row)
$item['providedfor'][] = GetQuestInfo($row, 0xFFFFFF); $item['providedfor'][] = GetQuestInfo($row, 0xFFFFFF);
} }
@@ -293,7 +290,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_qrw) if($rows_qrw)
{ {
$item['rewardof'] = array(); $item['rewardof'] = [];
foreach($rows_qrw as $row) foreach($rows_qrw as $row)
$item['rewardof'][] = GetQuestInfo($row, 0xFFFFFF); $item['rewardof'][] = GetQuestInfo($row, 0xFFFFFF);
} }
@@ -319,7 +316,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
if($rows_qm) if($rows_qm)
{ {
if (!isset($item['rewardof'])) if (!isset($item['rewardof']))
$item['rewardof'] = array(); $item['rewardof'] = [];
foreach($rows_qm as $row) foreach($rows_qm as $row)
$item['rewardof'][] = GetQuestInfo($row, 0xFFFFFF); $item['rewardof'][] = GetQuestInfo($row, 0xFFFFFF);
} }
@@ -332,7 +329,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_cii = drop('item_loot_template', $item['entry']); $drops_cii = drop('item_loot_template', $item['entry']);
if($drops_cii) if($drops_cii)
{ {
$item['containedinitem'] = array(); $item['containedinitem'] = [];
foreach($drops_cii as $lootid => $drop) foreach($drops_cii as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -366,7 +363,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_pp = drop('pickpocketing_loot_template', $item['entry']); $drops_pp = drop('pickpocketing_loot_template', $item['entry']);
if($drops_pp) if($drops_pp)
{ {
$item['pickpocketingloot'] = array(); $item['pickpocketingloot'] = [];
foreach($drops_pp as $lootid => $drop) foreach($drops_pp as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -400,7 +397,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_sk = drop('skinning_loot_template', $item['entry']); $drops_sk = drop('skinning_loot_template', $item['entry']);
if($drops_sk) if($drops_sk)
{ {
$item['skinnedfrom'] = array(); $item['skinnedfrom'] = [];
foreach($drops_sk as $lootid => $drop) foreach($drops_sk as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -438,7 +435,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_pr = drop('prospecting_loot_template', $item['entry']); $drops_pr = drop('prospecting_loot_template', $item['entry']);
if($drops_pr) if($drops_pr)
{ {
$item['prospectingloot'] = array(); $item['prospectingloot'] = [];
foreach($drops_pr as $lootid => $drop) foreach($drops_pr as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -474,7 +471,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_de = drop('disenchant_loot_template', $item['entry']); $drops_de = drop('disenchant_loot_template', $item['entry']);
if($drops_de) if($drops_de)
{ {
$item['disenchantedfrom'] = array(); $item['disenchantedfrom'] = [];
foreach($drops_de as $lootid => $drop) foreach($drops_de as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -529,7 +526,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_cpi) if($rows_cpi)
{ {
$item['canbeplacedin'] = array(); $item['canbeplacedin'] = [];
foreach($rows_cpi as $row) foreach($rows_cpi as $row)
$item['canbeplacedin'][] = iteminfo2($row, 0); $item['canbeplacedin'][] = iteminfo2($row, 0);
} }
@@ -557,11 +554,11 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_r) if($rows_r)
{ {
$item['reagentfor'] = array(); $item['reagentfor'] = [];
$quality = 1; $quality = 1;
foreach($rows_r as $i=>$row) foreach($rows_r as $i=>$row)
{ {
$item['reagentfor'][$i] = array(); $item['reagentfor'][$i] = [];
$item['reagentfor'][$i]['entry'] = $row['spellID']; $item['reagentfor'][$i]['entry'] = $row['spellID'];
$item['reagentfor'][$i]['name'] = $row['spellname_loc'.$_SESSION['locale']]; $item['reagentfor'][$i]['name'] = $row['spellname_loc'.$_SESSION['locale']];
$item['reagentfor'][$i]['school'] = $row['resistancesID']; $item['reagentfor'][$i]['school'] = $row['resistancesID'];
@@ -604,7 +601,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_cf) if($rows_cf)
{ {
$item['createdfrom'] = array(); $item['createdfrom'] = [];
foreach($rows_cf as $row) foreach($rows_cf as $row)
{ {
$skillrow = $DB->selectRow(' $skillrow = $DB->selectRow('
@@ -625,7 +622,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_fi = drop('fishing_loot_template', $item['entry']); $drops_fi = drop('fishing_loot_template', $item['entry']);
if($drops_fi) if($drops_fi)
{ {
$item['fishedin'] = array(); $item['fishedin'] = [];
foreach($drops_fi as $lootid => $drop) foreach($drops_fi as $lootid => $drop)
{ {
// Обычные локации // Обычные локации
@@ -672,7 +669,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_mi = drop('milling_loot_template', $item['entry']); $drops_mi = drop('milling_loot_template', $item['entry']);
if($drops_mi) if($drops_mi)
{ {
$item['milledfrom'] = array(); $item['milledfrom'] = [];
foreach($drops_mi as $lootid => $drop) foreach($drops_mi as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -725,14 +722,14 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows_cf) if($rows_cf)
{ {
$item['currencyfor'] = array(); $item['currencyfor'] = [];
foreach($rows_cf as $row) foreach($rows_cf as $row)
{ {
$id=$row['entry']; $id=$row['entry'];
$item['currencyfor'][$id] = array(); $item['currencyfor'][$id] = [];
$item['currencyfor'][$id] = iteminfo2($row); $item['currencyfor'][$id] = iteminfo2($row);
$item['currencyfor'][$id]['maxcount'] = $row['drop-maxcount']; $item['currencyfor'][$id]['maxcount'] = $row['drop-maxcount'];
$item['currencyfor'][$id]['cost'] = array(); $item['currencyfor'][$id]['cost'] = [];
if($row['BuyPrice']>0) if($row['BuyPrice']>0)
$npc['sells'][$id]['cost']['money'] = $row['BuyPrice']; $npc['sells'][$id]['cost']['money'] = $row['BuyPrice'];
@@ -740,7 +737,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$item['currencyfor'][$id]['cost']['honor'] =/* ($row['A']==1?1:-1)* */$row['reqhonorpoints']; //FIXME_BUG $item['currencyfor'][$id]['cost']['honor'] =/* ($row['A']==1?1:-1)* */$row['reqhonorpoints']; //FIXME_BUG
if($row['reqarenapoints']>0) if($row['reqarenapoints']>0)
$item['currencyfor'][$id]['cost']['arena'] = $row['reqarenapoints']; $item['currencyfor'][$id]['cost']['arena'] = $row['reqarenapoints'];
$item['currencyfor'][$id]['cost']['items'] = array(); $item['currencyfor'][$id]['cost']['items'] = [];
for($j=1; $j<=5; $j++) for($j=1; $j<=5; $j++)
if(($row['reqitem'.$j]>0) and ($row['reqitemcount'.$j]>0)) if(($row['reqitem'.$j]>0) and ($row['reqitemcount'.$j]>0))
{ {
@@ -758,7 +755,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$drops_sp = drop('spell_loot_template', $item['entry']); $drops_sp = drop('spell_loot_template', $item['entry']);
if($drops_sp) if($drops_sp)
{ {
$item['containedinspell'] = array(); $item['containedinspell'] = [];
foreach($drops_sp as $lootid => $drop) foreach($drops_sp as $lootid => $drop)
{ {
$rows = $DB->select(' $rows = $DB->select('
@@ -799,7 +796,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
); );
if($rows) if($rows)
{ {
$item['criteria_of'] = array(); $item['criteria_of'] = [];
foreach($rows as $row) foreach($rows as $row)
{ {
allachievementsinfo2($row['id']); allachievementsinfo2($row['id']);
@@ -809,7 +806,7 @@ if(!$smarty->loadCache($cacheKeyPage, $item))
$item['color'] = colorByQuality($item['quality']); $item['color'] = colorByQuality($item['quality']);
$smarty->loadCache($cacheKeyPage, $item); $smarty->saveCache($cacheKeyPage, $item);
} }
$page = array( $page = array(

View File

@@ -4,12 +4,9 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
require 'includes/class.spell.php';
require 'includes/class.item.php';
// require 'includes/allnpcs.php'; // require 'includes/allnpcs.php';
// require 'includes/allquests.php'; // require 'includes/allquests.php';
// require 'includes/class.community.php'; // not needed .. yet // require 'includes/class.community.php'; // not needed .. yet
// require 'includes/class.achievement.php';
$id = intVal($pageParam); $id = intVal($pageParam);
$spell = new Spell($id); $spell = new Spell($id);
@@ -108,7 +105,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$spell['info'] = $spellObj->parseText('description'); $spell['info'] = $spellObj->parseText('description');
// Инструменты // Инструменты
$spell['tools'] = array(); $spell['tools'] = [];
$i=0; $i=0;
for ($j=1;$j<=2;$j++) for ($j=1;$j<=2;$j++)
{ {
@@ -125,7 +122,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
// Реагенты // Реагенты
$spell['reagents'] = array(); $spell['reagents'] = [];
$i=0; $i=0;
for ($j=1;$j<=8;$j++) for ($j=1;$j<=8;$j++)
{ {
@@ -150,7 +147,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// Iterate through all effects: // Iterate through all effects:
$i=0; $i=0;
$spell['effect'] = array(); $spell['effect'] = [];
for ($j=1;$j<=3;$j++) for ($j=1;$j<=3;$j++)
{ {
if($row['effect'.$j.'Id'] > 0) if($row['effect'.$j.'Id'] > 0)
@@ -171,7 +168,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
//case 106: // "Summon Object (slot 3)" // 0 spells; skipping //case 106: // "Summon Object (slot 3)" // 0 spells; skipping
//case 107: // "Summon Object (slot 4)" // 0 spells; skipping //case 107: // "Summon Object (slot 4)" // 0 spells; skipping
{ {
$spell['effect'][$i]['object'] = array(); $spell['effect'][$i]['object'] = [];
$spell['effect'][$i]['object']['entry'] = $row['effect'.$j.'MiscValue']; $spell['effect'][$i]['object']['entry'] = $row['effect'.$j.'MiscValue'];
$spell['effect'][$i]['object']['name'] = DB::Aowow()->selectCell("SELECT name FROM gameobject_template WHERE entry = ? LIMIT 1", $spell['effect'][$i]['object']['entry']).' ('.$spell['effect'][$i]['object']['entry'].')'; $spell['effect'][$i]['object']['name'] = DB::Aowow()->selectCell("SELECT name FROM gameobject_template WHERE entry = ? LIMIT 1", $spell['effect'][$i]['object']['entry']).' ('.$spell['effect'][$i]['object']['entry'].')';
break; break;
@@ -240,7 +237,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// Создает вещь: // Создает вещь:
if($row['effect'.$j.'Id'] == 24) if($row['effect'.$j.'Id'] == 24)
{ {
$spell['effect'][$i]['item'] = array(); $spell['effect'][$i]['item'] = [];
$spell['effect'][$i]['item']['entry'] = $row['effect'.$j.'CreateItemId']; $spell['effect'][$i]['item']['entry'] = $row['effect'.$j.'CreateItemId'];
$tmpRow = allitemsinfo($spell['effect'][$i]['item']['entry'], 0); $tmpRow = allitemsinfo($spell['effect'][$i]['item']['entry'], 0);
$spell['effect'][$i]['item']['name'] = $tmpRow['name']; $spell['effect'][$i]['item']['name'] = $tmpRow['name'];
@@ -253,7 +250,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// Создает спелл // Создает спелл
if($row['effect'.$j.'TriggerSpell'] > 0) if($row['effect'.$j.'TriggerSpell'] > 0)
{ {
$spell['effect'][$i]['spell'] = array(); $spell['effect'][$i]['spell'] = [];
$spell['effect'][$i]['spell']['entry'] = $row['effect'.$j.'TriggerSpell']; $spell['effect'][$i]['spell']['entry'] = $row['effect'.$j.'TriggerSpell'];
$spell['effect'][$i]['spell']['name'] = DB::Aowow()->selectCell('SELECT spellname_loc'.User::$localeId.' FROM ?_spell WHERE spellID = ?d LIMIT 1', $spell['effect'][$i]['spell']['entry']); $spell['effect'][$i]['spell']['name'] = DB::Aowow()->selectCell('SELECT spellname_loc'.User::$localeId.' FROM ?_spell WHERE spellID = ?d LIMIT 1', $spell['effect'][$i]['spell']['entry']);
allspellsinfo($spell['effect'][$i]['spell']['entry']); allspellsinfo($spell['effect'][$i]['spell']['entry']);
@@ -292,14 +289,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($seealso) if($seealso)
{ {
$spell['seealso'] = array(); $spell['seealso'] = [];
foreach($seealso as $i => $row) foreach($seealso as $i => $row)
$spell['seealso'][] = spellinfo2($row); $spell['seealso'][] = spellinfo2($row);
unset($seealso); unset($seealso);
} }
*/ */
// Кто обучает этому спеллу // Кто обучает этому спеллу
$spell['taughtbynpc'] = array(); $spell['taughtbynpc'] = [];
// Список тренеров, обучающих нужному спеллу // Список тренеров, обучающих нужному спеллу
/* /*
$trainers = DB::Aowow()->selectCol('SELECT entry FROM npc_trainer WHERE spell = ?d', $spell['entry']); $trainers = DB::Aowow()->selectCol('SELECT entry FROM npc_trainer WHERE spell = ?d', $spell['entry']);
@@ -328,7 +325,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
} }
*/ */
// Список книг/рецептов, просто обучающих спеллу // Список книг/рецептов, просто обучающих спеллу
$spell['taughtbyitem'] = array(); $spell['taughtbyitem'] = [];
/* /*
$taughtbyitem = DB::Aowow()->select(' $taughtbyitem = DB::Aowow()->select('
SELECT ?#, c.entry SELECT ?#, c.entry
@@ -407,7 +404,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($taughtbyquest) if($taughtbyquest)
{ {
$spell['taughtbyquest'] = array(); $spell['taughtbyquest'] = [];
foreach($taughtbyquest as $i=>$questrow) foreach($taughtbyquest as $i=>$questrow)
$spell['taughtbyquest'][] = GetQuestInfo($questrow, 0xFFFFFF); $spell['taughtbyquest'][] = GetQuestInfo($questrow, 0xFFFFFF);
unset($taughtbyquest); unset($taughtbyquest);
@@ -486,7 +483,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($usedbynpc) if($usedbynpc)
{ {
$spell['usedbynpc'] = array(); $spell['usedbynpc'] = [];
foreach($usedbynpc as $i=>$row) foreach($usedbynpc as $i=>$row)
$spell['usedbynpc'][] = creatureinfo2($row); $spell['usedbynpc'][] = creatureinfo2($row);
unset($usedbynpc); unset($usedbynpc);
@@ -510,7 +507,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($usedbyitem) if($usedbyitem)
{ {
$spell['usedbyitem'] = array(); $spell['usedbyitem'] = [];
foreach($usedbyitem as $i => $row) foreach($usedbyitem as $i => $row)
$spell['usedbyitem'][] = iteminfo2($row, 0); $spell['usedbyitem'][] = iteminfo2($row, 0);
unset($usedbyitem); unset($usedbyitem);
@@ -526,7 +523,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($usedbyitemset) if($usedbyitemset)
{ {
$spell['usedbyitemset'] = array(); $spell['usedbyitemset'] = [];
foreach($usedbyitemset as $i => $row) foreach($usedbyitemset as $i => $row)
$spell['usedbyitemset'][] = itemsetinfo2($row); $spell['usedbyitemset'][] = itemsetinfo2($row);
unset($usedbyitemset); unset($usedbyitemset);
@@ -550,7 +547,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($questreward) if($questreward)
{ {
$spell['questreward'] = array(); $spell['questreward'] = [];
foreach($questreward as $i => $row) foreach($questreward as $i => $row)
$spell['questreward'][] = GetQuestInfo($row, 0xFFFFFF); $spell['questreward'][] = GetQuestInfo($row, 0xFFFFFF);
unset($questreward); unset($questreward);
@@ -569,7 +566,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a FROM ?_spellicons s, ?_achievementcriteria c, ?_achievement a
LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID LEFT JOIN (?_zones z) ON a.map != -1 AND a.map = z.mapID
WHERE WHERE
a.icon = s.id a.iconId = s.id
AND a.id = c.refAchievement AND a.id = c.refAchievement
AND c.type IN (?a) AND c.type IN (?a)
AND c.value1 = ?d AND c.value1 = ?d
@@ -588,7 +585,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
); );
if($rows) if($rows)
{ {
$spell['criteria_of'] = array(); $spell['criteria_of'] = [];
foreach($rows as $row) foreach($rows as $row)
{ {
allachievementsinfo2($row['id']); allachievementsinfo2($row['id']);

View File

@@ -4,12 +4,6 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
require 'includes/class.title.php';
require 'includes/class.spell.php';
require 'includes/class.achievement.php';
require 'includes/class.item.php';
require 'includes/class.quest.php';
require 'includes/class.worldevent.php';
require 'includes/class.community.php'; require 'includes/class.community.php';
$Id = intVal($pageParam); $Id = intVal($pageParam);
@@ -106,10 +100,16 @@ $smarty->updatePageVars(array(
'typeId' => $Id 'typeId' => $Id
)); ));
// Announcements
$announcements = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE flags & 0x10 AND (page = "title" OR page = "*")');
foreach ($announcements as $k => $v)
$announcements[$k]['text'] = Util::localizedString($v, 'text');
$smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $Id)); // comments, screenshots, videos $smarty->assign('community', CommunityContent::getAll(TYPE_TITLE, $Id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main)); $smarty->assign('lang', array_merge(Lang::$main));
$smarty->assign('data', $pageData); $smarty->assign('data', $pageData);
$smarty->assign('mysql', DB::Aowow()->getStatistics()); $smarty->assign('mysql', DB::Aowow()->getStatistics());
$smarty->assign('announcements', $announcements);
$smarty->display('title.tpl'); $smarty->display('title.tpl');
?> ?>

View File

@@ -4,10 +4,6 @@ if (!defined('AOWOW_REVISION'))
die('illegal access'); die('illegal access');
require 'includes/class.title.php';
require 'includes/class.achievement.php';
require 'includes/class.quest.php';
$cat = Util::extractURLParams($pageParam)[0]; $cat = Util::extractURLParams($pageParam)[0];
$path = [0, 10]; $path = [0, 10];
$cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, -1, isset($cat) ? $cat : -1, User::$localeId]); $cacheKey = implode('_', [CACHETYPE_PAGE, TYPE_TITLE, -1, isset($cat) ? $cat : -1, User::$localeId]);
@@ -85,6 +81,11 @@ if (!$smarty->loadCache($cacheKey, $pageData))
$smarty->saveCache($cacheKey, $pageData); $smarty->saveCache($cacheKey, $pageData);
} }
// Announcements
$announcements = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE flags & 0x10 AND (page = "titles" OR page = "*")');
foreach ($announcements as $k => $v)
$announcements[$k]['text'] = Util::localizedString($v, 'text');
$page = array( $page = array(
'tab' => 0, // for g_initHeader($tab) 'tab' => 0, // for g_initHeader($tab)
'title' => implode(" - ", $title), 'title' => implode(" - ", $title),
@@ -95,6 +96,7 @@ $smarty->updatePageVars($page);
$smarty->assign('lang', Lang::$main); $smarty->assign('lang', Lang::$main);
$smarty->assign('data', $pageData); $smarty->assign('data', $pageData);
$smarty->assign('mysql', DB::Aowow()->getStatistics()); $smarty->assign('mysql', DB::Aowow()->getStatistics());
$smarty->assign('announcements', $announcements);
$smarty->display('titles.tpl'); $smarty->display('titles.tpl');
?> ?>

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
FETTES ToDo: suchen vereinen und aufräumen! FETTES ToDo: suchen vereinen und aufräumen!
if &json if &json
=> suche ausm compare heraus (profiler evtl auch noch) => suche ausm compare heraus (profiler evtl auch noch)
else if &opensearch else if &opensearch
@@ -23,17 +23,17 @@
if (isset($_GET['opensearch']) || isset($_GET['json'])) if (isset($_GET['opensearch']) || isset($_GET['json']))
{ {
require('opensearch.php'); require 'opensearch.php';
die(); die();
} }
// Необходима функция iteminfo // Необходима функция iteminfo
require_once('includes/game.php'); require 'includes/game.php';
require_once('includes/allspells.php'); require 'includes/allspells.php';
require_once('includes/allquests.php'); require 'includes/allquests.php';
require_once('includes/allitems.php'); require 'includes/allitems.php';
require_once('includes/allnpcs.php'); require 'includes/allnpcs.php';
require_once('includes/allobjects.php'); require 'includes/allobjects.php';
// Настраиваем Smarty ;) // Настраиваем Smarty ;)
$smarty->config_load($conf_file, 'search'); $smarty->config_load($conf_file, 'search');
@@ -52,7 +52,7 @@ global $npc_cols;
global $spell_cols; global $spell_cols;
// Массив всего найденного // Массив всего найденного
$found = array(); $found = [];
// Ищем вещи: // Ищем вещи:
if($_SESSION['locale']>0) if($_SESSION['locale']>0)
@@ -216,7 +216,7 @@ else
$smarty->assign('found', $found); $smarty->assign('found', $found);
// Параметры страницы // Параметры страницы
$page = array(); $page = [];
// Номер вкладки меню // Номер вкладки меню
$page['tab'] = 0; $page['tab'] = 0;
// Заголовок страницы // Заголовок страницы

View File

@@ -50,17 +50,14 @@ if (!defined('AOWOW_REVISION'))
}, },
*/ */
require 'includes/class.spell.php';
require 'includes/class.item.php';
set_time_limit(300); set_time_limit(300);
// from g_item_slots: 13:"One-Hand", 26:"Ranged", 17:"Two-Hand", // from g_item_slots: 13:"One-Hand", 26:"Ranged", 17:"Two-Hand",
$slotPointer = [13, 17, 26, 26, 13, 17, 17, 13, 17, null, 17, null, null, 13, null, 13, null, null, null, null, 17]; $slotPointer = [13, 17, 26, 26, 13, 17, 17, 13, 17, null, 17, null, null, 13, null, 13, null, null, null, null, 17];
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU]; $locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
$enchantSpells = new SpellList([['effect1Id', '=', '53'], ['name_loc0', 'NOT LIKE', 'QA%']]); // enchantItemPermanent && !qualityAssurance $enchantSpells = new SpellList([['effect1Id', '=', '53'], ['name_loc0', 'NOT LIKE', 'QA%']]); // enchantItemPermanent && !qualityAssurance
$castItems = array(); $castItems = [];
$jsonEnchants = array(); $jsonEnchants = [];
// check directory-structure // check directory-structure
foreach (Util::$localeStrings as $dir) foreach (Util::$localeStrings as $dir)
@@ -73,7 +70,7 @@ if (!defined('AOWOW_REVISION'))
{ {
User::useLocale($lId); User::useLocale($lId);
$enchantsOut = array(); $enchantsOut = [];
foreach ($enchantSpells->spellList as $spl) foreach ($enchantSpells->spellList as $spl)
{ {

View File

@@ -24,8 +24,6 @@ if (!defined('AOWOW_REVISION'))
// sketchy, but should work // sketchy, but should work
// Id < 36'000 || ilevel < 70 ? BC : WOTLK // Id < 36'000 || ilevel < 70 ? BC : WOTLK
require 'includes/class.spell.php';
$gemQuery = " $gemQuery = "
SELECT SELECT
it.entry, it.entry,

View File

@@ -115,8 +115,6 @@ if (!defined('AOWOW_REVISION'))
41108 => 'Lay on Hands' 41108 => 'Lay on Hands'
); );
require 'includes/class.spell.php';
set_time_limit(300); set_time_limit(300);
$glyphList = DB::Aowow()->Select($queryGlyphs); $glyphList = DB::Aowow()->Select($queryGlyphs);
@@ -142,7 +140,7 @@ if (!defined('AOWOW_REVISION'))
$spl = new Spell($pop['glyphEffect']); $spl = new Spell($pop['glyphEffect']);
if ($spl->template['effect1Id'] != 6) if ($spl->template['effect1Id'] != 6 && $spl->template['effect2Id'] != 6 && $spl->template['effect3Id'] != 6)
continue; continue;
if ($pop['itemId'] == 42958) // Crippling Poison has no skillLine.. oO => hardcode if ($pop['itemId'] == 42958) // Crippling Poison has no skillLine.. oO => hardcode

View File

@@ -55,8 +55,6 @@ if (!defined('AOWOW_REVISION'))
... onwards! ... onwards!
*/ */
require 'includes/class.spell.php';
$setList = DB::Aowow()->Select('SELECT * FROM ?_itemset ORDER BY refSetId DESC'); $setList = DB::Aowow()->Select('SELECT * FROM ?_itemset ORDER BY refSetId DESC');
$locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU]; $locales = [LOCALE_EN, LOCALE_FR, LOCALE_DE, LOCALE_ES, LOCALE_RU];
$jsonBonus = []; $jsonBonus = [];

View File

@@ -24,8 +24,6 @@ if (!defined('AOWOW_REVISION'))
// t - array of talent-objects // t - array of talent-objects
// f - array:int [pets only] creatureFamilies in that category // f - array:int [pets only] creatureFamilies in that category
require 'includes/class.spell.php';
function buildTree($class) function buildTree($class)
{ {
global $petFamIcons; // h8! global $petFamIcons; // h8!

View File

@@ -3,7 +3,11 @@
<div id="main"> <div id="main">
<div id="main-precontents"></div> <div id="main-precontents"></div>
<div id="main-contents" class="main-contents"> <div id="main-contents" class="main-contents">
<div id="announcement-0"></div> {if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<div class="text"> <div class="text">
<h1>{$lang.errNotFound}</h1> <h1>{$lang.errNotFound}</h1>
<div class="left"> <div class="left">

View File

@@ -3,7 +3,11 @@
<div id="main"> <div id="main">
<div id="main-precontents"></div> <div id="main-precontents"></div>
<div id="main-contents" class="main-contents"> <div id="main-contents" class="main-contents">
{if !empty($announcements)}
{foreach from=$announcements item=item}
{include file='bricks/announcement.tpl' an=$item}
{/foreach}
{/if}
<script type="text/javascript"> <script type="text/javascript">
g_initPath({$page.path}); g_initPath({$page.path});
</script> </script>