diff options
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r-- | lib/class/xmldata.class.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index cae0fa04..1b478df7 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -299,10 +299,13 @@ class xmlData { public static function rss_feed($data,$title,$description,$date) { $string = "\t<title>$title</title>\n\t<link>" . Config::get('web_path') . "</link>\n\t" . - "<pubDate>$date</pubDate>\n"; + "<pubDate>" . date("r",$date) . "</pubDate>\n"; // Pass it to the keyed array xml function - $string .= self::keyed_array($data); + foreach ($data as $item) { + // We need to enclose it in an item tag + $string .= self::keyed_array(array('item'=>$item),1); + } $final = self::_header() . $string . self::_footer(); @@ -315,7 +318,7 @@ class xmlData { * this returns a standard header, there are a few types * so we allow them to pass a type if they want to */ - private static function _header($type='') { + private static function _header() { switch (self::$type) { case 'xspf': @@ -326,8 +329,8 @@ class xmlData { break; case 'rss': $header = "<?xml version=\"1.0\" encoding=\"" . Config::get('site_charset') . "\" ?>\n " . - "<!-- RSS Generated by Ampache v." . Config::get('version') . " on " . date("r",time()) . "\n" . - "<rss version=\"2.0\">\n\t<channel>\n"; + "<!-- RSS Generated by Ampache v." . Config::get('version') . " on " . date("r",time()) . "-->\n" . + "<rss version=\"2.0\">\n<channel>\n"; break; default: $header = "<?xml version=\"1.0\" encoding=\"" . Config::get('site_charset') . "\" ?>\n<root>\n"; @@ -342,11 +345,11 @@ class xmlData { * _footer * this returns the footer for this document, these are pretty boring */ - private static function _footer($type='') { + private static function _footer() { switch (self::$type) { case 'rss': - $footer = "\n\t<channel>\n</rss>\n"; + $footer = "\n</channel>\n</rss>\n"; break; default: $footer = "\n</root>\n"; |