add count of archives per user

This commit is contained in:
Ben Harris 2021-08-04 16:48:35 +00:00
parent d451710f2f
commit 2cfef83762
1 changed files with 2 additions and 1 deletions

View File

@ -16,12 +16,13 @@
<hr>
<?php
foreach (glob("/var/www/archive/*") as $dir) {
$archive_count = count(glob("$dir/*.mp3"));
$name = basename($dir);
if ($name == "webhook" || $name == "log" || !is_dir($dir)) continue;
?>
<div class="list-group">
<a href="<?=$name?>/" class="list-group-item">
<p class="list-group-item-text"><?=$name?></p>
<p class="list-group-item-text"><?=$name?> - <?=$archive_count?> archive<?=($archive_count == 1 ? '' : 's')?></p>
</a>
</div>
<?php } ?>