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

Adding more than one user rank?

Discussion in 'Styling and Customization Questions' started by BioRage, Mar 4, 2012.

  1. BioRage

    BioRage Member

    Hello,

    I'm looking to add more than one user rank on my current forum[Under each existing rank]:

    Untitled.png
    Like that, but have more than one++ of that below;

    I know that you can add it via user-group, but it's tedious to make that man ranks for certain users;

    For example if user is a

    Moderator + Donator + Coder; I would like it to show like that.

    Anyone know about the ways of doing this?

    I want it like this (image below)

    aaa.png
    but without adding it to each user group, instead I can easily add it perhaps by just clicking these for example;

    Untitled.png

    Anyone have any ideas on how about to do this?

    Thank you!
     
  2. Russ

    Russ Well-Known Member

  3. BioRage

    BioRage Member

  4. Ingenious

    Ingenious Well-Known Member

    I would edit the postbit/avatar template and use conditionals, in other words, is the member in group X if so display a particular graphic. Then the graphics can be cumulative (stacked). You'd still need to add them to secondary usergroups, but those groups could just have no effect other than showing these ranks.
     
  5. BioRage

    BioRage Member

    Could you perhaps aid me? As I am very unfamiliar with coding :notworthy:
     
  6. Ingenious

    Ingenious Well-Known Member

    Have a look at this: http://xenforo.com/community/threads/usergroup-checking-in-the-templates.9447/

    Change the usergroup to match the ID of the group you want to check and display a rank for. Then just do these one after the other, example for groups 4 and 5:

    Code:
    <xen:if is="{xen:helper ismemberof, $visitor, 4}">
        <img src="group4rank.jpg"></br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $visitor, 5}">
        <img src="group5rank.jpg"></br>
    </xen:if>
    I'm afraid I don't know what template you need to edit, the template where the avatar is shown, maybe someone else can help with that bit.
     
  7. Ingenious

    Ingenious Well-Known Member

    Right it's message_user_info you need to edit. I'll just have a quick go in my forum and see what bit to edit and where.
     
  8. Ingenious

    Ingenious Well-Known Member

    OK, you need to use this code:

    Code:
    <xen:if is="{xen:helper ismemberof, $user, 6}">
        something to display</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 7}">
        something else to display</br>
    </xen:if>
    You need to use $user not $visitor as I said before. Change 6 and 7 to whatever groups you want to check for. To make sure this works before adding images, just stick a full stop in to display, such as:

    <xen:if is="{xen:helper ismemberof, $user, 6}">
    .</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 7}">
    ..</br>
    </xen:if>

    Go into template message_user_info and at the very the bottom find:

    Code:
    </xen:hook>
                </xen:if>
                </xen:contentcheck>
            </div>
        </xen:if>
     
    STICK THE CODE HERE
         
    </xen:if>
     
        <span class="arrow"><span></span></span>
    </div>
    </div>
    Cut and paste the code where I have typed STICK THE CODE HERE :)

    Add extra checks for other groups just by adding more checks, such as:

    Code:
    <xen:if is="{xen:helper ismemberof, $user, 6}">
        something to display</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 7}">
        something else to display</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 8}">
        something else to display</br>
    </xen:if>
    
    Once you know it works just replace the . with something you want to show, like an html <img> tag. Just remember </br> after each one to insert a line break, then they will stack, rather than being all in a line.
     
  9. BioRage

    BioRage Member

    Thanks, let me know, I will try it out now !

    EDIT: let me try it out :)
     
  10. BioRage

    BioRage Member

    WOW! Thanks I really appreciate this;

    However, could you aid me before you go? Just seems it get's placed below the medal addon I have, and not exactly near where I'd like it to be :)

    Untitled.png
     
  11. Ingenious

    Ingenious Well-Known Member

    Where do you want it to display?
     
  12. BioRage

    BioRage Member

    It's not centered either,

    I just want it placed where the defaults are placed, so to respective, under adminstor, website coder, for example;

    Above the medals, to coordinate with the others
     
  13. Ingenious

    Ingenious Well-Known Member

    That's the limit of my expertise I'm afraid - the code is correct but you will need to add a div to center it (or a CSS class) and move it further up the template so it displays before the medal. But as I don't use the medal plugin I can't test this in my own forum. Hopefully someone else will take it from here... :)
     
  14. BioRage

    BioRage Member

    Haha, no problem... You helped me a lot, I actually like how they are now..

    I just added

    Code:
    <center>
    <xen:if is="{xen:helper ismemberof, $user, 6}">
        something to display</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 7}">
        something else to display</br>
    </xen:if>
    <xen:if is="{xen:helper ismemberof, $user, 8}">
        something else to display</br>
    </xen:if>
    </center>
    
    Thanks again!!
     

Share This Page