$newProgs = $series->listProgrammes(0, $items); //debug("progs", $newProgs); if (is_array($newProgs)) { foreach ($newProgs as $prog) { addItem($rss, $prog); } } $rss .= "\n</channel>"; } elseif ($stationId) { // *************** STATION ******************* // send list of new progs in station if ($repository->looksLikeId($stationId)) { $station = $repository->getObject($stationId); } if (!$station) { $station = sotf_Station::getByName($stationId); } if (!$station) { raiseError("no such station: {$stationName}"); } // define channel $rss .= "\n<channel>"; writeTag($rss, "title", $station->get('name')); writeTag($rss, "link", $config['rootUrl'] . "/showStation.php/" . $station->id); writeTag($rss, "language", $station->get2LetterLanguageCode()); writeTag($rss, "description", $station->get('description')); // TODO: editor e-mail writeTag($rss, "webMaster", $config['adminEmail']); //writeTag($rss, "pubDate", getW3CDate()); // get and cache station icon $stationData = $station->getAllWithIcon();
$now = getDate(); $dayInThePast = mktime(0, 0, 0, $now['mon'], $now['mday'] - 10, $now['year']); $fromDay = date('Y-m-d', $dayInThePast); // prepare RSS writer $rss_writer_object = new rss_writer_class(); $rss_writer_object->specification = "1.0"; $rss_writer_object->about = $config['rootUrl'] . "/rss.php"; // Specify the URL of an optional XSL stylesheet. This lets the document be rendered automatically in XML capable browsers. $rss_writer_object->stylesheet = $config['rootUrl'] . "/static/rss2html.xsl"; // When generating RSS version 1.0, you may declare additional namespaces that enable the use of // more property tags defined by extension modules of the RSS specification. $rss_writer_object->rssnamespaces["dc"] = "http://purl.org/dc/elements/1.1/"; // do the job, fill in RSS if ($stationName) { // send list of new progs in station $station = sotf_Station::getByName($stationName); if (!$station) { raiseError("no such station: {$stationName}"); } // define channel $properties = array(); $properties["description"] = "New programmes at {$stationName}"; $properties["link"] = $config['rootUrl'] . "/showStation.php/" . $station->id; $properties["title"] = "{$stationName}"; //$properties["language"]="en"; $properties["dc:date"] = date("Y-m-d H:i:s"); // "2002-05-06T00:00:00Z"; $rss_writer_object->addchannel($properties); // get and cache station icon $stationData = $station->getAllWithIcon(); if ($stationData['icon']) {