git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a7c5afe
)
avatars: gallery of user images
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 28 Jun 2018 21:23:46 +0000
(23:23 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 7 Jul 2018 11:42:40 +0000
(13:42 +0200)
avatars.php
patch
|
blob
|
history
diff --git
a/avatars.php
b/avatars.php
index a305ec632e56cca310b18e115106c33c17c38927..97e27520be127daae114c32faa3cd1cf68430da6 100644
(file)
--- a/
avatars.php
+++ b/
avatars.php
@@
-2,11
+2,22
@@
$users = glob("profile/*");
if (!$users) return;
$users = glob("profile/*");
if (!$users) return;
-print '<ul class="cat">';
+print '<ul class="
gallery
cat">';
foreach ($users as $userdir) {
$user = pathinfo($userdir, PATHINFO_FILENAME);
$name = @file_get_contents("$userdir/name.txt") ?: ucfirst($user);
foreach ($users as $userdir) {
$user = pathinfo($userdir, PATHINFO_FILENAME);
$name = @file_get_contents("$userdir/name.txt") ?: ucfirst($user);
+ if (file_exists("$userdir/avatar.jpg")) {
+ $avatar = sprintf(
+ '<img src="%s" alt="%s" />',
+ "/thumb/100/profile/$user/avatar.jpg",
+ $user
+ );
+ $name = sprintf(
+ '<figure>%s<figcaption>%s</figcaption></figure>',
+ $avatar, $name
+ );
+ }
print '<li>'.$name;
}
print '<li>'.$name;
}