diff options
Diffstat (limited to 'aud/index.php')
| -rwxr-xr-x | aud/index.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/aud/index.php b/aud/index.php index bfcef6e..2aa9e8e 100755 --- a/aud/index.php +++ b/aud/index.php @@ -43,15 +43,18 @@ return (strpos($name, ".mp3") > 0); } - $files = array_filter(scandir("../../data/deeptwisty/aud"), "test_audio"); + $audiodir = "../../data/deeptwisty/aud"; + + $files = array_filter(scandir($audiodir), "test_audio"); usort($files, function($a, $b) { // Sort files by modification date of the files - return filemtime("$b") - filemtime("$a"); + global $audiodir; + return filemtime("$audiodir/$b") - filemtime("$audiodir/$a"); }); foreach($files as $fi) { //$fitime = filemtime("$fi"); - $fisize = filesize("$fi"); + $fisize = filesize("$audiodir/$fi"); echo "<article><span>$fi</span><audio controls><source src='$fi' type='audio/mpeg'>your browser does not support embedded audio.</audio></article>"; } ?> |
