Esempio n. 1
0
 function getMediaByDisplayOrder($display_order)
 {
     $q = "SELECT ID FROM DarkRoom_Media_to_Areas WHERE area_id = {$this->ID} AND display_order = {$display_order}";
     $r = @mysql_query($q);
     if (!$r) {
         $e = new Error();
         $e->add(mysql_error());
         return $e;
     }
     $row = mysql_fetch_assoc($r);
     $id = $row['ID'];
     if (!isset($id)) {
         return null;
     }
     $ma = MediaInstance::get($id);
     return $ma;
 }
Esempio n. 2
0
$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();
        $detail->file = "show_detail.php";
        $detail->args['show'] = $bs;
Esempio n. 3
0
 function getMemberPhoto()
 {
     // the album cover is actually the first piece of media that's active in a given member's media area
     // first we get the media area ID for the given release.
     if ($this->photo_area_id) {
         // if we have an area ID, we continue
         $q = "select ID from DarkRoom_Media_to_Areas where area_id = {$this->photo_area_id} and is_active = 1 order by display_order asc limit 1";
         $r = mysql_query($q);
         if (!$r) {
             return Error::MySQL();
         }
         $row = mysql_fetch_assoc($r);
         if ($row['ID']) {
             $mi = MediaInstance::get($row['ID']);
             return $mi;
         }
     }
 }