开发者

How can I get the userid on a vbulletin forum using global.php on a page outside of the forum?

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 ca开发者_如何转开发n 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