1. I've started a massive SPAM purge, any accounts that have spammed are being removed, also for a short period new user signups are disallowed until the SPAM cleaning is finished.

How to hide a menu once a user logged in - Joomla

Discussion in '(X)HTML / CSS' started by balajia, Jul 15, 2010.

  1. balajia

    balajia New Member

    Joined:
    Jul 1, 2010
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    India
    $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
    }
    ?>
    Loading...
  2. Old Admin

    Old Admin Administrator

    Joined:
    Jan 7, 2008
    Messages:
    2,850
    Likes Received:
    228
    Trophy Points:
    63
    Gender:
    Male
    Please state in the title and the post what this applies to , Not everyone will know this is a Joomla related code
  3. balajia

    balajia New Member

    Joined:
    Jul 1, 2010
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    India
  4. Old Admin

    Old Admin Administrator

    Joined:
    Jan 7, 2008
    Messages:
    2,850
    Likes Received:
    228
    Trophy Points:
    63
    Gender:
    Male
    No you didnt :p , i changed it for you :)
  5. balajia

    balajia New Member

    Joined:
    Jul 1, 2010
    Messages:
    27
    Likes Received:
    1
    Trophy Points:
    0
    Location:
    India

Share This Page