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

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:
HTML:
<ul>
            <li>
                <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>
            </li>
        </ul>

On a side note, you might want to check out @Steve F 's Forum Statistics add-on:
https://xenforo.com/community/resources/forum-statistics-pixelexit-com.2577/

Although it's based off IPB, it has dedicated options and style properties which should make it easier to customise.
 
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:
HTML:
<ul>
            <li>
                <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>
            </li>
        </ul>

On a side note, you might want to check out @Steve F 's Forum Statistics add-on:
https://xenforo.com/community/resources/forum-statistics-pixelexit-com.2577/

Although it's based off IPB, it has dedicated options and style properties which should make it easier to customise.

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.
 
Ah yes, understood.

You'll also need to define colours for your user groups in the Admin CP.

See section User Title Styling on this page:
https://xenforo.com/help/user-group-styling/

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

Find:
Code:
 <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>
                    </xen:if>

Replace:
Code:
  <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>

With:
Code:
<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.
 
Back
Top Bottom