$header = new SectionTemplate(); $header->file = "header.php"; $footer = new SectionTemplate(); $footer->file = "footer.php"; $search = new SectionTemplate(); $search->file = "shows_search.php"; include_class('shows'); include_class('venues'); include_class('locations'); include_class('m2'); include_class('tours'); include_class('band_members'); $view = ''; if ($_GET['id']) { $bs = Show::get($_GET['id']); if ($_GET['media_instance_id'] > 0) { $mi = MediaInstance::get($_GET['media_instance_id']); if (!db::isError($mi) && !db::isError($bs)) { if (($mi->getAreaID() == $bs->getAVAreaID() || $mi->getAreaID() == $bs->getPhotoAreaID()) && $bs->isActive()) { $view = 'media'; $media = new SectionTemplate(); $media->file = "media_detail.php"; $media->args['media'] = $mi; $media->args['exitURL'] = USE_MOD_REWRITE ? '/show/' . $bs->getID() . '/' : '/shows.php?id=' . $bs->getID(); } } } if ($view != 'media' && !db::isError($bs)) { $view = 'detail'; $detail = new SectionTemplate();
<?php include 'base.php'; User::protect(); $section = 'shows'; include_class('shows'); include_class('m2'); $editors = array('description'); $sh = Show::get($_GET['id']); if (!db::isError($sh)) { $mi = MediaInstance::get($_GET['media_instance_id']); if (!db::isError($mi)) { $type = $mi->getAreaID() == $sh->getAVAreaID() ? "av" : "photos"; switch ($_GET['task']) { case 'update': $res = $mi->update($_POST, $sh); if (!db::isError($res)) { header('Location: show_media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id']); } break; case 'deactivate': $res = $mi->deactivate($sh); if (!db::isError($res)) { header('Location: show_media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id']); } break; case 'activate': $res = $mi->activate($sh); if (!db::isError($res)) { header('Location: show_media_edit.php?id=' . $_GET['id'] . '&media_instance_id=' . $_GET['media_instance_id']); }
function populateShowsArray($m, $y) { $db = new db(); $mPadded = sprintf("%02d", $m); $q = "select DATE_FORMAT(date, '%d') as day, ID from Shows where is_active = 1 and DATE_FORMAT(date, '%m') = '{$mPadded}' and DATE_FORMAT(date, '%Y') = '{$y}' order by date asc"; $r = mysql_query($q); if ($db->isError($r)) { return Error::MySQL(); } while ($row = mysql_fetch_assoc($r)) { $this->showsArray[(int) $row['day']][] = Show::get($row['ID']); } }
else if ( isset($_GET['downloadtvdb']) ) { if ( $show = Show::get($_GET['downloadtvdb']) ) { $filepath = tempnam(sys_get_temp_dir(), 'series_'); if ( $show->downloadTVDVInfo($filepath) ) { header('Content-type: application/zip'); header('Content-disposition: attachment; filename="show-' . $show->id . '.zip"'); readfile($filepath); } } exit; } // reset one show else if ( isset($_GET['resetshow']) ) { if ( $show = Show::get($_GET['resetshow']) ) { // delete seasons/episodes $db->delete('seasons', array('series_id' => $_GET['resetshow'])); // delete tvdb series id $db->update('series', array('tvdb_series_id' => 0, 'changed' => time()), array('id' => $_GET['resetshow'])); } return do_redirect('index'); } // keep db hot else if ( isset($_GET['keepalive']) ) { $db->delete('variables', array('name' => 'keepalive')); $db->insert('variables', array('name' => 'keepalive', 'value' => time())); exit('OK');
function getShows() { $q = "select Shows.ID from Shows, Tours where Shows.date >= Tours.start_date and Shows.date <= Tours.end_date and Tours.ID = {$this->ID} and Shows.is_active = 1 order by Shows.date asc"; $r = mysql_query($q); if (!$r) { return Error::MySQL(); } $showOArray = array(); while ($row = mysql_fetch_assoc($r)) { $showOArray[] = Show::get($row['ID']); } return $showOArray; }