Ejemplo n.º 1
0
    foreach ($hits as $prog) {
        $properties = array();
        $properties["description"] = $prog['abstract'];
        $properties["link"] = $config['rootUrl'] . "/get.php?id=" . $prog['id'];
        $properties["title"] = $prog['title'];
        $properties["dc:date"] = $prog['production_date'];
        $rss_writer_object->additem($properties);
    }
} else {
    // Define the properties of the channel.
    $properties = array();
    $properties["description"] = "New programmes at StreamOnTheFly";
    $properties["link"] = $config['rootUrl'] . "";
    $properties["title"] = "StreamOnTheFly";
    //$properties["language"]="en";
    $properties["dc:date"] = getW3CDate();
    $rss_writer_object->addchannel($properties);
    //  If your channel has a logo, before adding any channel items, specify the logo details this way.
    $properties = array();
    $properties["url"] = $config['rootUrl'] . "/static/sotflogosmall.gif";
    $properties["link"] = $config['rootUrl'] . "";
    $properties["title"] = "StreamOnTheFly logo";
    $properties["description"] = "World wide network of radio archives";
    $rss_writer_object->addimage($properties);
    //  Then add your channel items one by one.
    $newProgs = sotf_Programme::getNewProgrammes($fromDay, $count);
    if (!empty($newProgs)) {
        foreach ($newProgs as $prog) {
            $properties = array();
            $properties["description"] = $prog['abstract'];
            $properties["link"] = $config['rootUrl'] . "/get.php?id=" . $prog['id'];
Ejemplo n.º 2
0
    //************************* PROGRAMME ********************************
    $prg =& $repository->getObject($prgId);
    if (!$prg) {
        raiseError("no such object");
    }
    if (!$prg->getBool('published')) {
        raiseError("not_published_yet");
        exit;
    }
    // define channel
    $rss .= "\n<channel>";
    writeTag($rss, "link", $config['rootUrl'] . "/get.php/" . $prgId);
    writeTag($rss, "title", $prg->get('title') ? $prg->get('title') : 'Untitled');
    writeTag($rss, "description", $prg->get('abstract'));
    writeTag($rss, "language", $prg->get2LetterLanguageCode());
    writeTag($rss, "pubDate", getW3CDate());
    // get and cache programme icon
    $prgData = $prg->getAllWithIcon();
    if ($prgData['icon']) {
        // define icon for series
        $rss .= "\n<image>";
        writeTag($rss, "url", $config['cacheUrl'] . "/{$prgId}.png");
        writeTag($rss, "link", $config['rootUrl'] . "/get.php/" . $prgId);
        writeTag($rss, "title", "programme icon");
        $rss .= "\n</image>";
    }
    $rss .= "\n</channel>";
} elseif ($seriesId) {
    //***************** SERIES *************************************
    //list of new progs in series
    $series = $repository->getObject($seriesId);