XF 1.4 Hide report button on staff member cards?

Deceptive

Active member
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

0802689b3326495800594b6426b0ac58.png


Staff member card

13fe787134d9a9247fb57b1e5e0e7293.png


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:
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.webp
 
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?
 
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:
Back
Top Bottom