Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 313
Member
Member
Offline
Joined: Jan 2000
Posts: 313
I don't think this hack has ever been written, and for me it would be very beneficial, because when my board hits about 400 users on at once it completely kills my server.

I don't mind writing this myself, but some direction on where to start would help.

Basically, let's say the board hits the max allowed (400 or whatever), either the closed page comes up for those users over the max, or something like that. Or a different message, just something along those lines.

Any suggestions would be greatly appreciated.

Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
It wouldn't be too hard to limit the number of registered users that are online at a given time, basically 2 places in ubbt.inc.php (the do_login function and also in the authenticate function where it checks if the remember me key is set. In those 2 spots you'd need to do a COUNT of the total # of users already in the w3t_Online table, before actually inserting/updating their session id in the Users table.

However, the main obstable is the fact that guests don't go through any type of login procedure. So there really wouldn't be any way to limit users that don't login. So, you might have a total of 400 users online, and someone tries to login and they'd get the error message while anyone browsing while not being logged in would not. This kinda defeats the purpose.

The other way to accomplish this would be to do a count of the online total on every call to authenticate. The problem with this method is it would just give the errors out to random users, so a user might be logged in and then all of the sudden get an error that says, sorry we're full. Again, this kind of defeats the purpse and would get rather frustrating for the end user. Not to mention the extra query done on every page to see how many users online in total.

These are the primary reasons why this isn't a standard feature. Of course, maybe someone can think of some other way around the issues above


UBB.threads Developer
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039
Actually, there is a way to achieve the second option and make it so the error would only appear for non-logged in users or guests. Would still give you an extra query per page, but something you can try to see how it works for you. I'll throw a bit of code together in a bit.


UBB.threads Developer
Joined: Jan 2000
Posts: 313
Member
Member
Offline
Joined: Jan 2000
Posts: 313
Adding another query on every page wouldn't be something I'd want to do anyway yep, that's where most of my problems begin with, all of the queries to the DB. It seems that's the only way however.

I would appreciate if anyone has a work-around, I've been trying to come up with one myself, but now I see the problems with it.

Joined: Jan 2000
Posts: 313
Member
Member
Offline
Joined: Jan 2000
Posts: 313
[]Scream said:
Actually, there is a way to achieve the second option and make it so the error would only appear for non-logged in users or guests. Would still give you an extra query per page, but something you can try to see how it works for you. I'll throw a bit of code together in a bit. [/]

Cool, thanks a ton scream for taking the time!

Sponsored Links
Joined: May 1999
Posts: 3,039
Guru
Guru
Offline
Joined: May 1999
Posts: 3,039


UBB.threads Developer

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)