3 if ($Args) $basepath .= '/.tags' . $Args;
4 $users = glob("$basepath/*/");
7 foreach ($users as $col => $userdir) {
8 $users[$col] = new User($userdir);
11 if (@$Place['order'] == 'seen') {
12 $order = array_map(function ($col) { return $col->seen; }, $users);
13 # $order = array_column($users, 'seen'); #TODO php7 simplification
14 array_multisort($order, SORT_DESC, SORT_NUMERIC, $users);
15 $users = array_intersect_key($users, array_filter($order));
18 if (isset($Place['n'])) {
19 array_splice($users, $Place['n']); # limit number of results
23 if (@$Place['view'] == 'avatar') {
24 print ' class="gallery cat"';
26 elseif (count($users) > 5) {
27 print ' class="cols"';
31 foreach ($users as $user) {
32 $name = $user->name ?: $user->login;
33 if (!empty($GLOBALS['User']['admin'])) {
34 $link = '/login/edit/'.$user->login;
35 $name = sprintf('<a href="%s">%s</a>', $link, $name);
38 switch (@$Place['view']) {
40 if (!file_exists("{$user->dir}/avatar.jpg")) {
44 '<img src="%s" alt="%s" />',
45 "/thumb/100/profile/{$user->login}/avatar.jpg",
49 '<figure>%s<figcaption>%s</figcaption></figure>',
55 $name .= sprintf(' <small class="date">%s</small>', strftime('%F %H:%M', $user->seen));
60 $name .= ' <span class="icon admin" title="beheerder">🔧</span>';
62 $name = "<div>$name</div>";
65 print "<li>$name</li>\n";