• 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?

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

Steve F

Well-known member
#3
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.
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;
}