1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Hide member list from guests

Discussion in 'Template Modifications [Archive]' started by Brogan, Apr 30, 2011.

  1. Brogan

    Brogan XenForo Moderator Staff Member

    I've been asked this a few times now (via Conversation), so rather than reply individually each time, I've decided to post the template modification so others can make use of it if they wish.

    Open the member_list template.

    Look for this line near the top:
    Code:
    <xen:h1>{xen:phrase registered_members}</xen:h1>
    Directly after add this:
    Code:
    <xen:if is="{$visitor.user_id}">
    So it looks like this:
    Code:
    <xen:h1>{xen:phrase registered_members}</xen:h1>
    <xen:if is="{$visitor.user_id}">

    Then right at the bottom of the same template, look for:
    Code:
    </xen:sidebar>
    Directly after add this:
    Code:
    <xen:else />
    This content is visible to members only.
    </xen:if>
    So it looks like this:
    Code:
    </xen:sidebar>
    <xen:else />
    This content is visible to members only.
    </xen:if>

    You can obviously change the text to whatever you wish, or even insert a template or phrase there, etc.

    Make sure user registrations in the ACP are set correctly to hide profiles, etc. from guests.
    That way new members don't have to worry about doing it.

    Hope that helps.
     
    maszd, popowich, CyclingTribe and 9 others like this.
  2. netrix

    netrix Active Member

    Wouldn't it be better to use a phrase?

    Code:
    </xen:sidebar>
    <xen:else />
    {xen:phrase content_lock}
    </xen:if>
     
  3. ragtek

    ragtek Guest

    IMHO it would be much better to do this via the event system, because you don't need to edit ALL templates (in all styles) and change this on every update where you need to revert the template;)

    You would only need to add the member controller
    PHP:
        public function _preDispatch($action)
        {

    if (
    $action == 'Index'){
           
    $this->_assertRegistrationRequired();
    }    }
    my 0.02$ ;)
     
    Markos likes this.
  4. Brogan

    Brogan XenForo Moderator Staff Member

    ;)
     
  5. ragtek

    ragtek Guest

  6. Morgain

    Morgain Well-Known Member

  7. Brogan

    Brogan XenForo Moderator Staff Member

  8. Morgain

    Morgain Well-Known Member

    That's what I thought first but it doesn't work. It takes me to forum_list.
    OK added in the = I omitted (Blush) but now I get error can't find the site! but everything else is OK.

    Can you see any stupidity here please?

    <a href="http://www.house.morgain.co.uk/circle/misc/contact"><b>Contact us</b></a>
     
  9. Brogan

    Brogan XenForo Moderator Staff Member

    You still have a . between house and morgain.

    Your domain is housemorgain without a .
     
  10. Morgain

    Morgain Well-Known Member

    Oh mega blushes. Thank you Brogan.
     
  11. TonyHoang

    TonyHoang Member

  12. erich37

    erich37 Well-Known Member


    Hi Brogan,

    is it possible to display the "Log-in/Sign-up"-Form instead of the "phrase" ?

    Many thanks!
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Replace the This content is visible to members only. content after the <xen:else />.

    Try doing a template include for the register page.
     
  14. erich37

    erich37 Well-Known Member

    well, I mean including the template which is showing the "Error Message" including the "Log-in / Sign-up"-Form.


    anyone able to help on this, please?
     

Share This Page