MyBB Community Forums

Full Version: Forum/Thread: online users: invisible users < 2 not shown
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The hint that x invisible users are browsing a forum / thread is only displayed, when the invisible user count is greater than 1.

$invisonline = '';
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1 && ($inviscount != 1 && $mybb->user['invisible'] != 1))
{
	$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}
$inviscount --> catches the case of 0 invisible users
$inviscount != 1 catches the case of one invisible user. Question is: why? Only explanation I can think of is that a user who is invisible does not see the own name and an invisible hint for himself... but that would be the wrong way to go... 


Edit: ahhh Big Grin second look - inviscount != 1 is only checked if the user is not invisible, but still does not make much sense to me and the behavior is wrong anyway xD

Edit2: 
$invisonline = '';
if($mybb->user['invisible'] == 1)
{
	$inviscount -= 1;
}
if($inviscount && $mybb->usergroup['canviewwolinvis'] != 1)
{
	$invisonline = $lang->sprintf($lang->users_browsing_forum_invis, $inviscount);
}

fixes the issue and makes much more sense to me... don't know if it's the best solution, but it works xD
Anyone?
I can confirm that... but I am not sure about fix
(2014-09-18, 05:49 PM)Eldenroot Wrote: [ -> ]I can confirm that... but I am not sure about fix
The fix is working^^ I tested that, but Big Grin Someone should push this... somewhen Big Grin 
Indeed, the conditional is just wrong. The last && should be switched to || if I see correctly, but your fix does the thing too.

Hi,

Thank you for your report. We have pushed this issue to our Github repository for further analysis where you can track our commits and progress with fixing this bug. Discussions regarding this bug may also take place there too.

Follow this link to visit the issue on Github: https://github.com/mybb/mybb/issues/1456

Thanks for contributing to MyBB!

Regards,
The MyBB Group
It is pushed, feel free to make a pull request Smile
(2014-09-19, 03:32 AM)Destroy666 Wrote: [ -> ]Indeed, the conditional is just wrong. The last && should be switched to || if I see correctly, but your fix does the thing too.
This would display the invisible note, but the invisible count would be wrong (one user too much).
(2014-09-19, 09:26 AM)Nik101010 Wrote: [ -> ]
(2014-09-19, 03:32 AM)Destroy666 Wrote: [ -> ]Indeed, the conditional is just wrong. The last && should be switched to || if I see correctly, but your fix does the thing too.
This would display the invisible note, but the invisible count would be wrong (one user too much).

Ah yes, forgot about that.