Detecting Logged In State in Joomla
<?php $userattr = JFactory::getUser(); $thisuser = $userattr ->get('guest'); if($thisuser == 0) { ?> // is this a guest user? //yes. do guest user stuff <?php } else { ?> //no. do logged-in user stuff <?php } ?>
<?php $userattr = JFactory::getUser(); $thisuser = $userattr ->get('guest'); if($thisuser == 0) { ?> // is this a guest user? //yes. do guest user stuff <?php } else { ?> //no. do logged-in user stuff <?php } ?>
Comments
Post a Comment