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

Discussion in 'Styling and Customization Questions' started by Demon, Apr 15, 2015.

  1. Demon

    Demon 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

    [​IMG]

    Staff member card

    [​IMG]

    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: Apr 15, 2015
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Use the is staff conditional statement.

    See point 11 in the guide in my signature.
     
  3. Demon

    Demon Active Member

    I thought I should use that conditional statement, but I wasn't sure where in the code I would put it.
     
  4. Dylan V

    Dylan V Well-Known Member

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

    Demon Active Member

    Thanks! Will staff members still be able to see the report button on profile pages?
     
  6. Dylan V

    Dylan V Well-Known Member

    Yes, if the user isn't a staff member, he will not see the "Report" button on the member cards of staff members only.
     
  7. Demon

    Demon Active Member

    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: Apr 16, 2015
  8. Dylan V

    Dylan V Well-Known Member

    Hmm, yeah, it's exactly that. Have you tested my code?
     
  9. Demon

    Demon Active Member

    I'll test in now. (Was very late when you replied to me)
     

Share This Page