1 personman Feb 09, 2007 18:57
3 personman Feb 10, 2007 00:31
But how would I trigger that when the plugin settings are saved? Is there an event for that?
4 yabba Feb 10, 2007 00:35
actually, there may be, but buggered if I can remember it at this hour .......
maybe one of these ?
* - PluginSettingsUpdateAction (Called as action before updating the plugin's settings)
* - PluginSettingsEditAction (Called as action before editing the plugin's settings)
* - PluginSettingsEditDisplayAfter (Called after standard plugin settings are displayed for editing)
* - PluginSettingsValidateSet (Called before setting a plugin's setting in the backoffice)
* - PluginUserSettingsUpdateAction (Called as action before updating the plugin's user settings)
* - PluginUserSettingsEditAction (Called as action before editing the plugin's settings)
* - PluginUserSettingsEditDisplayAfter (Called after displaying normal user settings)
* - PluginUserSettingsValidateSet (Called before setting a plugin's user setting in the backoffice)
¥
5 personman Feb 10, 2007 00:37
Ah, thanks. I'll look in the documentation (probably should have done that to begin with).
6 yabba Feb 10, 2007 00:38
probably a wiser move than trusting a blonde ;)
¥
7 personman Feb 10, 2007 00:47
This one should do the trick:
PluginSettingsUpdateAction()
And here's the relevant doc page:
http://doc.b2evolution.net/v-1-9/plugins/Plugin.html
That list of hooks is getting huge. Someone should buy blueyed a beer or something.
8 yabba Feb 10, 2007 01:17
There's be some scary vids on his blog if they did :|
¥
9 personman Feb 11, 2007 23:44
Here's what I ended up using, in case anyone is following along:
function PluginSettingsUpdateAction()
{
global $DB, $Messages, $app_version;
if ($app_version > '1.9') {
$DB->query('DELETE FROM T_item__prerendering WHERE 1');
$Messages->add( sprintf( T_('Removed %d cached entries.'), $DB->rows_affected ), 'success' );
}
}
$sql = 'drop table T_pre_rendering';
$DB->query( $sql );
:roll:
¥