PDA

View Full Version : Allow Specified Number of Guests on Forum


Gary King
09-27-2003, 10:00 PM
What does this hack do?

This hack allows you to specify how many guests you want to allow to browse your forums simultaneously. If the number of guests is more than the amount you specified, then the new guests will receive an error message stating that there are too many guests browsing the forums. The new guests will be able to browse the forums again when some of the other guests have left.

This hack can drastically reduce your server load, allowing only members to completely enjoy the freedom of being able to browse the forums without having any messages saying there are too many members online :p :)

Enjoy!

mx3
09-28-2003, 01:09 AM
Oooh.....I think I'll install this one once my forums are up again ^_^

MaDCaT75
09-28-2003, 01:40 AM
I would install this but the most amount of guests I have ever had at one time was 5.... god my forum is pathetic :cry:

insanctus
09-28-2003, 01:42 AM
I would install this but I not want googly bots to be getting the error page or closed page.

Gary King
09-28-2003, 01:56 AM
I would install this but I not want googly bots to be getting the error page or closed page.
You could just add some wildcard hostnames to the code, then, to not give the error message to bots.

Logician
09-28-2003, 07:50 AM
This is requested a lot of times, so thanks for releasing it! :)

Dean C
09-28-2003, 10:44 AM
I'd never deny any guests - this is one mean hack :)

ethics
09-28-2003, 01:29 PM
Not sure how this is supposed to work but I applied this last night with a DB value of 5 and I still have 39 guests on my board--from 60 last night.

Gary King
09-28-2003, 02:11 PM
Not sure how this is supposed to work but I applied this last night with a DB value of 5 and I still have 39 guests on my board--from 60 last night.
Just because the who's online shows that there are 39 guests online, doesn't mean they are seeing forums, threads, etc. If it says 39 guests online, and you set the max to 5, then the other 34 is probably seeing the "Too many guests online" error message.

ethics
09-28-2003, 05:48 PM
Actually, I logged off and became a guest by default. I wasn't seeing this message at all, and was able to see my forum.

Gary King
09-28-2003, 06:08 PM
Actually, I logged off and became a guest by default. I wasn't seeing this message at all, and was able to see my forum.
When it says there are 39 guests online, that's not entirely true - it just means there were 39 guests in the past amount of time you specified for the cookie timeout.

This hack actually checks the real number of guests currently browsing the forums. If you want, though, I can help you raise the time frame to be longer.

ethics
09-29-2003, 12:50 AM
Well, right now I have the following:

There are currently 16 members and 41 guests on the boards.

These bots and "guests" have been killing me lately, which is why I thought your hack would help out and save me! :)

Maybe I did something wrong? I DID set the value (in value field) in the DB to 5 though, was I supposed to? There were no instructions to do so but it just seemed logical.

Gary King
09-29-2003, 01:48 AM
Well, right now I have the following:

There are currently 16 members and 41 guests on the boards.

These bots and "guests" have been killing me lately, which is why I thought your hack would help out and save me! :)

Maybe I did something wrong? I DID set the value (in value field) in the DB to 5 though, was I supposed to? There were no instructions to do so but it just seemed logical.
Yes, you did it right.

ethics
09-29-2003, 03:15 PM
Well, if you get a chance, take a peak at http://globalaffairs.org/forum and tell me what you see as a guest.

Gary King
09-29-2003, 06:33 PM
Well, if you get a chance, take a peak at http://globalaffairs.org/forum and tell me what you see as a guest.
You're right in that I don't see the error message, but that's most likely because the other guests who seem to be online in the Who's Online, haven't really been active in the past few seconds (so who aren't really actively browsing your forums at the moment.)

If you want, you could open up global.php, and find $datecut=time()-5; Replace it with $datecut=time()-$cookietimeout;

Then it will work the way you wanted it to :)

ethics
09-29-2003, 10:43 PM
Thanks, will definitely try this out.

gmarik
10-19-2003, 04:26 PM
Nice to to see this working

dethfire
10-21-2003, 10:31 PM
hey gary, my members and I will get this error message periodicly even though we a logged in. Any ideas?

Remi
10-21-2003, 10:48 PM
HI :)

Is there a way to modefy this hack to say ( If the load is higher that 30.00 :D allow 0 guests ).

Thanks

Gary King
10-21-2003, 11:04 PM
hey gary, my members and I will get this error message periodicly even though we a logged in. Any ideas?
Re-download the instructions; I've updated them, thanks for reporting this :)

Gary King
10-21-2003, 11:11 PM
HI :)

Is there a way to modefy this hack to say ( If the load is higher that 30.00 :D allow 0 guests ).

Thanks
I haven't tested this yet, but try the following:

open global.php and before // check to see if there are too many guests online
add if ($bbuserinfo['usergroupid']==0 AND $loadlimit > 30)
{
eval("standarderror(\"".gettemplate('error_toomanyguests')."\");");
exit;
}

It will display the error_toomanyguests template when a guest visits with server load at more than 30; you can simply change the template here, and then create your own if you want a different message :)

dethfire
10-21-2003, 11:26 PM
hey gary, my board says that 89 guests are still active. Is that just because they are at my homepage? How can I make it so the number is true to the number of guest viewing my board? Make sense?

Gary King
10-21-2003, 11:35 PM
That would require a different hack.

dethfire
10-31-2003, 02:56 PM
hey gary, i thought I got this working, but now it doesn't at all. I reinstalled the hack, did the changes posted in this thread and it just doesn't work. I have 142 guests online, I set the limit to 2 and I logout and can still browse the forums. thanks for your help!

Gary King
10-31-2003, 06:01 PM
Did it work before the update?

dethfire
11-01-2003, 01:09 AM
Yeah, but obviously I had the problem before, but it more-or-less worked.

Gary King
11-01-2003, 01:53 AM
What do you mean by "but it more-or-less worked"?
Can I have the URL to your forums?

dethfire
11-01-2003, 02:03 AM
It did work, except for the minor problem mentioned above a week or two ago.

http://www.physicsforums.com

Gary King
11-01-2003, 02:22 AM
hey gary, my board says that 89 guests are still active. Is that just because they are at my homepage? How can I make it so the number is true to the number of guest viewing my board? Make sense?
This one?

dethfire
11-01-2003, 03:35 AM
Post #18

Gary King
11-01-2003, 12:24 PM
The update I made to the install files should have fixed it.

You'll have to uninstall the old hack (remove/change back the changes) then install this new one.

dethfire
11-04-2003, 02:26 PM
The update I made to the install files should have fixed it.

You'll have to uninstall the old hack (remove/change back the changes) then install this new one.

I'm sorry gary, but it still doesn't seem to be working, I am really confused.

Gary King
11-04-2003, 07:15 PM
I'm sorry gary, but it still doesn't seem to be working, I am really confused.
I've updated the instructions, there was a bug.

For you, just find if ($bbuserinfo['usergroupid']==0) and replace with if ($bbuserinfo['userid']==0)