static/ -> STATIC_URL

Spells: rephrased condition for relTab: Quests
Announcements: ..can now have a userGroup set to show to
This commit is contained in:
Sarjuuk
2014-04-15 23:51:46 +02:00
parent 23e831be25
commit d34838ea2c
26 changed files with 113 additions and 107 deletions

View File

@@ -149,8 +149,8 @@ class AjaxHandler
*/
private function handleCookie()
{
if (User::$id && $this->params && !empty($this->get[$this->param[0]]))
if (DB::Aowow()->query('REPLACE INTO ?_account_cookies VALUES (?d, ?, ?)', User::$id, $this->param[0], $this->get[$this->param[0]]))
if (User::$id && $this->params && !empty($this->get[$this->params[0]]))
if (DB::Aowow()->query('REPLACE INTO ?_account_cookies VALUES (?d, ?, ?)', User::$id, $this->params[0], $this->get[$this->params[0]]))
return 0;
return null;

View File

@@ -127,7 +127,7 @@ class SmartyAoWoW extends Smarty
'mode' => 1,
'status' => 1,
'name' => 'internal error',
'style' => 'padding-left: 55px; background-image: url(static/images/announcements/warn-small.png); background-position: 10px center; border: dashed 2px #C03030;',
'style' => 'padding-left: 55px; background-image: url('.STATIC_URL.'/images/announcements/warn-small.png); background-position: 10px center; border: dashed 2px #C03030;',
'text' => '[span id=inputbox-error]'.implode("[br]", $buff).'[/span]',
);
}
@@ -139,7 +139,7 @@ class SmartyAoWoW extends Smarty
if (!isset($tv['announcements']))
$tv['announcements'] = [];
$ann = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE status = 1 AND (page = ? OR page = "*")', $match[1]);
$ann = DB::Aowow()->Select('SELECT * FROM ?_announcements WHERE status = 1 AND (page = ? OR page = "*") AND (groupMask = 0 OR groupMask & ?d)', $match[1], User::$groups);
foreach ($ann as $k => $v)
{

View File

@@ -247,11 +247,11 @@ function recoverUser()
$smarty->updatePageVars(array(
'reqCSS' => array(
['path' => 'static/css/Profiler.css'],
['path' => STATIC_URL.'/css/Profiler.css'],
),
'reqJS' => array(
'static/js/user.js',
'static/js/profile.js',
STATIC_URL.'/js/user.js',
STATIC_URL.'/js/profile.js',
),
));

View File

@@ -92,7 +92,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => ['static/js/filters.js']
'reqJS' => [STATIC_URL.'/js/filters.js']
),
'lv' => array(
'data' => $acvList->getListviewData(),

View File

@@ -70,7 +70,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'tab' => 0,
'type' => TYPE_CLASS,
'typeId' => $_id,
'reqJS' => ['static/js/swfobject.js'],
'reqJS' => [STATIC_URL.'/js/swfobject.js'],
'name' => $cl->getField('name', true),
'expansion' => Util::$expansionString[$cl->getField('expansion')],
'infobox' => '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]',

View File

@@ -12,15 +12,15 @@ $pageData = array(
'title' => Lang::$main['compareTool'],
'tab' => 1,
'reqCSS' => array(
['path' => 'static/css/Summary.css'],
['path' => 'static/css/Summary_ie6.css', 'ieCond' => 'lte IE 6'],
['path' => STATIC_URL.'/css/Summary.css'],
['path' => STATIC_URL.'/css/Summary_ie6.css', 'ieCond' => 'lte IE 6'],
),
'reqJS' => array(
'static/js/profile.js',
'static/js/Draggable.js',
'static/js/filters.js',
'static/js/Summary.js',
'static/js/swfobject.js',
STATIC_URL.'/js/profile.js',
STATIC_URL.'/js/Draggable.js',
STATIC_URL.'/js/filters.js',
STATIC_URL.'/js/Summary.js',
STATIC_URL.'/js/swfobject.js',
'?data=weight-presets.gems.enchants.itemsets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
)
);

View File

@@ -450,14 +450,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'type' => TYPE_ITEM,
'typeId' => $_id,
'reqJS' => array(
$pageText ? 'static/js/Book.js' : null,
'static/js/swfobject.js',
'static/js/profile.js',
'static/js/filters.js',
$pageText ? STATIC_URL.'/js/Book.js' : null,
STATIC_URL.'/js/swfobject.js',
STATIC_URL.'/js/profile.js',
STATIC_URL.'/js/filters.js',
'?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
),
'reqCSS' => array(
$pageText ? ['path' => 'static/css/Book.css'] : null,
$pageText ? ['path' => STATIC_URL.'/css/Book.css'] : null,
),
'redButtons' => array(
BUTTON_WOWHEAD => true,

View File

@@ -185,8 +185,8 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'tab' => 0,
'subCat' => $pageParam !== null ? '='.$pageParam : '',
'reqJS' => array(
'static/js/filters.js',
'static/js/swfobject.js',
STATIC_URL.'/js/filters.js',
STATIC_URL.'/js/swfobject.js',
'?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
)
),

View File

@@ -188,8 +188,8 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'type' => TYPE_ITEMSET,
'typeId' => $_id,
'reqJS' => array(
'static/js/Summary.js',
'static/js/swfobject.js'
STATIC_URL.'/js/Summary.js',
STATIC_URL.'/js/swfobject.js'
),
'pieces' => $pieces,
'spells' => $spells,

View File

@@ -33,7 +33,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'static/js/filters.js',
STATIC_URL.'/js/filters.js',
'?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
)
),

