MyBB Community Forums

Full Version: Include header and footer on other pages.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is it possible to indclude header and footer template on custom pages which is not located the same place as MyBB-Forum. But placed at MyBB-Forum/Subfolder
if you are referring to php custom files then that should be possible by using the header & footer templates !!
But how to do it?
you can make a global template with required header part & another with required footer part
<?php
define("IN_MYBB", 1);
require_once ('/global.php');
eval("\$header1 = \"".$templates->get("customheader")."\";");
echo $header1;

required other content

eval("\$footer1 = \"".$templates->get("customfooter")."\";");
echo $footer1;
?>

OR use a plugin like page-manager
I tried to put that into the page.

But when I do that it only comes out with an error.

I think that the code you gave me is only working if the page is at the same folder as MyBB.
But my page is at a subfolder of my MyBB folder.
^ please check the path of global.php OR lets wait for an expert's guidance Smile
I have also tried this. But without any luck.

<?php
define("IN_MYBB", 1);
require_once ('../global.php');
eval("\$header1 = \"".$templates->get("customheader")."\";");
echo $header1;

required other content

eval("\$footer1 = \"".$templates->get("customfooter")."\";");
echo $footer1;
?>
^ what is the error you are getting ...
I am getting this error

Parse error: syntax error, unexpected '<' in /home/user/domain.com/folder/index.php on line 8

After putting the code in again I got this error instead.

Parse error: syntax error, unexpected T_STRING in /home/user/domain.com/folder/index.php on line 7
So you were using the exact same code ranjani posted? It was just an example...
Pages: 1 2