[INVALID] Board always shows 0 guests

Submitted by Anonymous on Sun, 07/15/2007 - 00:17
Written by
raygene

Hi Dietrich,

Is it normal that when I'm logged in, the Whos' Online box shows:

In the last 60 minutes, 1 member and 0 guest have visited the forums.

But if I logout, it shows:

In the last 60 minutes, 0 member and 0 guest have visited the forums.

Shouldn't it show 1 guest?

Also;

See http://usebb.sourceforge.net/cvs/. The checkins mailing list even contains diffs for each change.

Got the grasp of the CVS changes and what I do is make a small phpBB style mod for those people I switched to useBB who don't understand CVS and email it to them.

BTW, I really like the new changes where you can apply HTML tags in the Terms of Use page.

Cheers,
Gene

Did you try refreshing the page or clicking 'Home' in the navigation?

Gaia

Did you try refreshing the page or clicking 'Home' in the navigation?

Hey! Welcome back!

Yup, but to no avail, even surfed to another site and reloaded my board and nada...

Wonder if it has anything to do with session handling or cookies...

Cheers,
Gene

Thanks :).

Hmm, could be, try re-starting your browser ( exit and restart the application ). I am sure it is just some browser/cookie bug that does it.

Gaia

Thanks :).

Hmm, could be, try re-starting your browser ( exit and restart the application ). I am sure it is just some browser/cookie bug that does it.

Nope, still shows 0 guests but shows that I was on. Could be an IP/cookie thing?

You're welcome to have a look (also the rules page mod, modifed fields and BBcode, etc) at:

My test 1.0.7 site

Gene

Yea, it's not counting me as a guest either. I'm not sure, maybe try setting the 60 minutes back to 30 minutes and see if it works, else you will just have to wait for some help from Dietrich.

Gaia

Yea, it's not counting me as a guest either. I'm not sure, maybe try setting the 60 minutes back to 30 minutes and see if it works, else you will just have to wait for some help from Dietrich.

Did just that and nothing has changed, strange thing is, if I log in and look at the Detailed online list, I see you there as a guest on the index page.

Hope Dietrich will be able to answer that.

Gene

This is not a bug but a limitation of sprintf(), you probably removed "(%d hidden)" from the translation strings. Since these parameters (%s and %d) are not numbered or named, the second %d in the string is the number of hidden members (based on what's the second parameter to sprintf() in the code).

So, what it shows is the number of online members and the number of hidden ones, not guests. You could workaround it by trying to comment the hidden part, i.e.

In the last %d minutes, %d member <!--(%d hidden)--> and %d guest have visited the forums.

etc.

This was already discussed for 2.0 in the mailing list, the new translation system won't have this problem.

Thanks Dietrich,

I had removed (%hidden) from the strings and restored them to orignal then commented out the hidden part and that was the solution. Care to give me a small explanation between the two (removing or commenting out)? I always thought that commenting out code was the same as deleting it.

Thanks,
Gene

<!-- ---> only causes the text to be hidden in HTML, in a PHP string this doesn't make any difference. For this fix to work you only need to make sure there are three %d occurences, commenting out makes it invisible in HTML since this is what you want.

The current approach with sprintf() is fast but causes many problems, such as this one and the fact that you can't change the order of the data.

Thanks for the info, very helpful and another lesson learned. I knew about the HTML bit but didn't know about the PHP one.

Thanks again,
Gene

Just to close the subject being it's not in a valid forum, now that I have the guests showing, why is it that when I login then logout, I get:

In the last 60 minutes, 0 members and 1 guest have visited the forums.

Does the code only count the online people but not the total for the amount set of time, whether they're still online or not?

If I login and out using 2 different usernames, shouldn't it show:

In the last 60 minutes, 2 members and 2 guest have visited the forums?

Sorry to be a pain...
Gene
:oops:

I also have to keep in mind that I'm doing this using the same computer (IP and cookie), wonder if that could be the reason...

Cheers,
Gene

Guests are counted per IP address.

Dietrich

Guests are counted per IP address.

Thanks Dietrich, kinda suspected that. Guess this also applies to Memebrs.

Cheers,
Gene
:D

Guess we can close this subject... LOL

Gene