View File

@@ -10,12 +10,12 @@ $smarty->updatePageVars(array(
'tab' => 1,
'reqCSS' => array(
['string' => 'zone-picker { margin-left: 4px }'],
['path' => 'static/css/Mapper.css'],
['path' => 'static/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
['path' => STATIC_URL.'/css/Mapper.css'],
['path' => STATIC_URL.'/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
'static/js/maps.js',
'static/js/Mapper.js',
STATIC_URL.'/js/maps.js',
STATIC_URL.'/js/Mapper.js',
'?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
)
));

View File

@@ -390,7 +390,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'tab' => 0,
'type' => TYPE_NPC,
'typeId' => $_id,
'reqJS' => ['static/js/swfobject.js'],
'reqJS' => [STATIC_URL.'/js/swfobject.js'],
'redButtons' => array(
BUTTON_WOWHEAD => true,
BUTTON_LINKS => true,

View File

@@ -50,7 +50,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'static/js/filters.js'
STATIC_URL.'/js/filters.js'
)
),
'lv' => []

View File

@@ -252,14 +252,14 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
BUTTON_VIEW3D => ['displayId' => $object->getField('displayId'), 'type' => TYPE_OBJECT, 'typeId' => $_id]
),
'reqCSS' => array(
$pageText ? ['path' => 'static/css/Book.css'] : null,
// ['path' => 'static/css/Mapper.css'],
// ['path' => 'static/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
$pageText ? ['path' => STATIC_URL.'/css/Book.css'] : null,
// ['path' => STATIC_URL.'/css/Mapper.css'],
// ['path' => STATIC_URL.'/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6']
),
'reqJS' => array(
$pageText ? 'static/js/Book.js' : null,
// 'static/js/Mapper.js',
'static/js/swfobject.js'
$pageText ? STATIC_URL.'/js/Book.js' : null,
// STATIC_URL.'/js/Mapper.js',
STATIC_URL.'/js/swfobject.js'
)
),
'relTabs' => []

View File

@@ -39,7 +39,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'title' => implode(" - ", $title),
'path' => json_encode($path, JSON_NUMERIC_CHECK),
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => ['static/js/filters.js']
'reqJS' => [STATIC_URL.'/js/filters.js']
),
'lv' => []
);

View File

@@ -52,7 +52,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'tab' => 0,
'type' => TYPE_PET,
'typeId' => $_id,
'reqJS' => ['static/js/swfobject.js']
'reqJS' => [STATIC_URL.'/js/swfobject.js']
),
'relTabs' => []
);

View File

@@ -521,17 +521,17 @@ $pageData = array(
'region' => 'eu',
'realm' => 'realm Name',
'reqJS' => array(
'static/js/filters.js',
'static/js/TalentCalc.js',
'static/js/swfobject.js',
'static/js/profile_all.js',
'static/js/profile.js',
'static/js/Profiler.js',
STATIC_URL.'/js/filters.js',
STATIC_URL.'/js/TalentCalc.js',
STATIC_URL.'/js/swfobject.js',
STATIC_URL.'/js/profile_all.js',
STATIC_URL.'/js/profile.js',
STATIC_URL.'/js/Profiler.js',
'?data=enchants.gems.glyphs.itemsets.pets.pet-talents.quick-excludes.realms.statistics.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
),
'reqCSS' => array(
['path' => 'static/css/TalentCalc.css'],
['path' => 'static/css/Profiler.css']
['path' => STATIC_URL.'/css/TalentCalc.css'],
['path' => STATIC_URL.'/css/Profiler.css']
)
)
);

View File

@@ -88,13 +88,13 @@ $smarty->updatePageVars(array(
'realm' => '', // not sure about the use
'region' => '', // seconded..
'reqJS' => array(
'static/js/filters.js',
'static/js/profile_all.js',
'static/js/profile.js',
STATIC_URL.'/js/filters.js',
STATIC_URL.'/js/profile_all.js',
STATIC_URL.'/js/profile.js',
'?data=weight-presets.realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']
),
'reqCSS' => array(
['path' => 'static/css/profiler.css']
['path' => STATIC_URL.'/css/profiler.css']
)
));
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, ['colon' => Lang::$colon]));

View File

@@ -746,12 +746,12 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
// 'som' => json_encode($som, JSON_NUMERIC_CHECK)
// ),
'reqJS' => array(
// $map ? 'static/js/Mapper.js' : null
// $map ? STATIC_URL.'/js/Mapper.js' : null
),
'reqCSS' => array(
['path' => 'static/css/Book.css'],
// $map ? ['path' => 'static/css/Mapper.css'] : null,
// $map ? ['path' => 'static/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6'] : null
['path' => STATIC_URL.'/css/Book.css'],
// $map ? ['path' => STATIC_URL.'/css/Mapper.css'] : null,
// $map ? ['path' => STATIC_URL.'/css/Mapper_ie6.css', 'ieCond' => 'lte IE 6'] : null
),
'redButtons' => array(
BUTTON_LINKS => ['color' => 'ffffff00', 'linkId' => 'quest:'.$_id.':'.$_level.''],

View File

@@ -77,7 +77,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'tab' => 0,
'subCat' => $pageParam ? '='.$pageParam : '',
'reqJS' => array(
'static/js/filters.js'
STATIC_URL.'/js/filters.js'
)
),
'lv' => $lv

View File

@@ -1155,7 +1155,7 @@ else /* if ($searchMask & SEARCH_TYPE_REGULAR) */
'title' => $search.' - '.Lang::$search['search'],
'tab' => 0,
'reqJS' => array(
'static/js/swfobject.js'
STATIC_URL.'/js/swfobject.js'
)
));
$smarty->assign('lang', array_merge(Lang::$main, Lang::$search));

View File

