Not Solved [How To?] How to make a new php page with the same theme
#1
Not Solved
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
Reply
#2
Not Solved
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
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply
#3
Not Solved
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 ?
Reply
#4
Not Solved
You name it as you want, but if you want a page called updates.php, it's better to name it updates.php Smile
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)