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

XF 1.5 usergroup banner

Brad P

Active member
#3
yeah i already tried that and it does not work, Russ thinks it could be the custom title effecting it. he gave me the link above to use
 

Martok

Well-known member
#7
I've just tested the exact code you have used and it works for me (I just grabbed an image and the settings aren't right for my forum which is why it looks odd and doesn't fit)

upload_2016-3-30_13-17-42.png

I assume it's just the image that is missing from your banners (ie the banners actually appear but with no background image)?

Is your admin.png file in the img directory in the root of your XenForo installation?

Does it display if you switch to a default unedited style?
 

Brad P

Active member
#8
I've just tested the exact code you have used and it works for me (I just grabbed an image and the settings aren't right for my forum which is why it looks odd and doesn't fit)

View attachment 131661

I assume it's just the image that is missing from your banners (ie the banners actually appear but with no background image)?

Is your admin.png file in the img directory in the root of your XenForo installation?

Does it display if you switch to a default unedited style?
In default it does indeed display, thats why i think something is conflicting
Yeah the image is in a folder on the server
 

Martok

Well-known member
#9
In default it does indeed display, thats why i think something is conflicting
Yeah the image is in a folder on the server
So is it just the image that's missing or the whole banner?

Just to check, have you put the CSS in the EXTRA.css template for each style you are using? (If it's been put in the one for the default style then it won't display correctly and the image will be missing in other styles unless you edit their EXTRA.css templates too).
 

wang

Well-known member
#10
Are you adding the code to the EXTRA.css template of the custom style that you are using as default? Is the image path also entered correctly?
 

Senpai

Formerly RamzanHD
#11
Okay i need some help, i have followed this tutorial https://xenforo.com/community/resources/user-ranks-in-css.430/

and i have it displaying like so http://imgur.com/7wiIHIA

know i want to know is how would i set it up so that i can have my own user banner image displaying for each of my usergroups?
create new usergroup then go to USER_GROUPS and create one there too and use this code. :)
Code:
    display: inline-block;
    height: 20px;
    text-indent: -10000em;
    width: 128px;
    background: url('YOUR IMAGE URL') no-repeat;
 

Brad P

Active member
#13
@Brad P so did you resolve this? If so, what was the issue? It'd be nice to give some feedback to those of us who took time to try and help you.
Relax mate, this morning I had to do some finished touches.
Unfortunately non of the above would work. It needed conditional in the message_user_info and message_user_info. CSS. To get it to display.

I'll display my result when I am home.
 

Brad P

Active member
#14
Okay,
So first off i want to thank the guys specially @Martok above for trying to resolve the problem i had, so i with the style i have and the way my layout is i had to add conditional within the messahe_user_info i will show what i did below in case anyone else needs this help



Open up message_user_info template
search for
Code:
<!-- slot: message_user_info_avatar -->
Just below that you will see </div>

You want to add this code below, so it should look like this
Code:
</div>
<!-- BEGIN OF CODE -->  
  
     <xen:if is="{$user.is_admin}">
     <div class=user_rank_box>
       <img class="user_rank_image admin_rank_image"/>
     </div>
     </xen:if>
     <xen:if is="{xen:helper ismemberof, $user, 6}">
     <div class=user_rank_box>
       <img class="user_rank_image supermod_rank_image"/>
     </div>
     </xen:if>
     <xen:if is="{xen:helper ismemberof, $user, 4}">
     <div class=user_rank_box>
       <img class="user_rank_image forum_mod_rank_image"/>
     </div>
     </xen:if>
     <xen:if is="{xen:helper ismemberof, $user, 8}">
     <div class=user_rank_box>
       <img class="user_rank_image premium_rank_image"/>
     </div>
     </xen:if>
     <xen:if is="{xen:helper ismemberof, $user, 18}">
     <div class=user_rank_box>
       <img class="user_rank_image banned_rank_image"/>
     </div>
     </xen:if>

<!-- END OF CODE -->
    </xen:hook>
so it needs to go in-between </div/ and the </xen:hook>

Take note $user,18"}/> is from the usergroup, number 18 is from my site you would grab yours off the usergroup URL.

now you want to save this and open up the next template

Message_user_info.css

add this code
Code:
.user_rank_image {
margin-left:0px;
}
.admin_rank_image {
   content:url("/img/admin.png");
}
.supermod_rank_image {
   content:url("/img/MOD Manager.png");
}
.banned_rank_image {
   content:url("/img/Banned.png");
}
.forum_mod_rank_image {
   content:url("/img/forum mod.png");
}
.premium_rank_image {
   content:url("/img/Premium.png");
}
Now remember that you will need your own images to upload to the server and all you do is add them to the content URL.

I have only done this on my site so please don't try this on a live site, i take no responsibility if it was to go wrong.
 

Attachments

Last edited:

Martok

Well-known member
#15
Thanks for the info.

I'm not sure why you've needed to add conditional code and css to those templates to get this to work (and this isn't actually using the user group banners in each user group). What other changes have you made that may have prevented the banners appearing in the other solutions that were given (which normally work as you saw on the default style)?

Did you check first that you were adding the code that I (and others) suggested to EXTRA.css for the style that you are using?
 

Brad P

Active member
#16
Did you check first that you were adding the code that I (and others) suggested to EXTRA.css for the style that you are using?
I did, it displayed on the default and another 3rd party style.

But for what ever reason I added it to this style and it wouldn't display at all.