View Full Version : SQL Command to Turn On/Off Registrations?
findingpeace
07-31-2013, 01:12 AM
We'd like our admins to be able to turn on/off registrations in one click from our private admin sidebar (on forum home).
Does anyone know what SQL command I would need to put in a plugin to make this possible?
Thank you!
Thunderbird8
07-31-2013, 09:33 AM
You'll need more than a SQL command to do it.
First, the SQL command you are looking for is
UPDATE (TABLE_PREFIX) settings SET value= (0 or 1, I'm sure you can figure out which is which here) WHERE varname='bbactive';
HOWEVER, this is not sufficient. vBulletin actually has a datastore for options, which is actually what it uses when applying the results for any options you've configured. Using a SQL command to alter that won't work, since the actual datastore field contains every single option in the Options section of the ACP. Instead, your plugin would need to pull in the adminfunctions.php file and run the build_options() function within that.
And of course, you'd want to ensure to secure it so that only proper users could access it, but hopefully that's common sense :P.
findingpeace
07-31-2013, 10:11 AM
Thanks so much!
Thunderbird8
08-01-2013, 03:45 AM
Somehow, I misread the thread and thought it was for turning the board on and off. To do that for allowing registration, change bbactive in the above SQL command to allowregistration.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.