MyBB Community Forums

Full Version: Custom PHP Pages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Software: MyBB 1.8

Problem With: Creating custom PHP pages using FTP (FileZilla, specifically)

Problem: I am trying to create a custom PHP page on my website for the Guidebook. I have used the exact same coding and PHP page tutorial on my other website, and it worked wonders. I have tried multiple times, each time with a slightly different tutorial, and every time, none of them works. If you navigate to the php page I set up (/guidebook.php), the entire page is simply blank. I feel like this may be something to do with the new 1.8 software, because when I try the exact same coding out on my 1.6 website, it works.

Evidence: Board link, link to the page in question.

This is the coding I am using in a new global template, named "guidebook":
<title>TITLE HERE</title>
{$headerinclude}{$header}
<br>

CONTENT HERE

{$footer}
<br><br>

And this is the code I am using in a new .php page in my FTP, named "guidebook.php":
<?php

define("IN_MYBB", 1);
define('THIS_SCRIPT', ‘guidebook.php');

$templatelist = “guidebook”;
require_once "./global.php";

add_breadcrumb(“Guidebook”, $_SERVER['PHP_SELF']);

eval("\$guidebook = \"".$templates->get(“guidebook”).”\”;”);
output_page($guidebook);

?>

Again, I am testing out the exact same coding with my other website (on this page) which is still on MyBB 1.6 software, and it works just fine.

Thank you so much for your help, in advance! I greatly appreciate it.
Your global template and custon php file are little bit wrong.

Try that one:

global template "guidebook"
<html>
<head>
<title>Guidebook</title>
{$headerinclude}
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>Guidebook</strong></td>
</tr>
<tr>
<td class="trow1" align="center">
CONTENT HERE
</td>
</tr>
</table>
{$footer}
</body>
</html>

custom php file "guidebook.php" in forum root direction:
<?php
define("IN_MYBB", 1);
define('THIS_SCRIPT', "guidebook.php");

$templatelist = "guidebook";
require("global.php");

add_breadcrumb("Guidebook");

eval("\$guidebook = \"".$templates->get("guidebook")."\";");
output_page($guidebook);
?>
Thank you so much for your prompt response, @SvePu!

I'm at work right now, so I'm not able to test out your solution and see if it works, but I will update you tomorrow on whether it works or not!

I'm not sure why the topic was moved to Plugin Development, as this wasn't looking for support on a plugin...

But nonetheless, what you gave me worked, @SvePu! Thank you so much for your help!