Example #1
0
function view_edit_album()
{
    global $intros;
    global $titlings;
    global $downloadable;
    global $repository_path;
    global $default_add_title;
    global $default_downloadable;
    $album = suffix_remove($_SESSION['podman_album']);
    $moderation = album_is_private($_SESSION['podman_album']);
    $visibility = $moderation ? '-priv' : '-pub';
    ezmam_repository_path($repository_path);
    $album_meta = ezmam_album_metadata_get($album . $visibility);
    // for preselection in the form
    $album_intro = $album_meta['intro'];
    if (isset($album_meta['add_title'])) {
        $add_title = $album_meta['add_title'];
    } else {
        $add_title = $default_add_title;
    }
    // for the checkbox in the form
    $downloadable = isset($album_meta['downloadable']) ? $album_meta['downloadable'] : $default_downloadable;
    require_once template_getpath('popup_edit_album.php');
    die;
}
Example #2
0
if (isset($recording_metadata['submitted_slide'])) {
    $asset_meta['submitted_slide'] = $recording_metadata['submitted_slide'];
}
if (isset($recording_metadata['intro'])) {
    $asset_meta['intro'] = $recording_metadata['intro'];
}
if (isset($recording_metadata['add_title'])) {
    $asset_meta['add_title'] = $recording_metadata['add_title'];
}
$asset_meta['ratio'] = isset($recording_metadata['ratio']) ? $recording_metadata['ratio'] : 'auto';
if (isset($recording_metadata['downloadable'])) {
    // if the recording has been submitted
    $asset_meta['downloadable'] = $recording_metadata['downloadable'];
} else {
    // the recording comes from EZrecorder
    $album_meta = ezmam_album_metadata_get($album_name);
    $asset_meta['downloadable'] = isset($album_meta['downloadable']) ? $album_meta['downloadable'] : $default_downloadable;
}
//create asset if not exists!
$asset_name = $record_date;
if (!ezmam_asset_exists($album_name, $asset_name)) {
    ezmam_asset_new($album_name, $asset_name, $asset_meta);
}
//do we have a cam movie?
if (strpos($record_type, "cam") !== false) {
    //insert original cam media in asset with attention to file extension/mimetype
    originals_mam_insert_media($album_name, $asset_name, 'cam', $recording_metadata, $recording_dir);
}
//do we have a slide movie?
if (strpos($record_type, "slide") !== false) {
    //insert original slide media in asset with attention to file extension/mimetype
Example #3
0
/**
 * Returns the album full title from an album mnemonic
 * @global type $repository_path
 * @param type $album the album mnemonique
 * @return boolean the album full title if the album exists; false otherwise
 */
function get_album_title($album)
{
    global $repository_path;
    ezmam_repository_path($repository_path);
    //
    // Usual sanity checks
    //
    if (!ezmam_album_exists($album)) {
        return false;
    }
    $album_title = ezmam_album_metadata_get($album);
    $album_title = $album_title['description'];
    return $album_title;
}
Example #4
0
function ezmam_rss_new($album_name, $type)
{
    global $ezplayer_url;
    global $distribute_url;
    global $organization_name;
    global $mailto_alert;
    //
    // Sanity checks
    //
    $repository_path = ezmam_repository_path();
    if ($repository_path === false) {
        return false;
    }
    if (!ezmam_album_exists($album_name)) {
        return false;
    }
    $album_path = $repository_path . "/" . $album_name;
    $file_path = $album_path . "/{$type}.rss";
    //
    // Setting up information about the feed
    //
    $metadata = ezmam_album_metadata_get($album_name);
    // Quality
    $quality = 'HD';
    if ($type == 'low') {
        $quality = 'SD';
    }
    // Feed title
    $title = $metadata['name'] . ' ' . $metadata['description'] . ' (' . $quality;
    if (album_is_private($album_name)) {
        $title .= ' - album privé';
    }
    $title .= ')';
    // Feed subtitle, for itunes
    $subtitle = $metadata['name'] . ' ' . $metadata['description'] . ' (' . $quality . ')';
    // Album name
    $album_name = $metadata['name'];
    // Feed description
    $description = $metadata['description'];
    // Path to the thumbnail image
    $thumbnail_url = $ezplayer_url . '/images/rss_logo_HD.jpg';
    if ($type == 'low') {
        $thumbnail_url = $ezplayer_url . '/images/rss_logo_SD.jpg';
    }
    // Path to the file
    $distribution_url = $distribute_url;
    //
    // And finally, generating the XML file
    //
    $xmlstr = '<?xml version="1.0" encoding="UTF-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/pdcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"></rss>';
    $xml = new SimpleXMLElement($xmlstr);
    $channel = $xml->addChild('channel');
    $channel->addChild('title', $title);
    // Feed title
    $channel->addChild('description', $description);
    // Feed description
    $channel->addChild('copyright', $organization_name);
    // Organization that broadcasts the podcast
    $channel->addChild('generator', 'ezCast feed generator');
    // Script that generated the file
    $channel->addChild('lastBuildDate', date(DATE_RFC822));
    // Date of the last update
    $thumbnail = $channel->addChild('image');
    // All you want to know about the thumbnail image
    $thumbnail->addChild('url', $thumbnail_url);
    $thumbnail->addChild('link', $distribution_url);
    $thumbnail->addChild('title', $album_name);
    $channel->addChild('author', $organization_name, 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    // Author, itunes-friendly version
    $cat = $channel->addChild('category', '', 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    // Categories the feed belongs to
    $cat->addAttribute('text', 'Cours');
    $owner = $channel->addChild('owner', '', 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    // Feed author, once again
    $owner->addChild('name', $organization_name, 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    $owner->addChild('email', $mailto_alert, 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    $channel->addChild('subtitle', $subtitle, 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    $image = $channel->addChild('image', '', 'http://www.itunes.com/dtds/pdcast-1.0.dtd');
    $image->addAttribute('href', $thumbnail_url);
    $atom_link = $channel->addChild('link', '', 'http://www.w3.org/2005/Atom');
    $atom_link->addAttribute('href', $file_path);
    $atom_link->addAttribute('rel', 'self');
    $atom_link->addAttribute('type', 'application/rss+xml');
    return $xml->asXML();
}
if (!ezmam_asset_exists($album, $asset)) {
    myerror("ezmam did not find referenced asset: {$album}, {$asset}");
}
//create directory used to transmit the (video) rendering/processing work to one of the Macs
$processing_dir_name = $asset . "_" . $album . "_intro_title_movie";
$render_dir = $render_root_path . "/processing/" . $processing_dir_name;
mkdir($render_dir);
chmod($render_dir, 0777);
$path_to_videos = $repository_path . '/' . $album . '/' . $asset;
$medias = submit_itm_get_medias($album, $asset);
foreach ($medias as $media_name => $media_path) {
    exec('ln -s ' . $repository_path . '/' . $media_path . ' ' . $render_dir . '/', $output, $val);
}
$asset_meta = ezmam_asset_metadata_get($album, $asset);
//lets get the name of intro movie
$album_meta = ezmam_album_metadata_get($album);
//put title info into $render_dir/title.xml
//generate title description
$res = submit_itm_set_title($album_meta, $asset_meta, $render_dir);
if (!isset($asset_meta['intro'])) {
    if (isset($album_meta['intro'])) {
        $intro = $album_meta['intro'];
    } else {
        $intro = $default_intro;
    }
    //default intro movie from config.inc
} else {
    $intro = $asset_meta['intro'];
}
if (!isset($asset_meta['add_title'])) {
    if (isset($album_meta['add_title'])) {