From 906e3c854f8d0a51a1892d571ce0d5606174eaed Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 16 May 2023 13:36:25 +0200 Subject: geht jetzt, laggt aber noch ein bisschen --- index.php | 111 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 94 insertions(+), 17 deletions(-) diff --git a/index.php b/index.php index 5d4e1f3..bf7ddb6 100644 --- a/index.php +++ b/index.php @@ -1,26 +1,81 @@ + + + + + - all info
- pause
- lists
+
+Passwort: + + +
/dev/null")) as $line) { if (substr($line,0,7)=="State: ") $state = substr($line,7); @@ -30,25 +85,47 @@ function details() { $time = substr($line,10); } $max_file_len = $max_line_len - 4 - strlen($state) - strlen($time); - if (strlen($file) > $max_file_len) + if ($max_lin_len && (strlen($file) > $max_file_len)) $file = "..." . substr($file,3-$max_file_len); return $state . " " . $file . " (" . $time . ")"; } -function list_info() { - global $max_line_len; +function list_info($max_line_len = 0) { $list = substr(shell_exec("head -n1 ~musix/.moc/_playlist.m3u"),0,-1); $cnt = substr(shell_exec("wc -l < ~musix/.moc/Listen/" . $list),0,-1); $max_list_len = $max_line_len - 3 - strlen($cnt); - if (strlen($list) > $max_list_len) + if ($max_line_len && (strlen($list) > $max_list_len)) $list = "..." . substr($list,3-$max_list_len); return $list . " (" . $cnt . ")"; } function print_redirect() { ?> - + + + + \n"; + print details() . "
\n"; +?> + all info
+ $command) { + print ' ' . $key . '
' . "\n"; + } +?> + lists
+ + +