Topic: Sitewide Login/User Status and Info

So I'm trying to simply maintain user information across the site (see if the user is logged in, get the username, user id, etc) to unlock a few extra functions without having two registration/login forms. I found the code that says at the beginning of the page I add:

define('FORUM_ROOT', './forum/');
require FORUM_ROOT.'include/common.php';

Basically, it's including the common.php page just fine, but no matter what I do I keep getting the same message of:

The constant FORUM_ROOT must be defined and point to a valid PunBB installation root directory.

Despite the fact that FORUM_ROOT _IS_ defined. I'm lost, and I've tinkered with this as much as I understand...

Re: Sitewide Login/User Status and Info

reddeth wrote:

So I'm trying to simply maintain user information across the site (see if the user is logged in, get the username, user id, etc) to unlock a few extra functions without having two registration/login forms. I found the code that says at the beginning of the page I add:

define('FORUM_ROOT', './forum/');
require FORUM_ROOT.'include/common.php';

Basically, it's including the common.php page just fine, but no matter what I do I keep getting the same message of:

The constant FORUM_ROOT must be defined and point to a valid PunBB installation root directory.

Despite the fact that FORUM_ROOT _IS_ defined. I'm lost, and I've tinkered with this as much as I understand...

It depends on where your forum is installed, and you need to use the right relative path.

For example, this line: tells to look in the current directory/folder for a folder called "forum"

define('FORUM_ROOT', './forum/');

example folder structure:

www
    current-folder
        forum

Typing in "../forum/" tells the system go up the directory tree one step, then look for a folder called forum"
Typing in "/forum/" tells the system go all the way up to the root of the tree, then look for a folder called "forum"

If your forum isn't in a sub-directory of your current folder, it won't find it.