Solved: 4 Years, 10 Months, 4 Weeks ago header & Footer in a Custom PHP Page
#1
Solved: 4 Years, 10 Months, 4 Weeks ago
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>
Reply
#2
Solved: 4 Years, 10 Months, 4 Weeks ago
Templates > Global

Follow the rest of this tutorial.

https://community.mybb.com/thread-116225.html
[Image: sig2.jpg]
Reply
#3
Solved: 4 Years, 10 Months, 4 Weeks ago
You can access it with these variables: {$footer}, {$header}
Reply
#4
Solved: 4 Years, 10 Months, 4 Weeks ago
not working
Reply
#5
Solved: 4 Years, 10 Months, 4 Weeks ago
Any solution???
Reply
#6
Solved: 4 Years, 10 Months, 4 Weeks ago
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);

?>
RandomAvatar for newly registered member - click here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)