MyBB Community Forums
Keep 'deactivated' - Printable Version

+- MyBB Community Forums (
+-- Forum: Extensions (
+--- Forum: Plugins (
+---- Forum: Plugin Development (
+---- Thread: Keep 'deactivated' (/thread-22936.html)

Keep 'deactivated' - Dennis Tsang - 2006-02-02

If you want to keep your plugin deactivated, put this code in your activate function:

	global $active_plugins, $codename;

I have this used in my "Recount User Posts" plugin, since I only want the users' posts to be recounted when the admin wants (eg. when it's activated), the plugin has no function while activated, so I found a way to make it always deactivated, so that the next time the admin wants the posts recounted, the button will say "Activate" and they wouldn't have to deactivate and reactivate the plugin to recount the posts.

RE: Keep 'deactivated' - Smethead - 2006-02-02

Great discovery (y)

It certainly is useful for some plugins.

RE: Keep 'deactivated' - decswxaqz - 2006-02-12

I just changed one of my mods to include it. Noticed that $active_plugins isn't global.

RE: Keep 'deactivated' - Dennis Tsang - 2006-02-20