// This script is licensed GPL. // Change into anything you want/need $hours = 24; $host = "http://posterestante.org/"; $dir = "muziek"; // No need to change anything below here... $wherearewe=dirname(__FILE__); $song = $_GET['song']; if (file_exists($song)) { $diff = (time() - filectime("$song"))/3600; if ($diff < $hours) { header("Content-type: application/mp3"); header("Content-Disposition: attachment; filename=\"$song\""); readfile($song); exit; } else { header('Location: http://posterestante.org/'); exit; } } else { $dh = opendir($wherearewe); while (false !== ($file = readdir($dh))) { if ($file != "." && $file != ".." && eregi("\.mp3$", $file) && (time() - filectime($file))/3600 < $hours) { $files[] = $file; } } closedir($dh); } if (empty($files)) { echo "sorry, no mp3's for you today"; } else { // echo "\n"; foreach ($files as $song) { $diff = round((time() - filectime("$song"))/3600); $left = $hours - $diff; echo "" . $song . ""; echo " (nog " . $left . " uur)
\n"; // echo "\n"; // echo "\n"; } // echo "
" . $song . " (" . $left . " hours left)
\n"; } ?>