absolute path in phpbb

Discussion forum for MOD Writers regarding MOD Development.
Locked
bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

absolute path in phpbb

Post by bradhulk » Mon Oct 12, 2015 11:28 am

how would you include from document root in phpbb using absolute path like this

Code: Select all

$root = realpath($_SERVER["DOCUMENT_ROOT"]);

include "$root/inc/include1.php";

User avatar
Oyabun1
Former Team Member
Posts: 23163
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

Re: absolute path in phpbb

Post by Oyabun1 » Tue Oct 13, 2015 1:30 am

Don't know why you would want to use $_SERVER["DOCUMENT_ROOT"]? Look at just about any PHP file in the root of the phpBB installation. Most have at least one include in the first 20 lines.
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

Re: absolute path in phpbb

Post by bradhulk » Tue Oct 13, 2015 8:05 am

I have modified the overall_header.html file so that it displays a navigation menu/bar that is consistently used throughout my website...using absolute path would mean that I can use it and the various styles and images that it contains in every file without explicitly having to make a different navigation menu/bar for every directory and sub-directory furthermore it will mean that I can use this same method of obtaining files and their contents for other purposes throughout my modified forum.

Thanks again for the reply.

bradhulk
Registered User
Posts: 33
Joined: Tue Sep 08, 2015 6:01 am

Re: absolute path in phpbb

Post by bradhulk » Tue Oct 13, 2015 8:11 am

found the answer in this viewtopic.php?f=46&t=2113447

Locked

Return to “[3.0.x] MOD Writers Discussion”

Who is online

Users browsing this forum: No registered users and 17 guests