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

Name color, and rank plaques - Need help please

Discussion in 'XenForo Questions and Support' started by Malchus, May 12, 2011.

  1. Malchus

    Malchus Member

    I want to change the color of names in accordance to rank, i.e. the Administrator name appear read in the users online now, the xenstaff tab, and basically everywhere - red. Moderators blue... etc.

    Also I am using some CSS code to create name plaques under a user, how do I change the name plaques in accordance to the users rank as well as give the user multiple plaques. These are what the name plaques curently look like Picture 22.png

    And the moderators plaque is the same color except it says moderator. Thank you.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    To style the usernames you can set CSS for your usergroups:

    Admin CP -> Users -> List User Groups -> [click a group] -> User Name CSS

    Note that some areas don't use this CSS styling for usernames, but you can edit the templates to add it. For example:

    http://xenforo.com/community/threads/displaying-username-css-on-the-members-online-list.5360/

    There isn't a proper rank system in the current version, but you can use template edits for this too:

    http://xenforo.com/community/threads/user-ranks-in-css-no-images-required.7731/

    For displaying multiple ranks you will want to check secondary groups as well as primary. See this thread for a conditional to check a user's group memberships:

    http://xenforo.com/community/threads/usergroup-checking-in-the-templates.9447/

    You can use that condition in the message_user_info template to display a rank for multiple groups. If you add a condition for each group and a user belongs to multiple of those groups then multiple ranks will be displayed for that user. For example, in message_user_info you might have this:

    Code:
    <!-- Start User Ranks -->
    <xen:if is="{xen:helper ismemberof, $user, 4}">
    <span class="userrank">RANK 4</span>
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, 5}">
    <span class="userrank">RANK 5</span>
    </xen:if>
    
    <xen:if is="{xen:helper ismemberof, $user, 6}">
    <span class="userrank">RANK 6</span>
    </xen:if>
    <!-- End User Ranks -->
    
     
    Alassien and Malchus like this.

Share This Page