Welcome to Our Community

Registration on our forums are now open for some days! Feel free to sign up today.

Personal User badge

Discussion in 'XenForo Tips & Guides' started by drunkenmonkey, Feb 11, 2016.

Thread Status:
Not open for further replies.
  1. Updated version of this resource is available here:
    [Template/Code Modification] - Personal User Badges

    This little modification will allow for personal user badges, not just defined by usergroup. Users will be allowed to choose their own badge, via the userCP, by using a link to any image hosting site, like Photobucket. Badges will be displayed in forum posts under the username and user title, and in personal conversations.

    You have the option to either set it to allow users to change their badge at any time, or set it so it can only be changed once.

    Either way, you will be able to change or remove the image at any time via the ACP by simply viewing the users 'preferences'.


    First things first, you're going to have to set up the custom user field. To do this, enter the ACP -> Users -> Custom User Fields -> Create New Field

    Then simply set it up like so:

    The description can be set to whatever you like. Resolutions can be changed later on.

    After that, click on the General Options tab. Make sure 'User editable' is checked. It's optional to allow constant changes or a one time change by checking 'Editable only once'.

    You can go ahead and save the field.

    Now to actually get the badge to show in thread posts.

    Go to Appearance -> Templates -> Find and open 'message_user_info'

    Now you'll need to find:

    <!-- slot: message_user_info_text -->
    Add this directly after on a new line:

    <xen:if is="{$user.customFields.user_badge}">
    <div align="center" style="padding-top: 5px;">
    <img src="{$user.customFields.user_badge}" alt="User Badge" width="140" height="20">
    These following portions are changeable. 'User Badge' is just an alternate for the image, you can change to whatever you like. Width and height will have to be defined as per your needs. The resolution shown is to match the large avatars I use. If you're using standard XenForo avatar sizes, you should use around 100 to 120 pixels for the width. Height is optional, I personally think 20 pixels is large enough.

    This is the end result:

    njoy! ^^

    EDIT: If, for any reason, you'd like to link that image to the users profile, you'll need to do this.


    <img src="{$user.customFields.user_badge}" alt="User Badge" width="140" height="20">
    Put this in front of it:

    <a href="{xen:link full:members, $user}">
    Put this after it:

    Viola! Links directly to the posters profile.

    EDIT #2: Just for kicks, I got to thinking how fun it might be to have the link be custom, instead of just pointing to your profile. Well, with some more custom profile field fun, I did just that.

    Set up another custom profile field, like so:

    Once you've done that, go back to the link you put in for the badge. If you haven't already, and want to now, just use this instead:

    <a href="{xen:link full:members, $user}">

    <a href="{$user.customFields.badge_link}">
    That will allow users to set their own links via the UCP. Again, you can choose whether you want this to be a permanent option or a one time deal.
    #1 drunkenmonkey, Feb 11, 2016
    Last edited by a moderator: Dec 25, 2016
  2. TreeOfWizdom


    Dec 24, 2016
    Likes Received:
    Hey, that picture doesn't exist. Mind updating the information?
  3. Caldexi

    Team Member Administrator Moderator +Lifetime VIP+ Contributor ViP True Member +Member+ Suppliers Registered

    May 22, 2015
    Likes Received:
Thread Status:
Not open for further replies.

Share This Page

  • About Us

    Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.
  • Like us on Facebook

  • Buy us a beer!

    The management works very hard to make sure the community is running the best software, best designs, and all the other bells and whistles. Care to buy us a beer? We'd really appreciate it!

    Donate to us!