avatars: template script to list users
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 28 Jun 2018 21:23:46 +0000 (23:23 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 11:42:40 +0000 (13:42 +0200)
avatars.php [new file with mode: 0644]

diff --git a/avatars.php b/avatars.php
new file mode 100644 (file)
index 0000000..a305ec6
--- /dev/null
@@ -0,0 +1,13 @@
+<?php
+$users = glob("profile/*");
+if (!$users) return;
+
+print '<ul class="cat">';
+
+foreach ($users as $userdir) {
+       $user = pathinfo($userdir, PATHINFO_FILENAME);
+       $name = @file_get_contents("$userdir/name.txt") ?: ucfirst($user);
+       print '<li>'.$name;
+}
+
+print '</ul>';