2011-03-29, 01:27 AM
Disclaimer: I'm brand new to MyBB and have spent the last 2 hours looking for a solution to this problem but came up empty, hence the post here.
Hi guys,
I want to integrate MyBB into my site using my custom header.php and footer.php files, which output my site's navigation and footer, respectively. Just to give you an idea, here's the header.php code:
When I tried to edited my theme's "header" template with this, I learned that MyBB doesn't allow PHP in template files. After much searching, I found this thread, which I thought would solve my problem, but after following the instructions it didn't work, and it looks others have pointed out that this was written for an older version of MyBB and doesn't work anymore. SO...
Could someone please explain to me (keeping in mind I'm a MyBB newb) how I can pull my header.php code into my theme's header template? If the answer is to declare a variable in global.php and then add it to my header template, can you please explain how to do that? I found a couple plugins that allow arbitrary PHP, but they don't sound very secure, so I'd prefer to do it the "right" way if possible.
Thank you for your help!
Hi guys,
I want to integrate MyBB into my site using my custom header.php and footer.php files, which output my site's navigation and footer, respectively. Just to give you an idea, here's the header.php code:
<div class="canvas">
<?php include($_SERVER['DOCUMENT_ROOT'].'/include/masthead.php') ?>
<div class="maincontent">
<div style="clear:both"></div>
When I tried to edited my theme's "header" template with this, I learned that MyBB doesn't allow PHP in template files. After much searching, I found this thread, which I thought would solve my problem, but after following the instructions it didn't work, and it looks others have pointed out that this was written for an older version of MyBB and doesn't work anymore. SO...
Could someone please explain to me (keeping in mind I'm a MyBB newb) how I can pull my header.php code into my theme's header template? If the answer is to declare a variable in global.php and then add it to my header template, can you please explain how to do that? I found a couple plugins that allow arbitrary PHP, but they don't sound very secure, so I'd prefer to do it the "right" way if possible.
Thank you for your help!