I have a VB forum.
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
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
define( ROOT_PATH , "./" );
No luck there either.
Now as can clearly be seen from above i really dont know much about PHP. A little but certainly not alot. And even less when it comes to VB unfortunately.
Thanks if someone can help.
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
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
define( ROOT_PATH , "./" );
No luck there either.
Now as can clearly be seen from above i really dont know much about PHP. A little but certainly not alot. And even less when it comes to VB unfortunately.
Thanks if someone can help.