MyBB Community Forums

Full Version: [SOLVED] How to access settings from plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've created a simple donations plugin that shows how much money has been donated and what the goal is. This is shown in a box on the sidebar of the portal.

It all works fine but my only problem is that I can't seem to make it get the values from the settings (current donations, target donations) to display in the box.

How exactly can I do this?
Use setting's variables inside the plugin's template;
Current Donations: {$mybb->settings['current_donations']}
Target Donations: {$mybb->settings['target_donations']}

Make sure the setting name is correct in both of these variables.
That did the trick, thanks.

One last question, any tips on doing a percentage calculation inside the template?
You can't calculate it inside the template. You may calculate it in your plugin's function and then call that calculated variable in template.
Thanks, I assume I do this with hooks?
Yes..