MyBB Community Forums

Full Version: How to make a new php page with the same theme
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HELLO PEOPLE

i want to know how to make a php page that uses the same theme i use in my forum
i use green dark emerald theme i want to make a new php page called https://myforum.com/updates.php here "updates.php is the php page to be made"
i tried to make one but that page didnt used the theme which is used in the forums.

let me know how to import the theme to a php page.

thank you in advance
regards ,
pepeknife Smile
This is quite simple, your page must have a particular structure:
<?php
// Requirements
define("IN_MYBB", 1);
define("KILL_GLOBALS", 1);
require "global.php";
// Add the navigation
add_breadcrumb("Updates");

// Here, make whatever you want

// Load your template
eval("\$updates = \"".$templates->get("my_updates_tpl")."\";");
output_page($updates);

The template must also have a structure:
<html>
<head>
   <title>{$settings[bbname]} - Updates</title>
   {$headerinclude}
</head>
<body>
   {$header}
   <!-- here is your personal content -->
   {$footer}
</body>
</html>

Note that you can generate html directly in your page, but using templates is better. If you choose to generate "inline", think to put the content of the html in a variable which will be used in the output_page() function, don't do echo
hey thanks for replying.

the above php code you have given should i add it to updates.php

or should i name it what ever i want ?
You name it as you want, but if you want a page called updates.php, it's better to name it updates.php Smile