• 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

Paul B

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.
 
Wouldn't it be better to use a phrase?

Code:
</xen:sidebar>
<xen:else />
{xen:phrase content_lock}
</xen:if>
 
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$ ;)
 
You still have a . between house and morgain.

Your domain is housemorgain without a .
 
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.


Hi Brogan,

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

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

Try doing a template include for the register page.
 
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?
 
Top Bottom