MyBB Community Forums

Full Version: How to add new php page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys pls who can help me to add new php page to forum
(2021-03-23, 03:34 AM)Vuk Wrote: [ -> ]Hey guys pls who can help me to add new php page to forum

    1.)  Create your MyBB template.

    Admin CP >> Templates & Style >> Templates >> Global Templates >> Add Template

    Name your template whatever you like.

    "Template Set" should be "Global Templates"

    Create your template:
   
<html>
<head>
<title>Your Site</title>
{$headerinclude}
</head>
<body>
{$header}
   Use whatever MyBB Markup you want.
{$footer}
</body>
</html>



    2.)  Create a new PHP file and copy/paste the following lines of code:

<?php

define('IN_MYBB', 1);

define('THIS_SCRIPT', 'your-page-name-goes-here.php');

$templatelist = "your-template-name-goes-here";

require_once './global.php';

add_breadcrumb("your-page-name-goes-here", "your-page-name-goes-here.php");

eval('$your-template-name-goes-here = "'.$templates->get('your-template-name-goes-here').'";');

output_page($your-page-name-goes-here);

?>

edit the placeholders to reflect your page and template names...

after complete then place new .php file in forum root directory....


Best of luck! Big Grin
How to create new php file?
(2021-03-24, 10:11 AM)Vuk Wrote: [ -> ]How to create new php file?

Log into your FTP account.  Navigate to the directory you want the file to be in then you should have an option to create a new file.  How you do this will depend on the FTP Client you have.  An alternative is to create a file on your local computer and then upload it using FTP.
(2021-03-24, 10:11 AM)Vuk Wrote: [ -> ]How to create new php file?

just read your pm, sorry but no, I do not use messenger, skype, teamviewer, keybaseio, or any such type services or such of the likes as they are simply distractions and I am usually busy on non mybb related tasks as mybb is never my priority just something I touch on from time to time to help folks over the years, but if you need further info, just ask me via pm or what not and I will answer whenever I have the free time to do so.