MyBB Community Forums
global.php directory? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: global.php directory? (/thread-209430.html)



global.php directory? - Lewis L - 2017-03-30

I'm trying to create a new page within a folder. I've come across a little problem though, since global.php isn't in the same directory as this new page file its throwing a php error.

What's the correct path for the file to locate global.php outside of its /staff/ directory?

Right now its
require "/global.php"; // (1b)
Which it can't find, I've also tried two slashes as well as including a period but nothing.

Help would definitely be appreciated, I'm sorta stuck.


RE: global.php directory? - .m. - 2017-03-30

require_once "../global.php";

for the relative paths :
./ => current directory
../ => parent directory


RE: global.php directory? - Lewis L - 2017-03-30

(2017-03-30, 02:31 PM).m. Wrote:
require_once "../global.php";

for the relative paths :
./ => current directory
../ => parent directory

Ace! Thanks for teaching me that! Smile

I don't suppose you know why avatars aren't showing up? I've got a header that displays an avatar and it looks like a broken avatar image on that page only, presumably something to do with the directory the page is in. My guess is I need to include a template or something.


RE: global.php directory? - dragonexpert - 2017-03-30

If you right click on an image, you can check the image path to see if it is wrong.