XF 1.1 Hide members list from everyone

Adam Howard

Well-known member
So I did search and I know you can hide the members list from guest, but I want to hide it or turn it off for everyone.

From a spam point of view, I've had members join just so they could try to locate contact info through this list (and basically contact people off site to join another site). And from a resource point of view, it's just a waste.

So I'd like to be able to either turn it off or completely hide it.
 


Yes, I saw those. But I'd like to hide it from everyone.... ie... Guest, members, staff, ect.... I can easily look up someone's profile in a hurry or review their account in the AdminCP.

I'd much prefer the option to turn it off. Or at the very least hide it from everyone.
 
Make sure you vote here to have the Member's Tab improved.
http://xenforo.com/community/threads/suggestion-replace-members-page-with.2773/

When information flowed more openly ....

M_ike said:
Sept 2010: This has been mentioned elsewhere, but the members' list in it's current state will most likely be changed. This idea obviously relies on some things that don't exist, though the news feed could be used as alternative. Most likely, I'd probably put a "top members" type view in place of what we have, such as top trophy/like/posters. The A-Z list is really not of much use beyond a small community.
K_ier said:
Sept 2010: Mike and I have been talking for some time about doing away with the alphabetical members list. It seems completely pointless and redundant to todays online world.
K_ier said:
Oh, I wasn't talking about replacing the alphabetical member list with a non-alphabetical member list, I was talking about removing the member list completely.
 
So I did search and I know you can hide the members list from guest, but I want to hide it or turn it off for everyone.

From a spam point of view, I've had members join just so they could try to locate contact info through this list (and basically contact people off site to join another site). And from a resource point of view, it's just a waste.

So I'd like to be able to either turn it off or completely hide it.

You can try something like this, catches the members/ action and redirects everybody to index.


File: NoMembers/Extend.php
Content:
class NoMembers_Extend
{
public static function listener($class, &$extend)
{
if ($class == 'XenForo_ControllerPublic_Member')
{
$extend[] = 'NoMembers_Block';
}
}
}

File: NoMembers/Block.php
Content:
class NoMembers_Block extends XFCP_NoMembers_Block
{
protected function _preDispatch($action)
{
throw $this->responseException($this->responseRedirect(XenForo_ControllerResponse_Redirect::RESOURCE_CANONICAL, XenForo_Link::buildPublicLink('index')));
}
}

Create a new add-on, then:
In the Code Event Listener Editor, add an Event Listener for load_class_controller
Set the Execute Callback to the class NoMembers_Extend, for listener, with execution order of 1.

 
Use the same technique for hiding it from guests, but also add the registered member check to the conditional.

http://xenforo.com/community/threads/hide-member-list-from-guests.15407/

http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355

Hi Brogan,

in order to also hide the "Member Page" from search-engines, would it be required to edit any files as well ?
Like as was required for hiding other pages as mentioned here:
http://xenforo.com/community/threads/how-to-hide-the-whats-new-tab-from-visitors.26434/#post-318434

Thanks for advice!
 
Use the same technique for hiding it from guests, but also add the registered member check to the conditional.

http://xenforo.com/community/threads/hide-member-list-from-guests.15407/

http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355

Not 100% sure how to do that for all user ID's

PHP:
<xen:h1>{xen:phrase registered_members}</xen:h1>
<xen:if is="!{xen:helper ismemberof, $visitor, x, y}">

So this would be correct? Just replace X, Y, Z with user group number.
 
As I posted above originally, you need to use both conditions to cater for logged in members and guests: {$visitor.user_id} OR !{$visitor.user_id}
 
As I posted above originally, you need to use both conditions to cater for logged in members and guests: {$visitor.user_id} OR !{$visitor.user_id}

Maybe I'm doing it wrong or maybe I don't understand, but that didn't work.

But this one did work for me. :)

PHP:
 <xen:h1>{xen:phrase registered_members}</xen:h1>
<xen:if is="!{xen:helper ismemberof, $visitor, 1, 2, 3, 4, 5, 16}">

Now if I can just figure out how to hide the tab as well :D
 
Just edit the navigation template to remove the tab.

BTW, I tested the code I suggested above and this works fine:
<xen:if is="{$visitor.user_id} OR !{$visitor.user_id}">
Content to display to all visitors
<xen:else />
Content to hide
</xen:if>
 
Just edit the navigation template to remove the tab.

BTW, I tested the code I suggested above and this works fine:
<xen:if is="{$visitor.user_id} OR !{$visitor.user_id}">
Content to display to all visitors
<xen:else />
Content to hide
</xen:if>

Could be why it didn't work for me. I kept mine very simple.

PHP:
<xen:h1>{xen:phrase registered_members}</xen:h1>
<xen:if is="!{xen:helper ismemberof, $visitor, x, y}">

PHP:
<xen:else />
The Administrator has turned off this feature.
[</xen:if>

And within the navigation I was pleased to find that my wrap around code from vBulletin worked for XenForo, just replace vb with xen.

PHP:
<xen:comment> <!-- members -->
		<xen:if is="{$tabs.members}">
			<li class="navTab members {xen:if $tabs.members.selected, 'selected', 'Popup PopupControl PopupClosed'}">
			
				<a href="{$tabs.members.href}" class="navLink">{$tabs.members.title}</a>
				<a href="{$tabs.members.href}" class="SplitCtrl" rel="Menu"></a>
				
				<div class="{xen:if {$tabs.members.selected}, 'tabLinks', 'Menu JsOnly tabMenu'}">
					<div class="primaryContent menuHeader">
						<h3>{$tabs.members.title}</h3>
						<div class="muted">{xen:phrase quick_links}</div>
					</div>
					<ul class="secondaryContent blockLinksList">
					<xen:hook name="navigation_tabs_members">
						<li><a href="{xen:link members}">{xen:phrase registered_members}</a></li>
						<li><a href="{xen:link online}">{xen:phrase current_visitors}</a></li>
						<xen:if is="{$xenOptions.enableNewsFeed}"><li><a href="{xen:link recent-activity}">{xen:phrase recent_activity}</a></li></xen:if>
					</xen:hook>
					</ul>
				</div>
			</li>
		</xen:if>		</xen:comment>

I like to try to do it with the least amount of code added or removed. This works for me. :)
 
Top Bottom