Hiding Modules when a User Logs In

<?php // Get the user object $user = &JFactory::getUser(); 

// Now work out the User ID $userId = $user->get('id'); 

// Now hide the module if user is logged in if ($userId == 0) :   

// Now we break out of the PHP tags and display the JDOC tag to include the module 

?> 
<jdoc:include type="modules" name="public-right" style="xhtml" />

<?php endif; ?> 

Comments

Popular posts from this blog

HTML5 video loop src change on end play function

Set limit wp_nav_menu

Calculate percentage of a specific element has been scrolled into visible on the screen