MyBB Community Forums

Full Version: Custom pages outside of main directory?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to create a custom page using this template:

http://community.mybboard.net/showthread.php?tid=6615

However, I was trying to set it as though the .php page is in a subfolder, instead of the folder with global.php. Is this easy to change? So far, this is what I have different:

Original:
<?php

require "./global.php"; // (1)

addnav("Rules page", "rules.php"); // (2)

eval("\$rules = \"".$templates->get("rules")."\";"); // (3)
outputpage($rules); // (4)
?>

Edited:
<?php

require "http://website.com/global.php"; // (1)

addnav("Rules page", "rules.php"); // (2)

eval("\$rules = \"".$templates->get("rules")."\";"); // (3)
outputpage($rules); // (4)
?>
You can't require an file from another ftp like that, you would have to connect to that ftp server then.
It would have to be like this if it is in an subfolder.
require "../global.php";
or
require "../../global.php";
if in 2 subfolders.
Thanks! I ended up creating an index.html redirect page in the subfolder that links to the .php in the main folder. I was wanting to create subdomains and/or alternate domains that link to certain subpages or subforums of the main forum without domain forwarding through my hosting company, thus being able to set the subfolder as the destination.

After re-reading all of that, I think I just confused myself.
Also, I would like to add this functionality in the future, if possible. I've tried the ../global.php, but I get an error on line 26, failed opening required.

If anyone knows how to impliment this easily, let me know!
Well you need to make sure where is that global file. However you can try using the full URL of that file, ofcourse hosted on your server and not any other.