• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Is it possible to disable Guests from....

ineedhelp

Well-known member
#1
....being able to click on usernames under Online Members and through out the site?

Also, can someone tell me how to make the Members tab in the nav, viewable but not accessible to Guests?

Thanks.
 

ineedhelp

Well-known member
#4
That's a permission:

Admin CP -> Users -> List User Groups -> [click the group] -> View user profiles

The member list requires a template edit:

http://xenforo.com/community/threads/if-condition-for-homepage-in-members-profile.20304/#post-259713
So what will this achieve?

Will it block Guests from viewing the Members list page?
Jake,
Guest still can click on the usernames and a user info card still pops up. They can't view profile page.
Can I disable this for Guests?
 

Brogan

XenForo moderator
Staff member
#8
Replace the member_card template with this:

Code:
<xen:edithint template="xenforo_overlay.css" />
<xen:require css="member_card.css" />
 
<div id="memberCard{$user.user_id}" data-overlayClass="memberCard">
<xen:if is="{$visitor.user_id}">
    <div class="avatarCropper">
        <a class="avatar NoOverlay Av{$user.user_id}l" href="{xen:link members, $user}">
            <img src="{xen:helper avatar, {$user}, l}" alt="" style="{xen:helper avatarCropCss, $user}" />
        </a>
        <xen:if hascontent="true">
            <div class="modControls" style="position:absolute; bottom:0px; right:0px">
                <xen:contentcheck>
                    <xen:if is="{$canEditUsers}"><a href="{xen:adminlink users/edit, $user}" target="_blank">{xen:phrase edit}</a></xen:if>
                    <xen:if is="{$canCleanSpam}"><a href="{xen:link spam-cleaner, $user}" class="OverlayTrigger">{xen:phrase spam}</a></xen:if>
                    <xen:if is="{$canWarn}"><a href="{xen:link members/warn, $user}">{xen:phrase warn}</a></xen:if>
                    <xen:if is="{$canBanUsers}"><a href="{xen:adminlink banning/users/add, $user}" target="_blank">{xen:phrase ban}</a></xen:if>
                </xen:contentcheck>
            </div>
        </xen:if>
    </div>
 
    <div class="userInfo">
        <h3 class="username"><xen:username user="$user" class="NoOverlay" /></h3>
   
        <div class="userTitleBlurb">
            <h4 class="userTitle">{xen:helper userTitle, $user}</h4>
            <div class="userBlurb">{xen:helper userBlurb, $user, 0}</div>
        </div>
   
        <blockquote class="status">{xen:helper bodytext, $user.status}</blockquote>
 
        <div class="userLinks">
        <xen:hook name="member_card_links">
            <a href="{xen:link members, $user}">{xen:phrase profile_page}</a>
            <xen:if is="{$visitor.user_id} AND {$user.user_id} != {$visitor.user_id}">
                <xen:if is="{$canStartConversation}"><a href="{xen:link conversations/add, '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></xen:if>
                <xen:follow user="$user" class="Tooltip" />
                <xen:if is="{xen:helper isIgnored, $user.user_id}"><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a><xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></xen:if>
            </xen:if>
        </xen:hook>
        </div>
   
        <dl class="userStats pairsInline">
        <xen:hook name="member_card_stats">
            <dt>{xen:phrase member_since}:</dt> <dd>{xen:date $user.register_date}</dd>
            <!-- slot: pre_messages -->
            <dt>{xen:phrase messages}:</dt> <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
            <!-- slot: pre_likes -->
            <dt>{xen:phrase likes_received}:</dt> <dd>{xen:number $user.like_count}</dd>
            <!-- slot: pre_trophies -->
            <dt>{xen:phrase trophy_points}:</dt> <dd><a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger">{xen:number $user.trophy_points}</a></dd>
            <xen:if is="{$canViewWarnings}">
                <dt>{xen:phrase warning_points}:</dt> <dd><a href="{xen:link members, $user}" class="concealed">{xen:number $user.warning_points}</a></dd>
            </xen:if>
        </xen:hook>
        </dl>
 
        <xen:if is="{$canViewOnlineStatus}">
            <dl class="pairsInline lastActivity">
                <dt>{xen:phrase x_was_last_seen, 'username={$user.username}'}:</dt>
                <dd>
                    <xen:if is="{$user.activity}">
                        <xen:if is="{$user.activity.description}">
                            {$user.activity.description}<xen:if is="{$user.activity.itemTitle}"> <em><a href="{$user.activity.itemUrl}" class="concealed">{$user.activity.itemTitle}</a></em></xen:if>,
                        <xen:else />
                            {xen:phrase viewing_unknown_page},
                        </xen:if>
                        <xen:datetime time="{$user.effective_last_activity}" class="muted" />
                    <xen:else />
                        <xen:datetime time="{$user.effective_last_activity}" />
                    </xen:if>
                </dd>
            </dl>
        </xen:if>
    </div>
 
    <a class="close OverlayCloser"></a>
<xen:else />
<div style="position: absolute; top: 40px; left: 40px">Please sign in to view member cards</div>
</xen:if>
</div>

Adjust the styling and text to suit - it's the 3rd line from the bottom.
Code:
<div style="position: absolute; top: 40px; left: 40px">Please sign in to view member cards</div>
 

ineedhelp

Well-known member
#10
When a Guest clicks the Members tab in the nav, can it take them to the login or signup page? Like it would do for a private node ? Then once they login - it displays the page?

