How to check if user is guest or member

Alex Paul
Alex Paul
Offline
2
I am developing a plugin and i want to check whether user is member or guest user. what is the best way to find that? i am new to joomla please advice
Responses (1)
  • Accepted Answer

    Friday, February 14 2014, 09:39 AM - #permalink
    0
    You can use this code

    $user = &JFactory::getUser();

    if($user->id!=0){
    echo "Member user";
    }
    else
    {
    echo "Guest user";
    }

    if id is not 0 then user is member user of site else guest user
    The reply is currently minimized Show
Your Reply