• 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)

Optic

Well-known member
#2
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.
 

Hecter

Active member
#3
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.
 

Optic

Well-known member
#6
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.