protected function postCache() { // recalculate dates with now() foreach ($this->lvTabs as &$views) { foreach ($views['data'] as &$data) { // is a followUp-event if (!empty($this->deps[$data['id']])) { $data['startDate'] = $data['endDate'] = false; unset($data['_date']); continue; } $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']; } } }
protected function postCache() { if (!empty($this->lvTabs[3])) { // update WorldEvents to date() foreach ($this->lvTabs[3]['data'] as &$d) { $updated = WorldEventList::updateDates($d['_date']); unset($d['_date']); $d['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false; $d['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false; $d['rec'] = $updated['rec']; } } if ($this->searchMask & SEARCH_TYPE_REGULAR) { $foundTotal = 0; foreach ($this->lvTabs as $_) { $foundTotal += count($_['data']); } if ($foundTotal == 1) { $_ = array_pop($this->lvTabs); $type = Util::$typeStrings[$_['type']]; $typeId = key($_['data']); header('Location: ?' . $type . '=' . $typeId, true, 302); exit; } } }
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']; } } } }
protected function postCache() { /********************/ /* finalize infobox */ /********************/ // update dates to now() $updated = WorldEventList::updateDates($this->dates); // 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['file'] != WorldEventList::$brickFile) { continue; } foreach ($view['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']; } } }