diff options
author | Erich Eckner <git@eckner.net> | 2023-05-16 13:48:21 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2023-05-16 14:35:19 +0200 |
commit | fe874043dcbb26e1e69b929b33cdaa34c875d8b1 (patch) | |
tree | 70c238bb2993c2ae5f16e92844cf95092d8b2f8a /moc-commands.php | |
parent | 906e3c854f8d0a51a1892d571ce0d5606174eaed (diff) | |
download | mocp-web-fe874043dcbb26e1e69b929b33cdaa34c875d8b1.tar.xz |
include lists in index
Diffstat (limited to 'moc-commands.php')
-rw-r--r-- | moc-commands.php | 26 |
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"; + } +} |