Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 4 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Disabling Modifications OR Plugins via SQL Query - Fix AdminCP/Forum Access
TheLastSuperman's Avatar
TheLastSuperman
Join Date: Sep 2008
Posts: 5,844

Hey vb.org members and coders! Not much to say except I have a beautiful wife, three fantastic kids

North Carolina
Show Printable Version Email this Page Subscription
TheLastSuperman TheLastSuperman is offline 02-28-2011, 10:00 PM

SKILL LEVEL
  • Beginner (Level 1): Understands basic file uploads and template editing.
  • Intermediate (Level 2): Beginner + Understands basic modification and plugin installation.
  • Advanced Intermediate (Level 3): Intermediate + Understands how to read and comprehend partially PHP and vBulletin syntax plus understands the concepts of interacting with the database.
  • Experienced (Level 4): Advanced Intermediate + Understands how to fully edit and modify a database via phpmyadmin or other including executing SQL queries and more.
  • Master (Level 5): Experienced + Can edit, write and create custom modifications and code. Edit database freely w/o worry or issues and more.

Modification Issues? Not the first or last time you say?

It's either happened to you before or simply not yet! What would that be? On occasion modifications can have some unpredictable or down right "finicky" behavior dependent on a number of possible factors, the end result could possibly have locked you out of your forums control panel.

Normally you can simply disable hooks (modifications and plugins) by doing the following:

Edit config.php and add this directly below <?php:

Code:
define('DISABLE_HOOKS', true);
Example:

