コード例 #1
0
ファイル: web_index.php プロジェクト: jingyexu/ezcast
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;
}
コード例 #2
0
ファイル: lib_ezmam.php プロジェクト: jingyexu/ezcast
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();
}