From be699cab75c8993175a4994316b9665105c86696 Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Sat, 22 Dec 2007 05:14:14 +0000 Subject: fixed opera playback, added playlist mojo to the xml api doodly, konqueror is still broken as is the API and XML-RPC stuff, also updated prototype.js --- lib/class/xmldata.class.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'lib/class/xmldata.class.php') diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index ac776635..6d5baa26 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -206,6 +206,41 @@ class xmlData { } // genres + /** + * playlists + * This takes an array of playlist ids and then returns a nice pretty XML document + */ + public static function playlists($playlists) { + + if (count($playlists) > self::$limit) { + $playlists = array_slice($playlists,self::$offset,self::$limit); + } + + $string = ''; + + // Foreach the playlist ids + foreach ($playlists as $playlist_id) { + $playlist = new Playlist($playlist_id); + $playlist->format(); + $item_total = $playlist->get_song_count(); + + // Build this element + $string .= "id\">\n" . + "\tname]]>\n" . + "\tf_user]]\n" . + "\t$item_total\n" . + "\n"; + + + } // end foreach + + // Build the final and then send her off + $final = self::_header() . $string . self::_footer(); + + return $final; + + } // playlists + /** * songs * This returns an xml document from an array of song ids spiffy isn't it! -- cgit