I'm trying to have a conditional link to my forums on the site index so logged in members have a direct link but guests get there via my rules page. I initially have it working but I've noticed if the forums aren't viewable by certain usergroups they are given a forced "You are not logged in" vBulletin login box which overrides the site code. Here's the code I'm using;
PHP Code:
<?php
chdir("./forums");
require_once('./global.php');
?>
and
PHP Code:
<?php
if ($vbulletin->userinfo['userid'])
{
echo "<a href=http://www.mysite.com/forums/><font size=1> <b>Forums</b></font></a>";
}
else
{
echo "<a href=http://www.mysite.com/rules.php><font size=1> <b>Forums</b></font></a>";
}
?>
The main problem with this box at the moment is if they try to login they are taken to mysite.com/login.php (which doesn't exist) instead of mysite.com/forums/login.php.
It's actually the call to global.php that is doing this. What I need is some way to move all the URLs on that page forward to the forums directory. eg: login.php and the header/gradient URLs used for the form images.
Any suggestions?