MyBB Community Forums

Full Version: best way to integrate a custom page which including PHP code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am looking for the best way to add a custom page to my forum. The page makes use of PHP code and database queries, and I want it integrated in the theme (so MyBB header and footer must stay intact).

I looked at the Page Manager mod, but it is not an option, since using PHP on the page it generates disables theme integration.

What other options are there? I'm relatively new to MyBB so I could use some pointers. Thanks!
(2011-03-27, 06:19 PM)Yaldaram Wrote: [ -> ]http://mods.mybb.com/view/page-manager

I said I looked at that mod, but it does not work for this purpose Wink
You can use the header and footer with PHP at the same time with that plugin. You just need to actually insert the header and footer manually before your page.
(2011-03-27, 07:41 PM)Vandaahl Wrote: [ -> ]
(2011-03-27, 06:19 PM)Yaldaram Wrote: [ -> ]http://mods.mybb.com/view/page-manager

I said I looked at that mod, but it does not work for this purpose Wink

It should work, you are probably not editing or adding correct codes.
I see. Well, the Page Manager plugin says the following:

Quote:Use MyBB Template?
Set this option to yes, if you want to include MyBB header and footer automatically. This will disable the possibility to use PHP in page content!

Hence the confusion. But if I can add the header/footer manually in the code, that should serve me well. Thanks guys, I will try it out.
(2011-03-28, 11:46 AM)Vandaahl Wrote: [ -> ]I see. Well, the Page Manager plugin says the following:

Quote:Use MyBB Template?
Set this option to yes, if you want to include MyBB header and footer automatically. This will disable the possibility to use PHP in page content!

Hence the confusion. But if I can add the header/footer manually in the code, that should serve me well. Thanks guys, I will try it out.

Read the red part again, If you set it to Yes then you'll not able to use PHP in your page, since {$footer} and {$header} evaluate globally using PHP hence it will not output any thing. (If that option set to Yes)
I have been using Page Manager a lot recently - the ban list is a good start point if you want to try and figure out how to incorporate php into your page.
(2011-03-28, 12:07 PM)Leefish Wrote: [ -> ]I have been using Page Manager a lot recently - the ban list is a good start point if you want to try and figure out how to incorporate php into your page.

Thanks, that gave me a quick start!