MyBB Community Forums

Full Version: Execute query on setting change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

For some reason I wonder if I am able to execute another query when a setting in a plugin I'm creating has been changed, or at least if the form is submitted.

Is this possible without adding another hook or anything?

Thanks in advance.
You need to add some hook in Settings page (if it exists, dont know)

Then check it with this condition:

if($mybb->request_method == post && isset($mybb->input['submit']))
{ //DO UPDATE QUERY }

and also, I am not sure if settings button name is SUBMIT. Smile
There is a hook 'admin_config_settings_change_commit'. Google SEO uses it to kill its URL cache when someone changes URL settings.