vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   SQL Command to Turn On/Off Registrations? (https://vborg.vbsupport.ru/showthread.php?t=300640)

findingpeace 07-31-2013 01:12 AM

SQL Command to Turn On/Off Registrations?
 
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.


All times are GMT. The time now is 01:02 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00975 seconds
  • Memory Usage 1,706KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete