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

XF 1.5 User banners that are only visible to certain usergroups?

Discussion in 'XenForo Questions and Support' started by Westingham, Dec 11, 2015.

  1. Westingham

    Westingham Member

    Would it be possible to create user banners that are only visible to certain usergroups? For example, if a user is given a usergroup as a form of punishment, moderators and admin would see a user banner on that user's profile but regular users would not be able to see it.
     
  2. wang

    wang Well-Known Member

    Yes, I think that would be possible. However it will require custom coding.
     
  3. Steve F

    Steve F Well-Known Member

    You can edit the message_user_info template and do this.

    Find
    Code:
    <!-- slot: message_user_info_text -->
    Add above
    Code:
    <xen:if is="{$visitor.is_moderator} || {$visitor.is_admin}">
                    <xen:if is="{xen:helper ismemberof, $user, 2}">
                        <em class="userBanner bannerClassClown wrapped">
                            <span class="before"></span>
                                <strong>Class Clown</strong>
                            <span class="after"></span>
                        </em>
                    </xen:if>
    </xen:if>
    
    Change the the number in red to match the group that you want to have the banner and change the name that is within the <strong> tag.

    And add this to EXTRA.css adjust the colors to what you want.
    Code:
    .bannerClassClown
    {
        background-color: red;
        color: white;
        border-color: red;
    }
     
    Westingham and wang like this.
  4. Westingham

    Westingham Member

    Thank you!
     

Share This Page