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

XF 1.5 Adding who is online to footer (like vBulletin)

Discussion in 'Styling and Customization Questions' started by Hecter, Feb 10, 2016.

  1. Hecter

    Hecter Member

    Searched around a great deal for this and couldn't find what I needed but found a blog which works quite well with a few minor edits.


    Sharing as other folk have asked for this numerous times.

    My question is how do I add the colour coding to the members online at the bottom of the code you can see on the link, tried a couple of things unsuccessfully.
  2. Optic

    Optic Well-Known Member

    Hello @Hecter,

    Looks like the colour coding for the user groups is being defined in this part (near the bottom) of the footer_stats template it asks you to create:
                    <span style="font-weight: bold; color: red;">Administrator</span></a> |
                    <span style="font-weight: bold; color: green;">Moderator</span> |
                    <span style="color: black; font-weight: bold;">Members</span> |
                    <span style="color: violet; font-weight: bold;">Bots</span>
    On a side note, you might want to check out @Steve F 's Forum Statistics add-on:

    Although it's based off IPB, it has dedicated options and style properties which should make it easier to customise.
    Steve F likes this.
  3. Hecter

    Hecter Member

    The colour code in the blog isn't working, I edited it all to suit my own, all its doing is adding the usergroups colour codes to the very bottom but not to the actual online members.

    I also used that forum statistics add on but it doesn't work on my forum, I asked a question on the thread and no one responded so looked for an alternative.
  4. Optic

    Optic Well-Known Member

  5. Hecter

    Hecter Member

    I've already done that, the colour codes work in my members online now and all over my forums as I use rich text everywhere addon, its just from the above code it doesn't add it to any members in the online part.
  6. Optic

    Optic Well-Known Member

    OK, so it seems the rich text addon you're using doesn't recognise the usernames as it's a custom template, so the rich attribute needs to be manually added.

     <xen:if is="{$user.user_id}">
                            <a href="{xen:link members, $user}"
                                class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
                        <xen:else />
                            {xen:phrase guest}<xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
      <a href="{xen:link members, $user}"
                                class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
    <xen:username user="$user" rich="true" class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}" /><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>

    Credit to @Liam W for the template replacement from his All Rich Usernames add-on.
    Hecter likes this.
  7. Steve F

    Steve F Well-Known Member

    Sorry I missed your post but I have replied now.

Share This Page