From 07f8ef395a4d4c6312ded96a039ef58e245e70b0 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sun, 7 Dec 2008 14:02:12 +0000 Subject: finished up the rss feed stuff for now playing, it is currently the only type that works, should conform to rss standards now --- lib/class/xmldata.class.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'lib/class/xmldata.class.php') 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\n\t" . Config::get('web_path') . "\n\t" . - "$date\n"; + "" . date("r",$date) . "\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 = "\n " . - "\n" . + "\n\n"; break; default: $header = "\n\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\n\n"; + $footer = "\n\n\n"; break; default: $footer = "\n\n"; -- cgit