summaryrefslogtreecommitdiffstats
path: root/lib/class/xmldata.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-12-07 14:02:12 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-12-07 14:02:12 +0000
commit07f8ef395a4d4c6312ded96a039ef58e245e70b0 (patch)
treeae4832d14873950cfb864e5f4a73f5e7814bff14 /lib/class/xmldata.class.php
parent287a46f11e429ff8a11bc646afaeadce122425c6 (diff)
downloadampache-07f8ef395a4d4c6312ded96a039ef58e245e70b0.tar.gz
ampache-07f8ef395a4d4c6312ded96a039ef58e245e70b0.tar.bz2
ampache-07f8ef395a4d4c6312ded96a039ef58e245e70b0.zip
finished up the rss feed stuff for now playing, it is currently the only type that works, should conform to rss standards now
Diffstat (limited to 'lib/class/xmldata.class.php')
-rw-r--r--lib/class/xmldata.class.php17
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";