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

Discussion in 'Styling and Customization Questions' started by Brad P, Mar 30, 2016.

  1. Brad P

    Brad P Active Member

    Attached Files:

  2. Brogan

    Brogan XenForo Moderator Staff Member

  3. Brad P

    Brad P Active Member

    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
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    It works fine.
     
  5. Brad P

    Brad P Active Member

    Yeah, well it might for you mate but it sure is not for me
     
  6. Brad P

    Brad P Active Member

    Okay i did the tutorial you gave me again, this is what i have below.
    its still does not display?
     

    Attached Files:

  7. Martok

    Martok Well-Known Member

    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?
     
  8. Brad P

    Brad P Active Member

    In default it does indeed display, thats why i think something is conflicting
    Yeah the image is in a folder on the server
     
  9. Martok

    Martok Well-Known Member

    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).
     
  10. wang

    wang Well-Known Member

    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?
     
  11. RamzanHD

    RamzanHD Active Member

    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;
     
  12. Martok

    Martok Well-Known Member

    @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.
     
  13. Brad P

    Brad P Active Member

    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.
     
  14. Brad P

    Brad P Active Member

    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.
     

    Attached Files:

    Last edited: Mar 31, 2016
  15. Martok

    Martok Well-Known Member

    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?
     
  16. Brad P

    Brad P Active Member

    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.
     

Share This Page