MyBB Community Forums

Full Version: Plugins and Templates
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is MyBB planning on writing plugin documentation? And templates, hooks, etc.? I know there is some information available, but is is rather difficult to grasp. I have searched for many hours on internet, there is little information available. What variables (globals) are there? How do you pass variables from plugins to templates, etc. etc.? I can't seem to pass a variable from a plugin to a template. Very frustrating. Do I use the wrong hook? I have many questions about the plugin / template system.
If you're going to parse a template just eval("\$template = \"".$templates->get('the_template')."\""); and the variables in the template will automatically parsed by the eval statement. If you're trying to define variables in your plugin function and the template is run after the plugin hook, try making the variable you want to edit 'static', instead of global, and pass it by reference (&). That may work, but I'm not sure.