![]() |
Activating a plugin via a query - or how to update the cache?
Hello all,
I want to activate a plugin via a mySQL query, just to put up a message at a certain time, then turn it off again. I worked out how to activate/deactivate it via a query... However, the page does't update - some sort of cache I suspect. Anyone know how to trigger an update of the cache, or a way to achieve what I want? Thanks. |
All you are doing is single a single plugin one time via a query? Perhaps post your code and state the goal and we can see what is going on.
|
I just want to put up a message saying that we're closing for maintenance, then turn it off after maintenance.
The plugin is simply: HTML Code:
ob_start(); |
Why are you not using the actual option to do this? vboptions > turn vb board on / off > reason for turning forum off
And why not just say: PHP Code:
|
Because this isn't to turn the forum off, it's to give a warning that it will be turned off. So ten minutes before maintenance it lets people know and they can avoid starting to make long posts.
|
When the acp updates the active status of a plugin (in admincp/plugin/php) it calls vBulletinHook::build_datastore() which is in includes/class_hook.php. So you'd probably want something like:
PHP Code:
|
Thanks for the response kh99.
Well, that half works! It works to turn the plugin off via command line... but doesn't work to turn it on. Any ideas? Thanks |
I don't know why that doesn't work. But I have an alternative suggestion: create a plugin (always active) using hook init_startup with code:
Code:
$datastore_fetch[]="'closemessage'"; Then in your template use something like: Code:
<if condition="$vbulletin->closemessage"> To turn off the message you could either delete the record or set the message to a null string. I haven't tried this myself but it seems like it should work, and I think it's less complicated than rebuilding the plugin datastore. ETA: another idea would be to add a setting under vBulletin options (which you can do when the site is in debug mode), then figure out where to change the value in the database. That would have the advantage of letting you also set it from the acp if you wanted. |
All times are GMT. The time now is 07:13 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:
|