From 70da8f231232dbc3bccdb4976d65ba49050a8634 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 26 Oct 2025 04:10:21 +0500 Subject: feat: display uploaded sounds --- lib/config.php | 1 + sounds/index.php | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 sounds/index.php diff --git a/lib/config.php b/lib/config.php index 73c2efb..bdc399b 100644 --- a/lib/config.php +++ b/lib/config.php @@ -11,5 +11,6 @@ define('DB_PASS', $c['database']['pass'] ?? null); define('INSTANCE_NAME', $c['instance']['name'] ?? $_SERVER['HTTP_HOST']); define('SOUND_DIRECTORY', $c['sound']['directory'] ?? "{$_SERVER['DOCUMENT_ROOT']}/static/userdata/sounds"); +define('SOUND_DIRECTORY_PREFIX', $c['sound']['directory_prefix'] ?? "/static/userdata/sounds"); define('IS_JSON_REQUEST', isset($_SERVER['HTTP_ACCEPT']) && str_contains($_SERVER['HTTP_ACCEPT'], 'application/json')); \ No newline at end of file diff --git a/sounds/index.php b/sounds/index.php new file mode 100644 index 0000000..c2a50b8 --- /dev/null +++ b/sounds/index.php @@ -0,0 +1,108 @@ +prepare('SELECT * FROM sounds ORDER BY uploaded_at DESC'); +$stmt->execute(); + +$sounds = $stmt->fetchAll(PDO::FETCH_ASSOC); +?> + + + + + <?= INSTANCE_NAME ?> + + + + + + +
+
+ +
+ + +
+ + +

No sounds

+ +
+
+ + + + + \ No newline at end of file -- cgit v1.2.3