This would keep the overall behaviour/function of the site like other areas of the site.
 

ineedhelp

Well-known member
#13
Replace the member_card template with this:

Code:
<xen:edithint template="xenforo_overlay.css" />
<xen:require css="member_card.css" />
 
<div id="memberCard{$user.user_id}" data-overlayClass="memberCard">
<xen:if is="{$visitor.user_id}">
    <div class="avatarCropper">
        <a class="avatar NoOverlay Av{$user.user_id}l" href="{xen:link members, $user}">
            <img src="{xen:helper avatar, {$user}, l}" alt="" style="{xen:helper avatarCropCss, $user}" />
        </a>
        <xen:if hascontent="true">
            <div class="modControls" style="position:absolute; bottom:0px; right:0px">
                <xen:contentcheck>
                    <xen:if is="{$canEditUsers}"><a href="{xen:adminlink users/edit, $user}" target="_blank">{xen:phrase edit}</a></xen:if>
                    <xen:if is="{$canCleanSpam}"><a href="{xen:link spam-cleaner, $user}" class="OverlayTrigger">{xen:phrase spam}</a></xen:if>
                    <xen:if is="{$canWarn}"><a href="{xen:link members/warn, $user}">{xen:phrase warn}</a></xen:if>
                    <xen:if is="{$canBanUsers}"><a href="{xen:adminlink banning/users/add, $user}" target="_blank">{xen:phrase ban}</a></xen:if>
                </xen:contentcheck>
            </div>
        </xen:if>
    </div>
 
    <div class="userInfo">
        <h3 class="username"><xen:username user="$user" class="NoOverlay" /></h3>
 
        <div class="userTitleBlurb">
            <h4 class="userTitle">{xen:helper userTitle, $user}</h4>
            <div class="userBlurb">{xen:helper userBlurb, $user, 0}</div>
        </div>
 
        <blockquote class="status">{xen:helper bodytext, $user.status}</blockquote>
 
        <div class="userLinks">
        <xen:hook name="member_card_links">
            <a href="{xen:link members, $user}">{xen:phrase profile_page}</a>
            <xen:if is="{$visitor.user_id} AND {$user.user_id} != {$visitor.user_id}">
                <xen:if is="{$canStartConversation}"><a href="{xen:link conversations/add, '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></xen:if>
                <xen:follow user="$user" class="Tooltip" />
                <xen:if is="{xen:helper isIgnored, $user.user_id}"><a href="{xen:link members/unignore, $user}" class="FollowLink">{xen:phrase unignore}</a><xen:elseif is="{$canIgnore}" /><a href="{xen:link members/ignore, $user}" class="FollowLink">{xen:phrase ignore}</a></xen:if>
            </xen:if>
        </xen:hook>
        </div>
 
        <dl class="userStats pairsInline">
        <xen:hook name="member_card_stats">
            <dt>{xen:phrase member_since}:</dt> <dd>{xen:date $user.register_date}</dd>
            <!-- slot: pre_messages -->
            <dt>{xen:phrase messages}:</dt> <dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed">{xen:number $user.message_count}</a></dd>
            <!-- slot: pre_likes -->
            <dt>{xen:phrase likes_received}:</dt> <dd>{xen:number $user.like_count}</dd>
            <!-- slot: pre_trophies -->
            <dt>{xen:phrase trophy_points}:</dt> <dd><a href="{xen:link members/trophies, $user}" class="concealed OverlayTrigger">{xen:number $user.trophy_points}</a></dd>
            <xen:if is="{$canViewWarnings}">
                <dt>{xen:phrase warning_points}:</dt> <dd><a href="{xen:link members, $user}" class="concealed">{xen:number $user.warning_points}</a></dd>
            </xen:if>
        </xen:hook>
        </dl>
 
        <xen:if is="{$canViewOnlineStatus}">
            <dl class="pairsInline lastActivity">
                <dt>{xen:phrase x_was_last_seen, 'username={$user.username}'}:</dt>
                <dd>
                    <xen:if is="{$user.activity}">
                        <xen:if is="{$user.activity.description}">
                            {$user.activity.description}<xen:if is="{$user.activity.itemTitle}"> <em><a href="{$user.activity.itemUrl}" class="concealed">{$user.activity.itemTitle}</a></em></xen:if>,
                        <xen:else />
                            {xen:phrase viewing_unknown_page},
                        </xen:if>
                        <xen:datetime time="{$user.effective_last_activity}" class="muted" />
                    <xen:else />
                        <xen:datetime time="{$user.effective_last_activity}" />
                    </xen:if>
                </dd>
            </dl>
        </xen:if>
    </div>
 
    <a class="close OverlayCloser"></a>
<xen:else />
<div style="position: absolute; top: 40px; left: 40px">Please sign in to view member cards</div>
</xen:if>
</div>

Adjust the styling and text to suit - it's the 3rd line from the bottom.
Code:
<div style="position: absolute; top: 40px; left: 40px">Please sign in to view member cards</div>
I just noticed, this code Removes "Spam" from the member card when I am logged-in/super admin

I reverted back to the original code, and the spam function came back.

Please can you check the code - thanks.
 

Brogan

XenForo moderator
Staff member
#16
It works fine, I always test before posting template edits.

All the conditional does is make the content of the template unavailable to guests.
 

Brogan

XenForo moderator
Staff member
#18
Which version are you running? That template code is from 1.1.0 Beta 5, and I don't know what the changes are for previous versions.