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

hide avatar from guest and add follow me

Adam Howard

Well-known member
#1
This code worked before and I'm unsure what is keeping it from working now (after upgrading XenForo). I'm not use if it is the code or TMS is just being picky.

Assume for a moment it is the code, I'd love to know what is wrong with it.

The Goal:

Hide user avatars from guest and show a "follow me" button above the avatar for members.

message_user_info

originally
PHP:
    <xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
        <div class="avatarHolder">
            <span class="helper"></span>
            <xen:avatar user="$user" size="m" />
            <!-- slot: message_user_info_avatar -->
        </div>
    </xen:hook>
After
PHP:
 <xen:follow user="$user" class="Tooltip" style="background: url('styles/followme.png') no-repeat 8px center; padding:5px; text-align:center; display:block; font-weight:bold;" />
<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 is="{$visitor.user_id}">
<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
<div class="avatarHolder">
<span class="helper"></span>
<xen:avatar user="$user" size="m" />
<!-- slot: message_user_info_avatar -->
</div>
</xen:hook>
<xen:else />