PDA

View Full Version : how can I know if the current user is logged or no?


RedFoxy
12-16-2009, 02:21 AM
Hi all!
I want know in a my plugin if the current user is logged in the forum or no, how can I do?

Thanks ;)

Lynne
12-16-2009, 03:04 AM
If they are logged in, then they have a userid. So, you can try:
if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0) {
what to do if they aren't logged in
}or
if ($vbulletin->userinfo['userid'] > 0) {
what to do if they are logged in
}

RedFoxy
12-16-2009, 12:26 PM
thanks!