XF 1.5 Avatar border for usergroups

Flagy_

Active member
It passed quite a lot of time since we have upgraded to Xenforo 1.5.17 from 1.4, but since we did that, a code broke/is not working anymore and I tried everything to fix it, but the result was nothing. This is the old code that we were using when we had 1.4. The numbers 12/8/13/23 are the IDs from the usergroups.
Code:
.Av12 img { /* YOUTUBE */
    border: 3px groove DarkRed !important;
}
.Av12 span.img.s {
    border: 3px groove DarkRed !important;
}

.Av8 img { /* MANAGER */
    border: 3px groove Red !important;
}
.Av8 span.img.s {
    border: 3px groove Red !important;
}

.Av13 img { /* TWITCH */
    border: 3px groove Purple !important;
}
.Av13 span.img.s {
    border: 3px groove Purple !important;
}

.Av23 img { /* GREAT REPORTER */
    border: 3px groove #7c0348 !important;
}
.Av23 span.img.s {
    border: 3px groove #7c0348 !important;
}

After we have upgraded to 1.5.17, the code stopped working and after many tries, I found a solution by adding every user separately, like this:
Code:
.Av17302m img { /* SprayK_47_Lizard */
    border: 3px groove ForestGreen !important;
}
.Av17302s span.img {
    border: 3px groove ForestGreen !important;
}
.Av35756m img { /* ProGamerAP */
    border: 3px groove ForestGreen !important;
}
.Av35756s span.img {
    border: 3px groove ForestGreen !important;
}
.Av37656m img { /* Davidva */
    border: 3px groove ForestGreen !important;
}
.Av37656s span.img {
    border: 3px groove ForestGreen !important;
}
.Av45572m img { /* XXXITACHI */
    border: 3px groove ForestGreen !important;
}
.Av45572s span.img {
    border: 3px groove ForestGreen !important;
}
.Av37924m img { /* xKiito */
    border: 3px groove ForestGreen !important;
}
.Av37924s span.img {
    border: 3px groove ForestGreen !important;
}

The problem is that I have to keep an eye on what staff member is resigning/gets demoted because I have to remove their border. Before it worked very good and now I can't figure out what is wrong with the first code and why is not working anymore with usergroups. If anyone can help me, it would be really appreciated.
 
Probably because there are no more group specific borders, avatars etc. I guess. You would need to invest some time and proparly format the <xen:avatar> tag in any relevant template, for example in member_view add to the top:

HTML:
<xen:if is="{xen:helper ismemberof, $user, 12}">
    <xen:set var="$addClass">yt</xen:set>
(add all other conditions with an elseif)
</xen:if>

Add to every <xen:avatar> tag class="$addClass", so it looks like this:
<xen:avatar user="$visitor" size="s" img="true" class="$addClass" />

Then add to your css (extra.css or whatever)
CSS:
.yt {
    border: 3px groove DarkRed !important;
}
(and all other styles)

There might be a faster approach if you edit the core files and find out where the avatar tag is rendered.
 
Top Bottom