User online statistics were invisible when all active users were invisible
authorMarcel Werk <burntime@woltlab.com>
Wed, 11 May 2022 10:24:06 +0000 (12:24 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 11 May 2022 10:24:06 +0000 (12:24 +0200)
com.woltlab.wcf/templates/boxUsersOnlineSidebar.tpl
wcfsetup/install/files/lib/system/box/UserOnlineListBoxController.class.php

index f713a8a1605223e6b365c9750298882820cecbd5..2c94494eed25d3e358700ba1ffa04abf10e640da 100644 (file)
@@ -1,7 +1,9 @@
-<ul class="inlineList commaSeparated small">
-       {foreach from=$usersOnlineList->getObjects() item=userOnline}
-               <li>{user object=$userOnline}</li>
-       {/foreach}
-</ul>
+{if $usersOnlineList|count}
+       <ul class="inlineList commaSeparated small">
+               {foreach from=$usersOnlineList->getObjects() item=userOnline}
+                       <li>{user object=$userOnline}</li>
+               {/foreach}
+       </ul>
+{/if}
 
 <p><small>{lang}wcf.user.usersOnline.detail{/lang}{if USERS_ONLINE_RECORD && $__showRecord} <span class="separatorLeft">{lang}wcf.user.usersOnline.record{/lang}</span>{/if}</small></p>
index 677a4c5cd5ab0eee17aff0f25118ca561fa1b63d..5741ece0c2ba7d8a678ba1f3e0b53f32bd76939a 100644 (file)
@@ -127,7 +127,9 @@ class UserOnlineListBoxController extends AbstractDatabaseObjectListBoxControlle
             return false;
         }
 
-        return parent::hasContent();
+        parent::hasContent();
+
+        return $this->objectList->stats['total'] > 0;
     }
 
     /**