The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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. |
#2
|
||||
|
||||
![]()
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.
|
#3
|
|||
|
|||
![]()
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(); echo "<center><font color=\"yellow\"><font size=\"+1\"><b>This is a test of the maintenance system message.</b></font></center>"; $closemessage = ob_get_contents(); ob_end_clean(); |
#4
|
||||
|
||||
![]()
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:
|
#5
|
|||
|
|||
![]()
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.
|
#6
|
|||
|
|||
![]()
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:
|
#7
|
|||
|
|||
![]()
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 |
#8
|
|||
|
|||
![]()
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"> <center><font color=\"yellow\"><font size=\"+1\"><b>$vbulletin->closemessage</b></font></center>"; </if> 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. |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|