![]() |
Disabling/Enabling a plugin in PHP
I am creating a custom cpnav menu for a product I am making and one of the options is to enable/disable certain aspects of the product. To disable these aspects I must disable the plugins they depend on.
My question is: How would I go about disabling/enabling a plugin in PHP? I tried having the PHP change the active column to zero in the plugin table but that does not work. |
It will work, you just need to rebuild the datastore afterwards.
Calling build_product_datastore() will do that (you need to make sure adminfunctions.php has been loaded). However, Im not sure why you would present such an option, its a bit odd (and how would they re-enable it). |
Thank you for your help.
I need this option because I want to make it easy for users to disable certain functionality within the product. Disabling these functionalities requires the user to disable more than one plugin, so I figure it will be more user friendly if its done automatically. To re-enable the plugin I figured I'd just set active to 1 and do as you said. I'm doing: vBulletinHook::build_datastore($db); and also... $vbulletin->GPC['active']["{//plugin id}"] = //0 or 1; |
Quote:
Create a custom setting (or settings) in the options, and use them to enable or disable code (using IF statements). |
All times are GMT. The time now is 01:15 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|