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

XF 1.4 Hide report button on staff member cards?

#1
Okay, so I added a report button to members cards(which works well), but there is a problem. The report button shows up on staff members cards too.

So how would I hide the report button on staff member cards. but the staff still being able to see the report button on non-staff members cards?

Code with the report button
Code:
<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>
                <a class="OverlayTrigger" href="{xen:link members/report, $user}">Report</a>
            </xen:if>
        </xen:hook>
Report button line of code
Code:
<a class="OverlayTrigger" href="{xen:link members/report, $user}">{xen:phrase Report}</a>
Non-staff member card



Staff member card



So I want to remove the report option on staff member cards, but I still want staff to be able to see the report option on non-staff member cards.

Any ideas?


@Dylan V
 
Last edited:

Dylan V

Well-known member
#4
Hi,

Sorry for the delay. Replace your code with this:
Code:
        <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:if is="{$visitor.is_staff}">
            <a href="{xen:link members/report, $user}" class="OverlayTrigger report" data-cacheOverlay="false"><span></span>{xen:phrase report}</a>
            </xen:if>
        </xen:hook>
        </div>
To make the code work, you must check this box:

Screenshot_1.png
 
#5
Hi

Sorry for the delay. Replace your code with this:
Code:
        <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:if is="{$visitor.is_staff}">
            <a href="{xen:link members/report, $user}" class="OverlayTrigger report" data-cacheOverlay="false"><span></span>{xen:phrase report}</a>
            </xen:if>
        </xen:hook>
        </div>
To make the code work, you must check this box:

View attachment 103888
Thanks! Will staff members still be able to see the report button on profile pages?
 
#7
Yes, if the user isn't a staff member, he will not see the "Report" button on the member cards of staff members only.
Oh. Sorry I meant I wanted to hide the report button on staff member cards, but not on normal member cards.

My bad, sorry.

Edit:

I wanted to hide the report option on staff member cards only, since you can't report staff members. So it's pointless displaying the report option on staff member cards if they can't be reported.
 
Last edited: