diff --git a/includes/kernel.php b/includes/kernel.php index 1257be4d..72bf6636 100644 --- a/includes/kernel.php +++ b/includes/kernel.php @@ -71,9 +71,8 @@ foreach ($sets as $k => $v) define('CFG_'.strtoupper($k), $v['s'] ?: intVal($v['i'])); -$protocoll = 'http://'; -if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || CFG_FORCE_SSL) - $protocoll = 'https://'; +$secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || CFG_FORCE_SSL; +$protocoll = $secure ? 'https://' : 'http://'; define('STATIC_URL', substr($protocoll.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1).'/static'); // points js to images & scripts (change here if you want to use a separate subdomain) define('HOST_URL', substr($protocoll.$_SERVER['SERVER_NAME'].strtr($_SERVER['SCRIPT_NAME'], ['index.php' => '']), 0, -1)); // points js to executable files @@ -87,7 +86,7 @@ Util::execTime(CFG_DEBUG); // Setup Session -ini_set('session.cookie_httponly', true); +session_set_cookie_params(15 * YEAR, '/', '', $secure, true); session_cache_limiter('private'); session_start(); if (User::init()) diff --git a/pages/currency.php b/pages/currency.php index 7d156db9..13178185 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -174,7 +174,7 @@ class CurrencyPage extends GenericPage } } - // tab: created by (spell) [for items its handled in Util::getLootSource()] + // tab: created by (spell) [for items its handled in Loot::getByContainer()] if ($this->typeId == 104) { $createdBy = new SpellList(array(['effect1Id', 45], ['effect2Id', 45], ['effect3Id', 45], 'OR')); diff --git a/pages/items.php b/pages/items.php index 9e644c98..008a9c2e 100644 --- a/pages/items.php +++ b/pages/items.php @@ -268,7 +268,7 @@ class ItemsPage extends GenericPage break; case 3: // source - $groups = [0, 1, 2, 3, 4, 5, 10, 11, 12]; + $groups = [1, 2, 3, 4, 5, 10, 11, 12, 0]; $nameSource = Lang::$game['sources']; $this->forceTabs = true; diff --git a/pages/npc.php b/pages/npc.php index bb01f8bb..bdd5a144 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -95,13 +95,10 @@ class NpcPage extends GenericPage $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); // Event - if ($_ = DB::Aowow()->selectRow('SELECT e.id, holidayId FROM ?_events e, game_event_creature gec, creature c WHERE e.id = ABS(gec.eventEntry) AND c.guid = gec.guid AND c.id = ?d', $this->typeId)) + if ($_ = DB::Aowow()->selectCell('SELECT holidayId FROM ?_events e, game_event_creature gec, creature c WHERE e.id = ABS(gec.eventEntry) AND c.guid = gec.guid AND c.id = ?d', $this->typeId)) { - if ($h = $_['holidayId']) - { - $this->extendGlobalIds(TYPE_WORLDEVENT, $_['id']); - $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].'[event='.$h.']'; - } + $this->extendGlobalIds(TYPE_WORLDEVENT, $_); + $infobox[] = Util::ucFirst(Lang::$game['eventShort']).Lang::$main['colon'].'[event='.$_.']'; } // Level diff --git a/pages/spell.php b/pages/spell.php index 83750a4e..013f1f68 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -1873,7 +1873,6 @@ class SpellPage extends GenericPage break; case 78: // Mounted case 56: // Transform - { if ($transform = $this->subject->getModelInfo($this->typeId)) { $redButtons[BUTTON_VIEW3D] = ['type' => TYPE_NPC, 'displayId' => $transform['displayId']]; @@ -1883,12 +1882,12 @@ class SpellPage extends GenericPage $bar = Lang::$main['colon'].Lang::$game['npc'].' #'.$effMV;; break; - } case 139: // Force Reaction - { - $bar = ' ('.FactionList::getName($effMV).')'; $foo['value'] = sprintf(Util::$dfnString, $foo['value'], Lang::$game['rep'][$foo['value']]); - } + // DO NOT BREAK + case 190: // Mod Faction Reputation Gain + $bar = ' ('.FactionList::getName($effMV).')'; + break; // also breaks for 139 } $foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null);