MyBB Community Forums

Full Version: How can I create a new page for my plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello MyBB plugins developers

I have developed two MyBB plugins so far. I just learnt how to do OOP in PHP and would like to strengthen my knowledge in OOP in PHP by developing more MyBB plugins. A problem I encounter is that I do not know how to create a new page for my upcoming plugins. The two plugins I previously created was behind-the-scene scripts so there is no need for additional page.

I have read http://docs.mybb.com/1.8/development/plu...-new-page/. I manage to get the Misc template out. However I do not know how to insert my plugin functions at the middle of the page - content.

I checked some open source MyBB plugins and found out that I can insert a new custom template directly from the plugin itself. However, I wonder how do I make sure that my template will work with the themes of another website?

Any help will be appreciated. Thanks.

* I am a self-taught PHP developer - still beginner.
New templates will work with all cistom themes since you just insert them to the database.
If anything is problematic, it's rather inserting stuff to current template(s) with find_replace_templatesets() function - to avoid issues you need to ensure you're inserting after/before stuff that will be in all themes, such as important variables, and that the needle is as short as possible.

I'm no sure if I understood your question, but if you meant making sure the styling is correct instead - well, just create templates based on the default theme, e.g. always use the tborder class on tables. That's all you can do.
Thank you for giving me an answer. So from my understanding, the template I created will work across all theme if it is based on the default template. The reason is that most of the themes made and build from the default template using almost the same tags. Am I correct?

I will be trying it shorty and let you know if I have any question relating to this here.