MyBB Community Forums
Settings button to reset database - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Settings button to reset database (/thread-187032.html)



Settings button to reset database - Hugop - 2015-12-10

How can I add a button to my plug-in settings that runs a code to reset a part of the database once clicked?


RE: Settings button to reset database - Destroy666 - 2015-12-16

Why would you reset a DB part after pressing a button in settings? That defeats the purpose of a setting, because you don't set any value, you just do an action immediately. Instead you should rather add that either to the plugin's description or on a separate subpage. Example in one of my plugins:
https://github.com/Destroy666x/MyBB-Store-Fake-IPs/blob/master/upload/inc/plugins/store_fake_ips.php#L38-L45
https://github.com/Destroy666x/MyBB-Store-Fake-IPs/blob/master/upload/inc/plugins/store_fake_ips.php#L117-L159