login/list: hide unvisited if ordered by seen
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 19:27:56 +0000 (21:27 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 7 Jul 2018 23:04:38 +0000 (01:04 +0200)
Filter out empty values which are not relevant to the requested view.

login/list.php

index 4883da6c40e6c8c43e3ba1af1ec1989cc1935b68..edf9ee63273a2f76a174e2c1140aaa7e35bafc69 100644 (file)
@@ -12,6 +12,7 @@ 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'])) {