$properties["link"] = $config['rootUrl'] . "/showStation.php/" . $station->id; $properties["title"] = "{$stationName} logo"; //$properties["description"]=""; $rss_writer_object->addimage($properties); } // add items $newProgs = $station->listProgrammes($from, $count); //debug("progs", $newProgs); if (is_array($newProgs)) { foreach ($newProgs as $prog) { $properties = array(); $properties["description"] = $prog->get('abstract'); $properties["link"] = $config['rootUrl'] . "/get.php?id=" . $prog->id; $properties["title"] = $prog->get('title'); if ($prog->get('production_date')) { $properties["dc:date"] = toW3CDate($prog->get('production_date')); } $rss_writer_object->additem($properties); } } // define search box $properties = array(); // The name of the text input form field $properties["name"] = "pattern"; $properties["link"] = $config['rootUrl'] . "/search.php?language=any_language&station={$stationName}"; $properties["title"] = "Search for:"; $properties["description"] = $page->getlocalizedWithParams('search_in_station', $stationName); $rss_writer_object->addtextinput($properties); } elseif ($userName) { // user's saved query $userid = sotf_User::getUserid($userName);
function addItem(&$rss, &$prog) { global $config; $rss .= "\n\n<item>"; writeTag($rss, "title", $prog->get('title')); /* 08.02.06 start rama hack to print roles */ $roleArr = $prog->getRoles(); $roleArrSize = count($roleArr); for ($i = 0; $i < $roleArrSize; $i++) { $role_name = $roleArr[$i]["role_name"]; $contact_name = $roleArr[$i]["contact_data"]["name"]; //$role_info = "$contact_name, $role_name"; $role_info = array('contact_name' => $contact_name, 'role_name' => $role_name); writeTag($rss, "roles", NULL, NULL, $role_info); } /* end rama hack to print roles */ writeTag($rss, "link", $config['rootUrl'] . "/get.php?id=" . $prog->id); writeTag($rss, "pubDate", toW3CDate($prog->get('entry_date'))); writeTag($rss, "description", $prog->get('abstract')); writeTag($rss, "BroadcastDate", toW3CDate($prog->get('broadcast_date'))); if ($prog->isVideoPrg()) { $type = 'video/mov'; } else { $type = 'audio/mpeg'; } $audioAttrs = selectAudioVideo($prog); if ($audioAttrs['url']) { //MODIFIED BY Martin Schmidt, was if($audioAttrs) //$filepath = $prog->getFilePath($audioAttrs); //$tmpFile = linkAudio($filepath, $audioAttrs); $enclAttrs = array('type' => $type, 'length' => $audioAttrs['filesize'], 'url' => $audioAttrs['url']); writeTag($rss, "enclosure", NULL, NULL, $enclAttrs); } $streamAttrs = selectStream($prog); if ($streamAttrs['url']) { //MODIFIED BY Martin Schmidt, was if($streamAttrs) //$filepath = $prog->getFilePath($audioAttrs); //$tmpFile = linkAudio($filepath, $audioAttrs); $enclAttrs = array('type' => $type, 'length' => $streamAttrs['filesize'], 'url' => $streamAttrs['url']); writeTag($rss, "streamurl", NULL, NULL, $enclAttrs); } $rss .= "\n</item>"; }
function addItem(&$rss, &$prog) { global $config; $rss .= "\n\n<item>"; writeTag($rss, "title", $prog->get('title')); writeTag($rss, "link", $config['rootUrl'] . "/get.php?id=" . $prog->id); writeTag($rss, "pubDate", toW3CDate($prog->get('entry_date'))); writeTag($rss, "description", $prog->get('abstract')); writeTag($rss, "guid", $prog->get('id')); writeTag($rss, "sotf:episodesequence", $prog->get('episode_sequence')); writeTag($rss, "sotf:episodetitle", $prog->get('episode_title')); writeTag($rss, "sotf:broadcastdate", $prog->get('broadcast_date')); $files = $prog->getAssociatedObjects('sotf_media_files', 'main_content DESC, filename'); for ($i = 0; $i < count($files); $i++) { $files[$i] = array_merge($files[$i], sotf_AudioFile::decodeFormatFilename($files[$i]['format'])); $files[$i]['playtime_string'] = strftime('%M:%S', $fFiles[$i]['play_length']); } if ($files) { $rss .= "\n<sotf:mediafiles>"; foreach ($files as $f) { if ($f['stream_access'] = 't') { #$rss .= "\n<sotf:mediafileitem>"; #writeTag($rss, "sotf:mediafileurl", $config['rootUrl']."/listen.php/audio.m3u?id=".$prog->get('id')); #writeTag($rss, "sotf:mediafileimage", $config['rootUrl']."/static/listen.gif"); #writeTag($rss, "sotf:mediafiletype", "audio"); #writeTag($rss, "sotf:mediafilebitrate", $f['bitrate']); #writeTag($rss, "sotf:mediafileformat", $f['format']); #$rss .= "\n</sotf:mediafileitem>"; $rss .= "\n<sotf:mediafileitem url=\"" . $config['rootUrl'] . "/listen.php/audio.m3u?id=" . $prog->get('id') . "\" image=\"" . $config['rootUrl'] . "/static/listen.gif\" type=\"audiostream\" bitrate=\"" . $f['bitrate'] . "\" format=\"" . $f['format'] . "\" />"; } if ($f['download_access'] = 't') { #$rss .= "\n<sotf:mediafileitem>"; #writeTag($rss, "sotf:mediafileurl", $config['rootUrl']."/getFile.php/".$f['filename']."?audio=1&id=".$prog->get('id')."&filename=".$f['filename']); #writeTag($rss, "sotf:mediafileimage", $config['rootUrl']."/static/download.gif"); #writeTag($rss, "sotf:mediafiletype", "audio"); #writeTag($rss, "sotf:mediafilebitrate", $f['bitrate']); #writeTag($rss, "sotf:mediafileformat", $f['format']); #$rss .= "\n</sotf:mediafileitem>"; $rss .= "\n<sotf:mediafileitem url=\"" . $config['rootUrl'] . "/getFile.php/fid__" . $f['id'] . "\" image=\"" . $config['rootUrl'] . "/static/download.gif\" type=\"audiofile\" bitrate=\"" . $f['bitrate'] . "\" format=\"" . $f['format'] . "\" />"; } } $rss .= "\n</sotf:mediafiles>"; } $rss .= "\n</item>"; }