Posts: 309
Threads: 50
Joined: Oct 2007
Reputation:
6
2008-12-16, 04:19 AM
(This post was last modified: 2008-12-21, 04:51 PM by Ryan Gordon.)
Hi,
I noticed that Who's online counter is performing the following calculation:
Members + Invisibles + Guests + Bots
I think it should be:
Members + Guests + Bots
since all the Invisibles are Members as well.
I'm using 1.4.4.
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2008-12-16, 10:16 AM
(This post was last modified: 2008-12-16, 10:16 AM by Matt.)
So say there were 5 members online, and 2 were invisible, it would say 7 are online?? Just so make sure I'm understanding.
Posts: 7,248
Threads: 113
Joined: Jun 2008
Reputation:
117
Take a look at how it works... $onlinecount is the total amount of people online (index.php):
// Build the who's online bit on the index page.
$onlinecount = $membercount + $guestcount + $botcount;
// If we can see invisible users add them to the count
if($mybb->usergroup['canviewwolinvis'] == 1)
{
$onlinecount += $anoncount;
}
// If we can't see invisible users but the user is an invisible user incriment the count by one
if($mybb->usergroup['canviewwolinvis'] != 1 && $mybb->user['invisible'] == 1)
{
++$onlinecount;
}
Basically, it's members + guests + bots, then if you're able to see invisibles, that is added too. Although, I can't reproduce anything from tests on a new 1.4.4 install - which plugins do you have?
Also, see: Whos online bug/ISSUE?? MYBB 1.4.4
Posts: 34
Threads: 3
Joined: Jul 2007
Reputation:
0
the code is fine. invisible users get in the count, but if the forum detects them as invisible then their total value goes back to 0 again.
Yes, it's true. I'm Hiro Nagamura
Posts: 981
Threads: 66
Joined: Sep 2006
Reputation:
1
Add me as having the same problem..
Posted in this thread with pic-----> http://community.mybboard.net/thread-42003.html
Posts: 309
Threads: 50
Joined: Oct 2007
Reputation:
6
2008-12-17, 04:05 PM
(This post was last modified: 2008-12-17, 04:06 PM by EviLito.)
(2008-12-16, 10:16 AM)MattR Wrote: So say there were 5 members online, and 2 were invisible, it would say 7 are online?? Just so make sure I'm understanding.
Exactly
(2008-12-16, 10:26 AM)Tom.M Wrote: Take a look at how it works...
Thanks for showing the code.
(2008-12-16, 10:26 AM)Tom.M Wrote: Basically, it's members + guests + bots, then if you're able to see invisibles, that is added too.
Well, I guess that is an undesired behavior (a.k.a bug). As I can see, $anoncount is part of $membercount, so you're adding more users than they really are. Example: "5 members, 2 of whom are invisible" means that the 2 invisibles, are part of the total of 5 members. So, the total online here must be 5, not 7, just as this guy is showing in this thread.
Posts: 37,498
Threads: 399
Joined: Apr 2008
Reputation:
776
2008-12-17, 04:48 PM
(This post was last modified: 2008-12-17, 04:49 PM by Matt.)
I would consider that a bug then, if it can be reproduced. As you said, it shouldn't add visible users to invisible users, it should count how many are online, regardless of visibility, and then give the invisible count next to it.
Posts: 5,344
Threads: 198
Joined: Feb 2007
Reputation:
38
2008-12-19, 05:55 AM
(This post was last modified: 2008-12-19, 05:55 AM by Imad Jomaa.)
I see the problem here. Let's say their are 5 members online, 2 Invisible, and 2 Guests. It will count the total of 9. However, even as an admin or mod who can see the invisible users, their are only 5 or a 7 total including guests. Its basically double counting. I'm going to do some further tests on this however, to make sure it's actually reproduceable.
Posts: 9,866
Threads: 594
Joined: Jan 2006
Well if it's overcounting the invisibles that's easy to fix by just not including them in the total.
Posts: 16,264
Threads: 579
Joined: Oct 2005
Reputation:
39
You guys aren't adding in the # of bots online.
|