The website is for sale. Check here for more information.
This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.
Help with creating Custom pages in a folder other than mybb root.
#1
I have been creating custom pages using the following code.... and it works great..... if I place it in the mybb root directory of my forum.

PHP Code:
<?php 

$templatelist 
'BookDB7';
define('IN_MYBB'1); require "./global.php";

add_breadcrumb("BookDB7""BookDB7.php"); 

eval(
"\$html = \"".$templates->get("BookDB7")."\";"); 

if(
in_array($mybb->user['usergroup'], array('1','89','120','157')))
{
error("Access denied");


output_page($html);

?>


However I am now needing to move the php page to a sub folder. and When I move it to a sub folder I get an error finding the .global.php file.
I have tried changing path, but I can't get it to work.



So lets say my mybb root directory is MYBBSUPPORT
and my new subfolder is MYBBSUPPORT/Book7

Can can someone help me fix my code so it will work?
Reply
#2
Hi,

PHP Code:
require "../global.php"

Notice the two dots (goes up one folder in the directory path).

Smile
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#3
Ahhhhh..2 dots.. so simple.. yet.. Angry

Thanks
Reply
#4
Is it a 3rd dot if I go down to another sub folder?

example:
MYBBSUPPORT/Book7/page1

PHP Code:
require ".../global.php"


cause it does not seem to work  Sad
Reply
#5
Hi,

No Smile

You want
Code:
../../


Regards,
Diogo
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
Reply
#6
of course it is   Confused Blush Tongue 

Thanks again
Reply





Users browsing this thread: 1 Guest(s)

About MyBB-Plugins

Plug Yourself into the best MyBB AddOn.

Copyright © 2009-2021 MyBB-Plugins Forums.

Statistics

  • 51,000+ Posts
  • 19,000+ Members
  • 3,600+ Threads

Impressed? For sure
Check Full Stats here