2014-09-03, 12:23 PM
The hint that x invisible users are browsing a forum / thread is only displayed, when the invisible user count is greater than 1.
$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 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:
fixes the issue and makes much more sense to me... don't know if it's the best solution, but it works xD
$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 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