summaryrefslogtreecommitdiff
path: root/moc-commands.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-05-16 13:48:21 +0200
committerErich Eckner <git@eckner.net>2023-05-16 14:35:19 +0200
commitfe874043dcbb26e1e69b929b33cdaa34c875d8b1 (patch)
tree70c238bb2993c2ae5f16e92844cf95092d8b2f8a /moc-commands.php
parent906e3c854f8d0a51a1892d571ce0d5606174eaed (diff)
downloadmocp-web-fe874043dcbb26e1e69b929b33cdaa34c875d8b1.tar.xz
include lists in index
Diffstat (limited to 'moc-commands.php')
-rw-r--r--moc-commands.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/moc-commands.php b/moc-commands.php
new file mode 100644
index 0000000..4baddb2
--- /dev/null
+++ b/moc-commands.php
@@ -0,0 +1,26 @@
+<?php
+
+function print_neutral_back_link() {
+ print '<a href="/';
+ attach_key('?');
+ print '">back</a><br>' . "\n";
+}
+
+function print_lists() {
+ $handle = popen("LC_ALL=C ls ~musix/.moc/Listen", "r");
+ $i = 1;
+ while (!feof($handle)) {
+ $s = fgets($handle);
+ if (substr($s,0,7) !== "_lokal_") {
+ continue;
+ }
+ $lists[$i] = substr($s,7);
+ $i++;
+ }
+
+ foreach ($lists as $i => $list) {
+ print '<a href="/?what=playlist&list=' . $i;
+ attach_key();
+ print '">' . $list . "</a><br>\n";
+ }
+}