View Full Version : Limit guests on forum
jonnerd154
03-13-2005, 12:53 AM
Anyone want to code me a hack that would limit the number of guests allowed on the site? It would be nice to have the ability to limit guests in a proportion to registered users (5 users for every 1 guest), but a static number would be nice too.
Thanks!
boozehound
03-13-2005, 01:07 AM
If you want quick and don't mind dirty, you could just hijack the 'Simultaneous Sessions Limit' setting (in 'Server Settings and Optimization Options') for this purpose. Set this to however many guest sessions you want to allow, then find in includes/sessions.php:
$sessions = $DB_site->query_first("SELECT COUNT(*) AS sessioncount FROM " . TABLE_PREFIX . "session");
and change to:
$sessions = $DB_site->query_first("SELECT COUNT(*) AS sessioncount FROM " . TABLE_PREFIX . "session AS session WHERE session.userid = 0");
Then any guests trying to access the forum when the quota of guests sessions is full will get the busy message.
But of course this is not the way to go if you're already using this setting to limit the number of total sessions (guests and members).
townjester
02-09-2007, 03:26 AM
could you also do this with registerd users instead of guests? and if so, how.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.