Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved [How To?] Include header and footer on other pages.
#1
Not Solved
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
#2
Not Solved
if you are referring to php custom files then that should be possible by using the header & footer templates !!
#3
Not Solved
But how to do it?
#4
Not Solved
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
#5
Not Solved
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.
#6
Not Solved
^ please check the path of global.php OR lets wait for an expert's guidance Smile
#7
Not Solved
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;
?>
#8
Not Solved
^ what is the error you are getting ...
#9
Not Solved
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
#10
Not Solved
So you were using the exact same code ranjani posted? It was just an example...


Forum Jump:


Users browsing this thread: 4 Guest(s)