$user =& JFactory::getUser(); $user_id = $user->get('id'); This returns the user id of the user. Therefore the code to do this is check whether the current user has a valid id (i.e. they are logged), if not load the module: <?php $user =& JFactory::getUser(); $user_id = $user->get('id'); if (!$user_id) { ?> <jdoc:include type="modules" name="left" /> <?php } ?>
Please state in the title and the post what this applies to , Not everyone will know this is a Joomla related code