From afa1173a19e08606b5f159807bdf93e84896deac Mon Sep 17 00:00:00 2001 From: xgizzmo Date: Mon, 24 Jul 2006 22:18:44 +0000 Subject: Fix for bug 514 thanks pb1dft --- lib/class/stream.class.php | 39 +++++++++++++++++++++++++++++++++++++++ lib/preferences.php | 1 + 2 files changed, 40 insertions(+) diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index da918fc2..f1500a35 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -176,6 +176,45 @@ class Stream { } // create_asx + /*! + @function create_xspf + @discussion creates an XSPF playlist (Thx PB1DFT) + */ + function create_xspf() { + + header("Cache-control: public"); + header("Content-Disposition: filename=playlist.xspf"); + header("Content-Type: application/xspf+xml;"); + echo "\n"; + echo "\n"; + echo " Ampache XSPF Playlist\n"; + echo " " . htmlspecialchars(conf('site_title')) . "\n"; + echo " " . htmlspecialchars(conf('site_title')) . "\n"; + echo " ". conf('web_path') ."\n"; + echo " \n\n\n\n"; + + foreach ($this->songs as $song_id) { + $song = new Song($song_id); + $song->format_song(); + $url = htmlspecialchars($song->get_url()); + $song_name = $song->f_artist_full . " - " . $song->title . "." . $song->type; + echo " \n"; + echo " $url\n"; + echo " $url\n"; + echo " " . htmlspecialchars($song->title) . "\n"; + echo " " . htmlspecialchars($song->f_artist_full) . "\n"; + echo " \n"; + echo " " . conf('web_path') . htmlspecialchars("/albums.php?action=show&album=") . htmlspecialchars($song->album) . ""; + echo " " . conf('web_path') . "/albumart.php?id=" . htmlspecialchars($song->album) . htmlspecialchars("&thumb=2") . "\n"; + echo " " . htmlspecialchars($song->f_album_full) . "\n"; + echo " " . $song->time . "\n"; + echo " \n\n\n"; + } // end foreach + echo " \n"; + echo "\n"; + + } // create_xspf + /*! @function create_icecast2 @discussion pushes an icecast stream diff --git a/lib/preferences.php b/lib/preferences.php index a94140a6..48430632 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -280,6 +280,7 @@ function create_preference_input($name,$value) { echo "\t\n"; echo "\t\n"; echo "\t\n"; + echo "\t\n"; echo "\n"; break; case 'lang': -- cgit