login/admin: recent visitors summary
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 21:03:40 +0000 (23:03 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 23:02:28 +0000 (01:02 +0200)
Include login/list with limit and without columns.
Also links overview pages previously only mentioned privately.

login/admin.html
login/list.php

index 91920630267e6942fcce5d8e2f52351cf9f2be2a..5587799a018517d0e0e56fde99f7bb845d51d981 100644 (file)
@@ -9,3 +9,11 @@ Wijzigingen zijn direct zichtbaar, en worden periodiek bijgehouden:
 <h3>Laatste aanpassingen</h3>
 
 [[login/commits n=10]]
+
+<h3>Recente bezoekers</h3>
+
+[[login/list view=visit order=seen n=5]]
+
+<p class="nav">
+<a href="/login/members">Ledenlijst</a> • <a href="/login/visits">Gebruik</a>
+</p>
index 1f049d84494fc84eb59323cae6e97ddaa47801dc..4883da6c40e6c8c43e3ba1af1ec1989cc1935b68 100644 (file)
@@ -14,11 +14,15 @@ if (@$Place['order'] == 'seen') {
        array_multisort($order, SORT_DESC, SORT_NUMERIC, $users);
 }
 
+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";