<?php
function sendPodcast($path)
{
- global $varDir, $host1;
+ global $varDir, $host1, $enablePodcastProxy;
$file = urldecode($path);
if (strpos($file, '..') !== false) {
$sx = simplexml_load_file($cacheFile);
$listItems = array();
- addPreviousItem($listItems, $path);
+
+ $urlHandler = $host1 . 'deredirect.php';
+ if ($enablePodcastProxy) {
+ $urlHandler = $host1 . 'proxy.php';
+ }
foreach ($sx->channel->item as $item) {
$title = (string) $item->title;
$desc = (string) $item->description;
$url = $item->enclosure['url'];
- $listItems[] = '<Item>'
- . '<ItemType>ShowEpisode</ItemType>'
- . '<ShowEpisodeName>' . utf8_decode(htmlspecialchars($title)) . '</ShowEpisodeName>'
- . '<ShowEpisodeURL>' . $host1 . 'play-url?url=' . urlencode($url) . '</ShowEpisodeURL>'
- . '<ShowDesc>' . utf8_decode(htmlspecialchars($desc)) . '</ShowDesc>'
- . '<ShowMime>MP3</ShowMime>'
- . '</Item>';
+ $listItems[] = getEpisodeItem(
+ $title,
+ $urlHandler . '?url=' . urlencode($url),
+ $desc,
+ 'MP3'
+ );
}
- sendListItems($listItems);
+ sendListItems($listItems, buildPreviousItem($path));
}
}
}
-?>
\ No newline at end of file
+?>