MyBB Community Forums

Full Version: 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.
hi 

How to Add  header & Footer in a Custom PHP Page

this is my php

<?php 

define('IN_MYBB', 1); require "./global.php";

add_breadcrumb("Kerala clan", ""); 

eval("\$html = \"".$templates->get("cockerala")."\";"); 

output_page($html);

?>







this is my template



<head>
<style type="text/css"> 
html {height:100%}
body {
margin:0;
height:100%;
overflow:hidden
}
</style>
</head>
<body>
<iframe allowtransparency=true frameborder=0 id=rf sandbox="allow-same-origin allow-forms allow-scripts" scrolling=auto src="https://clashofclans.com/clans/clan?clanTag=2GV8UVUU" style="width:100%;height:100%"></iframe>
</body>
Templates > Global

Follow the rest of this tutorial.

https://community.mybb.com/thread-116225.html
You can access it with these variables: {$footer}, {$header}
not working
Any solution???
Look at the second part of https://docs.mybb.com/1.8/development/pl...-new-page/.

The below code should work provided that you have created a template named 'cockerala'.

<?php

// Set some useful constants that the core may require or use
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'my_plugin.php');

// Including global.php gives us access to a bunch of MyBB functions and variables
require_once "./global.php";

// Only required because we're using misc_help for our page wrapper
$lang->load("misc");

// Add a breadcrumb
add_breadcrumb('Kerala clan', "#");

eval('$sections  = "' . $templates->get('cockerala') . '";');

// Using the misc_help template for the page wrapper
eval("\$page = \"".$templates->get("misc_help")."\";");

// Spit out the page to the user once we've put all the templates and vars together
output_page($page);

?>