@@ -403,7 +403,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
'tab' => 0,
'type' => TYPE_SPELL,
'typeId' => $_id,
'reqJS' => ['static/js/swfobject.js'],
'reqJS' => [STATIC_URL.'/js/swfobject.js'],
'redButtons' => array(
BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL].':'.$_id],
BUTTON_VIEW3D => false,
@@ -1542,7 +1542,7 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$trigger->addGlobalsToJScript(GLOBALINFO_SELF);
}
// used by - creature
// tab: used by - creature
// SMART_SCRIPT_TYPE_CREATURE = 0; SMART_ACTION_CAST = 11; SMART_ACTION_ADD_AURA = 75; SMART_ACTION_INVOKER_CAST = 85; SMART_ACTION_CROSS_CAST = 86
$conditions = array(
'OR',
@@ -1568,29 +1568,6 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$ubCreature->addGlobalsToJScript(GLOBALINFO_SELF);
}
// tab: questreward
$query = 'SELECT q.id FROM ?_quests q JOIN ?_spell s ON s.id = sourceSpellId OR s.id = rewardSpellCast OR (s.id = rewardSpell AND rewardSpellCast = 0)
WHERE (effect1Id IN (36, 57) AND effect1TriggerSpell = ?d) OR (effect2Id IN (36, 57) AND effect2TriggerSpell = ?d) OR (effect3Id IN (36, 57) AND effect3TriggerSpell = ?d)';
if ($ids = DB::Aowow()->selectCol($query, $_id, $_id, $_id))
{
$tbQuest = new QuestList(array(['id', $ids]));
if (!$tbQuest->error)
{
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $tbQuest->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'reward-from-quest',
'name' => '$LANG.tab_rewardfrom'
]
);
$tbQuest->addGlobalsToJScript();
}
}
// tab: teaches
if ($ids = Util::getTaughtSpells($spell))
{
@@ -1689,11 +1666,13 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
);
$tbSpell = new SpellList($conditions);
$tbsData = [];
if (!$tbSpell->error)
{
$tbsData = $tbSpell->getListviewData();
$pageData['relTabs'][] = array(
'file' => 'spell',
'data' => $tbSpell->getListviewData(),
'data' => $tbsData,
'params' => [
'tabs' => '$tabsRelated',
'id' => 'taught-by-spell',
@@ -1704,6 +1683,33 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData))
$tbSpell->addGlobalsToJScript(GLOBALINFO_SELF);
}
// tab: taught by quest
$conditions = ['OR', ['sourceSpellId', $_id], ['rewardSpell', $_id]];
if ($tbsData)
{
$conditions[] = ['rewardSpell', array_keys($tbsData)];
if (User::isInGroup(U_GROUP_STAFF))
$conditions[] = ['rewardSpellCast', array_keys($tbsData)];
}
if (User::isInGroup(U_GROUP_STAFF))
$conditions[] = ['rewardSpellCast', $_id];
$tbQuest = new QuestList($conditions);
if (!$tbQuest->error)
{
$pageData['relTabs'][] = array(
'file' => 'quest',
'data' => $tbQuest->getListviewData(),
'params' => [
'tabs' => '$tabsRelated',
'id' => 'reward-from-quest',
'name' => '$LANG.tab_rewardfrom'
]
);
$tbQuest->addGlobalsToJScript();
}
// tab: taught by item (i'd like to precheck $spell->sources, but there is no source:item only complicated crap like "drop" and "vendor")
$conditions = array(
'OR',

View File

@@ -442,7 +442,7 @@ if (!$smarty->loadCache($cacheKey, $pageData, $filter))
'tab' => 0,
'subCat' => $pageParam !== null ? '='.$pageParam : '',
'reqJS' => array(
'static/js/filters.js'
STATIC_URL.'/js/filters.js'
)
),
'lv' => $lv

View File

@@ -13,17 +13,17 @@ $smarty->updatePageVars(array(
'tab' => 1,
'dataKey' => $_SESSION['dataKey'],
'reqCSS' => array(
['path' => 'static/css/TalentCalc.css'],
['path' => 'static/css/talent.css'],
['path' => 'static/css/TalentCalc_ie6.css', 'ieCond' => 'lte IE 6'],
['path' => 'static/css/TalentCalc_ie67.css', 'ieCond' => 'lte IE 7'],
$petCalc ? ['path' => 'static/css/petcalc.css'] : null
['path' => STATIC_URL.'/css/TalentCalc.css'],
['path' => STATIC_URL.'/css/talent.css'],
['path' => STATIC_URL.'/css/TalentCalc_ie6.css', 'ieCond' => 'lte IE 6'],
['path' => STATIC_URL.'/css/TalentCalc_ie67.css', 'ieCond' => 'lte IE 7'],
$petCalc ? ['path' => STATIC_URL.'/css/petcalc.css'] : null
),
'reqJS' => array(
'static/js/TalentCalc.js',
STATIC_URL.'/js/TalentCalc.js',
($petCalc ? '?data=pet-talents.pets' : '?data=glyphs').'&locale='.User::$localeId.'&t='.$_SESSION['dataKey'],
$petCalc ? 'static/js/petcalc.js' : 'static/js/talent.js',
$petCalc ? 'static/js/swfobject.js' : null
$petCalc ? STATIC_URL.'/js/petcalc.js' : STATIC_URL.'/js/talent.js',
$petCalc ? STATIC_URL.'/js/swfobject.js' : null
)
));
$smarty->assign('tcType', $petCalc ? 'pc' : 'tc');

