<?
include("config.php");
$playlist_name = base64_encode(microtime());
/*if (isset($_GET['act']) && $_GET['act'] == 'quick') {
header("Cache-control: public");
header("Content-Disposition: filename=playlist.pls");
header("Content-Type: audio/x-scpls;");
echo "[Playlist]\n";
echo "NumberOfEntries=" . count($_COOKIE['3z']) . "\n";
foreach ($_COOKIE['3z'] as $song_id) {
$i++;
$song = new Song($song_id);
$song->format_song();
$song_name = $song->f_artist_full . " - " . $song->title . "." . $song->type;
$song_url = $song->get_url();
echo "File" . $i . "=$song_url\n";
echo "Title" . $i . "=$song_name\n";
echo "Length" . $i . "=-1\n";
} // end foreach songs
echo "Version=2\n";
}
elseif (isset($_GET['act']) && $_GET['act'] == 'ram') {
header("Content-Type: audio/x-pn-realaudio");
header("Content-Disposition: inline; filename=\"$playlist_name.ram\"");
foreach ($_COOKIE['3z'] as $i) {
echo $home_dir{$i}."\n";
}
}
else {
header("Content-Type: video/x-ms-asf");
header("Content-Disposition: inline; filename=\"$playlist_name.asx\"");
echo '<ASX VERSION="3">';
foreach ($_COOKIE['3z'] as $i) {
echo "<ENTRY>";
echo "<REF HREF = \"$home_dir{$i}\" />";
echo "</ENTRY>";
}
echo '</ASX>';
}*/
// header("Cache-control: public");
// header("Content-Disposition: filename=playlist.pls");
// header("Content-Type: audio/x-scpls;");
// echo "[Playlist]\n";
// echo "NumberOfEntries=" . count($_COOKIE['3z']) . "\n";
// $i = 0;
// foreach ($_COOKIE['3z'] as $song_id) {
// $i++;
// echo "File" . $i . "=$home_dir{$song_id}\n";
// echo "Title" . $i . "=$song_id\n";
// echo "Length" . $i . "=-1\n";
// } // end foreach songs
// echo "Version=2\n";
//print_r($_COOKIE['3z']);
error_reporting(E_ALL);
// foreach ($_COOKIE['3z'] as $i) {
// echo "$web_path{$i}";
// echo "<ENTRY>";
// }
header("Content-Type: video/x-ms-asf");
header("Content-Disposition: inline; filename=\"$playlist_name.asx\"");
echo '<ASX VERSION="3">';
foreach ($_COOKIE['3z'] as $i) {
// echo "$web_path{$i}";
echo "<ENTRY>";
echo "<REF HREF = \"$web_path{$i}\" />";
echo "</ENTRY>";
}
echo '</ASX>';
?>