PHP Code:
<?php
$curdir = getcwd();
chdir('../path/to/forums');
require_once('./global.php');
chdir($curdir);
#sanatize all variables for easier use
$username = $vbulletin->userinfo['username'];
$userid = $vbulletin->userinfo['userid'];
if (!$userid)
{
echo "<script type='text/javascript'>alert('You must be logged in to the forum to view this page!');</script>";
header("Location: http://www.urltoforum.com");
} else {
echo "Welcome, $username";
REST OF PHP SCRIPT HERE IF LOGGED IN
}
?>
This is a guide. Most of the code is there. may be missing something simple but
its a place to start.