public function indexAction() { $this->forceInsecure(); // Pull podcasts. $podcasts = Podcast::fetchLatest(); $this->view->podcasts = $podcasts; // Pull large photos and news for rotator. $network_news = NetworkNews::fetchFeatured(); $this->view->network_news = $network_news; // Pull stations and calendar events. $this->_initStations(); $this->_initEvents(); // Pull conventions. $conventions = Convention::getAllConventions(); $this->view->conventions_upcoming = $conventions['upcoming']; $this->view->conventions_archived = $conventions['archived']; /* // Pull rotators. $rotators = Rotator::fetch(); $this->view->rotators = $rotators; */ // Special event flagging and special formatting. $special_event = \PVL\Utilities::showSpecialEventsMode(); $this->view->special_event = $special_event; if ($special_event) { $autoplay_station = Settings::getSetting('special_event_station_id', 0); if ($autoplay_station != 0) { $this->view->station_id = $autoplay_station; $this->view->autoplay = true; } $this->view->special_event_embed = trim(Settings::getSetting('special_event_embed_code')); $this->view->special_chat_embed = trim(Settings::getSetting('special_event_chat_code')); } $this->view->autoplay = (bool) $this->getParam('autoplay', true); }
public function archiveAction() { $convention = $this->_getConvention(); if (!$convention) { $this->redirectFromHere(array('action' => 'index', 'id' => NULL)); } $this->view->convention = $convention; $videos = array(); $sources = array(); $folders = ConventionArchive::getFolders(); foreach ($folders as $folder_key => $folder_name) { $videos[$folder_name] = array('key' => $folder_key, 'name' => $folder_name, 'videos' => array()); } foreach ($convention->archives as $row) { if ($row->isPlayable()) { $folder_name = $folders[$row->folder]; $videos[$folder_name]['videos'][] = $row; } else { $sources[] = $row; } } foreach ($videos as $folder_name => $row) { if (empty($row['videos'])) { unset($videos[$folder_name]); } } $this->view->videos = $videos; $this->view->sources = $sources; // Pull conventions. $conventions = Convention::getAllConventions(); $this->view->conventions_archived = $conventions['archived']; }