login/list: wrap each item to allow containment
[minimedit.git] / login / list.php
index 1f049d84494fc84eb59323cae6e97ddaa47801dc..0d9eec2a73240a414961fe378dba12c09ab6eda8 100644 (file)
@@ -12,13 +12,18 @@ if (@$Place['order'] == 'seen') {
        $order = array_map(function ($col) { return $col->seen; }, $users);
 #      $order = array_column($users, 'seen');  #TODO php7 simplification
        array_multisort($order, SORT_DESC, SORT_NUMERIC, $users);
+       $users = array_intersect_key($users, array_filter($order));
+}
+
+if (isset($Place['n'])) {
+       array_splice($users, $Place['n']);  # limit number of results
 }
 
 print '<ul';
 if (@$Place['view'] == 'avatar') {
        print ' class="gallery cat"';
 }
-else {
+elseif (count($users) > 5) {
        print ' class="cols"';
 }
 print ">\n";
@@ -52,8 +57,9 @@ foreach ($users as $user) {
                # continue to default
        default:
                if ($user->admin) {
-                       $name .= ' <em>(beheerder)</em>';
+                       $name .= ' <span class="icon admin" title="beheerder">&#x1F527;</span>';
                }
+               $name = "<div>$name</div>";
        }
 
        print "<li>$name</li>\n";