Code:
<?php
define('DISABLE_HOOKS', true);
/*======================================================================*\
|| #################################################################### ||
Now save and upload that to includes/ and overwrite the original config.php - That typically allows you access the control panel again, you can now disable the modification you believe is the culprit OR disable them all. Once disabled remove the added line you included in config.php and re-enable one modification at a time until you find the modification in question.

If however your completely locked out for some unknown reason, password not functioning or well ohh geesh sometimes people put themselves in a bind plain and simple when trying their best! To get back into action, if you have phpmyadmin or access to the database directly you can execute a SQL Query to enable or disable any modification.

Running a backup on the tables mentioned below OR an entire database backup is STRONGLY recommended before beginning!

__________________________________

Disable a Modification:

phpMyAdmin > Select the Database in question > Now click on the "product" table > Once loaded find the title of the modification in question, note the productid*

Now for our demonstration let's pretend something is wrong with the CMS included with the vBulletin Suite and it's caused for some odd reason you to become locked out of your admincp, you would find vBulletin CMS in the title, and the productid is what? Yes it's vbcms.

Now you can click SQL and paste this query:

Code:
UPDATE product SET active=0 WHERE productid='vbcms'
Run the query, now the CMS is disabled in the options however as Lynne noticed it must also be disabled in datastore . So while in phpmyadmin:

Edit datastore
Edit products
Edit data

Find:

s:5:"vbcms";s:1:"1";

That's the snippet of code you want to find, it also tells the forum what is enabled and disabled i.e. the cache follow? So change the 1 to a zero to disable example:

s:5:"vbcms";s:1:"0";

Remember your only changing that one value directly after vbcms and s:1 nothing else and you should have many more lines of code similar to that.

Save the change and refresh, now the CMS is completely disabled, if it was the "culprit" not allowing access for whatever unknown reason you may now access the site and or admincp. You can re-enable the modification using the Product Manager once you resolve the issue and run the query again in regards to datastore to enable it again, 1 being active.

Code:
s:5:"vbcms";s:1:"1";
Code:
UPDATE product SET active=1 WHERE productid='vbcms'
Active set to 0 = Disabled
Active set to 1 = Enabled

You can now disable modifications using this method one at a time until your able to login to the admincp, then sort the issue and re-enable your modifications quickly via the product manager.

__________________________________

Disable a Plugin:

phpMyAdmin > Select the Database in question > Now click on the "plugin" table > Once loaded find the modification title of the plugin in question to ensure your disabling the correct one and if it is part of the modification causing the issue, note the pluginid*

Now for our demonstration let's pretend you uninstalled a modification however afterwords you receive a white page w/ error text or similar... something went wrong with the modification (either something coincidental or the author did not write the uninstall code correctly) and it's caused for some odd reason you to become locked out of your admincp, in phpmyadmin execute this query:

Code:
UPDATE plugin SET active=0
*The above per Steve Machol disables the plugins in one query, I originally had you all hunting down individual plugins however Steve commented w/ a good question and a better method i.e.

Quote:
Originally Posted by Steve Machol View Post
Good work. I have a question though. How would someone know which plugin to disable? Wouldn't it be better to just disable them all?

UPDATE plugin SET active=0
Therefor use that SQL query to disable all plugins, now access admincp and delete the plugins associated with the mod you had issues uninstalling!

.........................................

Continue below to disable one plugin at a time - Not required if you use the above method.

If for some reason you would like to disable a single plugin only then you would find the modification name in the "product" area... basically every plugin installed under that product will have the same product name in the plugin table however the pluginid is the actual plugin #. If the pluginid is 937 and you know it's one of the plugins you need to disable in order to get things rolling then execute this query in phpmyadmin:

Code:
UPDATE plugin SET active=0 WHERE pluginid='937'
Run the query, now the plugin is disabled, if it was the "culprit" not allowing access for whatever unknown reason you may now access the site and or admincp. You can run the query again and change active=0 to active=1 and re-enable:

Code:
UPDATE plugin SET active=1 WHERE pluginid='937'
Active set to 0 = Disabled
Active set to 1 = Enabled

You can now disable plugins using this method one at a time until your able to login to the admincp, then sort the issue and re-enable your plugins quickly via the plugin manager.

__________________________________

Notes:

You can disable multiple modifications or plugins by adding a ; behind the query and listing the new command on a new line as shown:

Code:
UPDATE plugin SET active=1 WHERE pluginid='937';
UPDATE plugin SET active=1 WHERE pluginid='938';
UPDATE plugin SET active=1 WHERE pluginid='939';
If your tables have a prefix i.e. vb_ then add that before the first table names in either command i.e.

Code:
UPDATE vb_product SET active=1 WHERE productid='vbcms'
Code:
UPDATE vb_plugin SET active=1 WHERE pluginid='937'
This is just a tidbit of information, it could prove to be quite useful for a few here and there otherwise it's not required in the least and will never be used by 99% of you .
Reply With Quote
  #2  
Old 03-01-2011, 11:36 AM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great article - thank you :up:
Reply With Quote
  #3  
Old 03-01-2011, 01:20 PM
borbole's Avatar
borbole borbole is offline
 
Join Date: Jan 2010
Posts: 2,559
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice article. I think it will come in handy to a lot of users. Nice work TheLastSuperman
Reply With Quote
  #4  
Old 03-02-2011, 07:19 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Princeton View Post
great article - thank you :up:
I'm always smiling when someone of your caliber says thanks, just proves it's so!

Quote:
Originally Posted by borbole View Post
Nice article. I think it will come in handy to a lot of users. Nice work TheLastSuperman
Thanks Borbole although it pales in comparison to the mods you've released here for free and w/o branding... so hats off to you good sir and thanks for being part of the community .
Reply With Quote
  #5  
Old 04-01-2011, 05:57 AM
TheLastSuperman's Avatar
TheLastSuperman TheLastSuperman is offline
Senior Member
 
Join Date: Sep 2008
Location: North Carolina
Posts: 5,844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Added information for disabling a plugin via SQL query.
Reply With Quote
  #6  
Old 12-15-2011, 05:44 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We need to be able to tag articles like this. lol

Thanks for the heads up
Reply With Quote
Благодарность от:
TheLastSuperman
  #7  
Old 05-24-2012, 03:13 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. Needed this query as I didn't want to manually disable them 1 by 1 lol
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:15 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04708 seconds
  • Memory Usage 2,278KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (11)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (2)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete