10-16-2010, 08:05 PM
Ok guys and gals.
I have a VB forum as some of you are aware.
Now i want to be able to put custom scripts in my forum but still call up the global.php file to make sure the user is logged in in order to see the contents.
Thats simple enough to do.
I just use the below code.
Now that works fine from the root.
But if i try this in a directory i get errors.
Obviously i have to point to ../global.php?
Well when i try that i get further errors?
It detects the global just fine but it trips up with a bootstrap hook in the global.php file. I assume because it does not know where it is?
Im sure its a simple answer but its got me buggered.
I tried to define the root path alsoand no luck still!
Any help would be appreciated thanks all.
I have a VB forum as some of you are aware.
Now i want to be able to put custom scripts in my forum but still call up the global.php file to make sure the user is logged in in order to see the contents.
Thats simple enough to do.
I just use the below code.
PHP Code:
<?php
require_once('./global.php');
if ($vbulletin->userinfo['userid']!=0) {
echo "Welcome Back, <b>";
echo $vbulletin->userinfo['username'];
} else {
echo "Sorry No Joy, <b>";
}
?>
Now that works fine from the root.
But if i try this in a directory i get errors.
Obviously i have to point to ../global.php?
Well when i try that i get further errors?
It detects the global just fine but it trips up with a bootstrap hook in the global.php file. I assume because it does not know where it is?
Im sure its a simple answer but its got me buggered.
I tried to define the root path also
Code:
define( ROOT_PATH , "./" );
Any help would be appreciated thanks all.