This is what I tried:
<?php chdir('forum');
include('global.php');
?>
This is the only thing that gave some results and I had to place it as the first line in the php file otherwise I would get some cookie error.
But the problem is that when I do an echo $vbulletin->userinfo['userid']; it comes out 0 even if I'm logged in and an echo for the username is Unregistered.
How can I make this work when the user is logged in ?
I used the JQuery function .post() to call a php script inside the forum folder that would gather the data I needed and returned it. This way I didn't even need to use php on my page. It's a great solution for those who need it.