aboutsummaryrefslogtreecommitdiff
path: root/aud/index.php
diff options
context:
space:
mode:
authorAda Isopods <me@bathynomus.xyz>2026-10-23 16:01:39 -0600
committerAda Isopods <me@bathynomus.xyz>2026-10-23 16:01:39 -0600
commit46da422000f60eb078b548c16f533ffff13d66fb (patch)
treebe7b831c0e662a5c91ec97dacb4ba2ee8abd2079 /aud/index.php
parente63a26f2320617d771869c68042472cc427ff931 (diff)
fix /aud/ again
Diffstat (limited to 'aud/index.php')
-rwxr-xr-xaud/index.php9
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>";
}
?>