View File

@@ -90,7 +90,7 @@ if (!defined('AOWOW_REVISION'))
}
// categories to sort by
$buff .= "\ng_achievement_catorder = [92,14863,97,169,170,171,172,14802,14804,14803,14801,95,161,156,165,14806,14921,96,201,160,14923,14808,14805,14778,14865,14777,14779,155,14862,14861,14864,14866,158,162,14780,168,14881,187,14901,163,14922,159,14941,14961,14962,14981,15003,15002,15001,15041,15042,81]";
$buff .= "\ng_achievement_catorder = [92, 14863, 97, 169, 170, 171, 172, 14802, 14804, 14803, 14801, 95, 161, 156, 165, 14806, 14921, 96, 201, 160, 14923, 14808, 14805, 14778, 14865, 14777, 14779, 155, 14862, 14861, 14864, 14866, 158, 162, 14780, 168, 14881, 187, 14901, 163, 14922, 159, 14941, 14961, 14962, 14981, 15003, 15002, 15001, 15041, 15042, 81]";
// sum points
$buff .= "\ng_achievement_points = [".$sumPoints."];\n";
@@ -297,4 +297,4 @@ if (!defined('AOWOW_REVISION'))
echo "<br>\nall done";
$stats = DB::Aowow()->getStatistics();
echo "<br>\n".$stats['count']." queries in: ".Util::formatTime($stats['time'] * 1000);
?>
?>

View File

@@ -2,12 +2,12 @@
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="SHORTCUT ICON" href="template/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="static/css/basic.css?{$AOWOW_REVISION}" />
<link rel="stylesheet" type="text/css" href="static/css/global.css?{$AOWOW_REVISION}" />
<link rel="stylesheet" type="text/css" href="static/css/locale_{$user.language}.css?{$AOWOW_REVISION}" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="static/css/global_ie.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="static/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="static/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]-->
<link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/basic.css?{$AOWOW_REVISION}" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global.css?{$AOWOW_REVISION}" />
<link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/locale_{$user.language}.css?{$AOWOW_REVISION}" />
<!--[if IE]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie6.css?{$AOWOW_REVISION}" /><![endif]-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{$smarty.const.STATIC_URL}/css/global_ie67.css?{$AOWOW_REVISION}" /><![endif]-->
{foreach from=$reqCSS item=css}
{if isset($css.string)}
<style type="text/css">{$css.string}</style>
@@ -23,12 +23,12 @@
var g_dataKey = '{$dataKey}';
{/if}
</script>
<script src="static/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="static/js/basic.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="static/widgets/power.js?lang={$user.language|substr:2}" type="text/javascript"></script>
<script src="static/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="static/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="static/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/basic.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/widgets/power.js?lang={$user.language|substr:2}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/locale_{$user.language}.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/global.js?{$AOWOW_REVISION}" type="text/javascript"></script>
<script src="{$smarty.const.STATIC_URL}/js/Markup.js?{$AOWOW_REVISION}" type="text/javascript"></script>
{foreach from=$reqJS item=file}
<script src="{$file}{if $file[0] == '?'}&{else}?{/if}{$AOWOW_REVISION}" type="text/javascript"></script>
{/foreach}