MyBB Community Forums

Full Version: Using USER variables in another page.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Eh? It works for one page but not another at the same level?The problem is that you are calling global.php from different levels which are all relative from your current location.
So a file from images/ will need ../forum but a file from images/folder2/ will need a ../../forum/ link

Your best bet then is to define your own ROOT_DIR variable and use that to prefix any values in global.php.
Example

In images/ folder. define ROOT_DIR as ../forum/
In images/folder2 folder. Define ROOT_DIR as ../../forum/

In global.php change any file locations to ROOT_DIR . "inc/timers.php" for example.
The two files are in the same folder, and one runs perfectly, and the other only returns empty variables. I know - odd!

the folder structure is set out as:
- forum - global
mysite.com -
- shop - php files calling global

There must be an easier way, I'm just missing it!

Absolute
You aren't using some in functions are you???
That is probably the problem come to think of it.
If so just put global $mybb_user or whatever it's called at the top of the function.
Pages: 1 2