die('error: SITE_HOST or STATIC_HOST not configured'); } // Setup Session session_set_cookie_params(15 * YEAR, '/', '', $secure, true); session_cache_limiter('private'); session_start(); if (!empty($AoWoWconf['aowow']) && User::init()) { User::save(); } // save user-variables in session // hard-override locale for this call (should this be here..?) // all strings attached.. if (!empty($AoWoWconf['aowow'])) { if (isset($_GET['locale']) && CFG_LOCALES & 1 << (int) $_GET['locale']) { User::useLocale($_GET['locale']); } Lang::load(User::$localeString); } // parse page-parameters .. sanitize before use! $str = explode('&', $_SERVER['QUERY_STRING'], 2)[0]; $_ = explode('=', $str, 2); $pageCall = $_[0]; $pageParam = isset($_[1]) ? $_[1] : null; Util::$wowheadLink = 'http://' . Util::$subDomains[User::$localeId] . '.wowhead.com/' . $str; } else { if (!empty($AoWoWconf['aowow'])) { Lang::load('enus'); } } $AoWoWconf = null; // empty auths
protected function postCache() { // update dates to now() $updated = WorldEventList::updateDates($this->dates); if ($this->mode == CACHE_TYPE_TOOLTIP) { return array(date(Lang::main('dateFmtLong'), $updated['start']), date(Lang::main('dateFmtLong'), $updated['end'])); } else { if ($this->hId) { Util::$wowheadLink = 'http://' . Util::$subDomains[User::$localeId] . '.wowhead.com/event=' . $this->hId; } /********************/ /* finalize infobox */ /********************/ // start if ($updated['start']) { array_push($this->infobox, Lang::event('start') . Lang::main('colon') . date(Lang::main('dateFmtLong'), $updated['start'])); } // end if ($updated['end']) { array_push($this->infobox, Lang::event('end') . Lang::main('colon') . date(Lang::main('dateFmtLong'), $updated['end'])); } // occurence if ($updated['rec'] > 0) { array_push($this->infobox, Lang::event('interval') . Lang::main('colon') . Util::formatTime($updated['rec'] * 1000)); } // in progress if ($updated['start'] < time() && $updated['end'] > time()) { array_push($this->infobox, '[span class=q2]' . Lang::event('inProgress') . '[/span]'); } $this->infobox = '[ul][li]' . implode('[/li][li]', $this->infobox) . '[/li][/ul]'; /***************************/ /* finalize related events */ /***************************/ foreach ($this->lvTabs as &$view) { if ($view[0] != WorldEventList::$brickFile) { continue; } foreach ($view[1]['data'] as &$data) { $updated = WorldEventList::updateDates($data['_date']); unset($data['_date']); $data['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false; $data['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false; $data['rec'] = $updated['rec']; } } } }