From fe874043dcbb26e1e69b929b33cdaa34c875d8b1 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 16 May 2023 13:48:21 +0200 Subject: include lists in index --- index.php | 10 ++++++++-- lists.php | 16 ---------------- moc-commands.php | 26 ++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 18 deletions(-) delete mode 100644 lists.php create mode 100644 moc-commands.php diff --git a/index.php b/index.php index bf7ddb6..c9eef41 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,7 @@ $max_file_len)) + if ($max_line_len && (strlen($file) > $max_file_len)) $file = "..." . substr($file,3-$max_file_len); return $state . " " . $file . " (" . $time . ")"; } @@ -121,7 +123,7 @@ if (!array_key_exists('what',$_GET)) { print '">' . $key . '
' . "\n"; } ?> - lists
+ lists
$list) { - print "" . $list . "
\n"; -} 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 @@ +back
' . "\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 '' . $list . "
\n"; + } +} -- cgit v1.2.3-70-g09d2