MyBB Community Forums

Full Version: Add MyBB header & Footer in a Custom PHP Page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How to Add MyBB header & Footer in a Custom PHP Page
Please tell me the code by that i can put mybb header & Footer in my custom page..
if it is pure php file then simple method could be to use echo for the header & footer like below
assuming that custom php file is in the forum root folder - if it is not then change path for global.php
<?php
define('IN_MYBB', 1);
require_once ("./global.php");
echo $headerinclude;
echo "<title>______________</title>";
echo $header;

// your php file contents

echo $footer;
?>
1. Create new file newpage.php
<?php
    define('IN_MYBB', 1);
    require_once("global.php");

    add_breadcrumb("Your Forum - Description - New Pages", $_SERVER['PHP_SELF']);

    eval("\$page = \"".$templates->get("new_template")."\";");

    output_page($page);
?>

Save

2. Open your Template, and add new template.
The name "new_template"
<html>
<head>
<title>{$mybb->settings['bbname']} - Your Costum Page</title>
{$headerinclude}
</head>
<body id="forums">
{$header}
<br/>
<center><h2>Your Content Here ;D</center><br/>
<br style="clear: both" />
{$footer}
</body>
</html>

Gluck
thanks both of u but i am getting error. I want to add this in a script that require other file with it and it is in http://mybb.com/tts