1. 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....

Discussion in 'XenForo Questions and Support' started by ineedhelp, Nov 12, 2011.

  1. ineedhelp

    ineedhelp Well-Known Member

    ....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.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    ineedhelp likes this.
  3. Andy.N

    Andy.N Well-Known Member

    Jake,
    Guest still can click on the usernames and a user info card still pops up. They can't view profile page.
     
  4. ineedhelp

    ineedhelp Well-Known Member

    So what will this achieve?

    Will it block Guests from viewing the Members list page?
    Can I disable this for Guests?
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

  6. ineedhelp

    ineedhelp Well-Known Member

  7. ineedhelp

    ineedhelp Well-Known Member

  8. Brogan

    Brogan XenForo Moderator Staff Member

    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 likes this.
  9. ineedhelp

    ineedhelp Well-Known Member

    EXCELLENT - MANY THANKS!!!!
     
  10. ineedhelp

    ineedhelp Well-Known Member

    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.
     
  11. Brogan

    Brogan XenForo Moderator Staff Member

    Change the action in the xen:else to redirect to the login page.
     
  12. ineedhelp

    ineedhelp Well-Known Member

    Code:
    <xen:if is="{$visitor.user_id}">
    This content will show to logged in members
    </xen:if>
    
    Will that do it?
     
  13. ineedhelp

    ineedhelp Well-Known Member

    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.
     
  14. Brogan

    Brogan XenForo Moderator Staff Member

    No it doesn't, check your spam settings.
     
  15. ineedhelp

    ineedhelp Well-Known Member

    I've checked the Spam management - everything is fine.

    I've replaced the code again - Spam function has vanished - only useable via profile page Not via member card.
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    It works fine, I always test before posting template edits.

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

    ineedhelp Well-Known Member

    Can you login as Admin on my site and see, All i've done is copy and pasted the code... :confused:
     
  18. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  19. ineedhelp

    ineedhelp Well-Known Member

    1.0.4

    What can we do?

    I haven't upgraded yet, as beta may contain errors, so waiting for the final release..
     
  20. Brogan

    Brogan XenForo Moderator Staff Member

    Revert the template then as the code is not for that build.

    If I get time later I'll see if I can take a look at a 1.0.4 build.
     
    ineedhelp likes this.

Share This Page