diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-15 18:39:21 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-10-15 18:39:21 +0000 |
commit | 78e5af0d4fd336c8f25d87e70ec1967aa977e236 (patch) | |
tree | 7dbb64491a3a70f5c065b0ce14fdd0ffad01fe07 /lib/rss.php | |
parent | 7222ece706e23142e0d5c8ae01b17c39def32d48 (diff) | |
download | ampache-78e5af0d4fd336c8f25d87e70ec1967aa977e236.tar.gz ampache-78e5af0d4fd336c8f25d87e70ec1967aa977e236.tar.bz2 ampache-78e5af0d4fd336c8f25d87e70ec1967aa977e236.zip |
added per user rss feed support, added the album art to the rss feed and added a sane error message to quarantine
Diffstat (limited to 'lib/rss.php')
-rw-r--r-- | lib/rss.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/rss.php b/lib/rss.php index 27e84324..f4973f29 100644 --- a/lib/rss.php +++ b/lib/rss.php @@ -24,7 +24,7 @@ @discussion creates a RSS fead for the now playing information */ -function show_now_playingRSS () { +function show_now_playingRSS ($username=0) { header ("Content-Type: application/xml"); @@ -36,9 +36,14 @@ header ("Content-Type: application/xml"); $rss_main_language = conf('rss_main_language'); $rss_description = conf('rss_song_description'); - $sql = "SELECT * FROM now_playing ORDER BY start_time DESC"; + if ($username) { + $user = get_user_from_username($username); + $constraint = " WHERE user='" . sql_escape($user->username) . "' "; + } - $db_result = mysql_query($sql, $dbh); + $sql = "SELECT * FROM now_playing $constraint ORDER BY start_time DESC"; + + $db_result = mysql_query($sql, $dbh); $today = date("d-m-Y"); $rss_song_description = $rss_description; echo "<rss version=\"2.0\">"; @@ -57,6 +62,7 @@ header ("Content-Type: application/xml"); $text = "$artist - $song->f_title played by $r->user"; echo "<item> \n"; echo " <title><![CDATA[$text]]></title> \n"; + echo " <image>$web_path/albumart.php?id=$song->album</image>\n"; echo " <link>$web_path/albums.php?action=show&album=$song->album</link>\n"; echo " <description><![CDATA[$song->f_title @ $album is played by $r->user]]></description>\n"; echo " <pubDate>$today</pubDate>\n"; |