3 if (isset($Page->place[0])) {
4 $basepath .= '/.tags/' . $Page->place[0];
6 $users = glob("$basepath/*", GLOB_ONLYDIR);
9 foreach ($users as $col => $userdir) {
10 $users[$col] = new User($userdir);
13 if (isset($Page->place['order'])) {
14 $ordercol = $Page->place['order'];
15 $order = array_map(function ($row) use ($ordercol) {
16 return $row->$ordercol;
18 # $order = array_column($users, $ordercol); #TODO php7 simplification
19 if ($ordercol == 'seen') {
20 array_multisort($order, SORT_DESC, SORT_NUMERIC, $users);
21 $users = array_intersect_key($users, array_filter($order));
24 array_multisort($order, SORT_ASC, SORT_NATURAL, $users);
28 if (isset($Page->place['n'])) {
29 array_splice($users, $Page->place['n']); # limit number of results
33 if (@$Page->place['view'] == 'avatar') {
34 print ' class="gallery cat"';
36 elseif (count($users) > 5) {
37 print ' class="cols"';
41 foreach ($users as $user) {
43 if ($GLOBALS['User'] and $GLOBALS['User']->admin('user')) {
44 $link = '/login/edit/'.$user->login;
45 $name = sprintf('<a href="%s">%s</a>', $link, $name);
48 switch (@$Page->place['view']) {
50 if (!file_exists("{$user->dir}/avatar.jpg")) {
54 '<img src="%s" alt="%s" />',
55 "/thumb/100/profile/{$user->login}/avatar.jpg",
59 '<figure>%s<figcaption>%s</figcaption></figure>',
65 $name .= sprintf(' <small class="date">%s</small>', strftime('%F %H:%M', $user->seen));
70 $name .= ' <span class="icon admin" title="beheerder">🔧</span>';
72 $name = "<div>$name</div>";
75 print "<li>$name</li>\n";