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

Add-on Members Online Now "Legend"

Craig

Active member
#1
Hello all!

I am curious if there is an add-on that will work with XF 1.4.8 and will allow a "legend" in the Members Online Now section that looks like the attached picture:

Snip20150709_4.png

Thank you in advance!
 

Amaury

Well-known member
#2
No add-on needed.

Open the sidebar_online_users template and find this:

Code:
        <div class="footnote">
            {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
        </div>
Add this below, adjusting the color and phrasing accordingly to match your user groups' colors and names:

Code:
<font color="#FF0000">{xen:phrase administrators}</font>, <font color="#0000FF">{xen:phrase moderators}</font>
KHF Color.PNG

If a phrase doesn't exist, I suggest creating one instead of hard-coding it so it can be easily changed later, using your site initials so you know it's custom. For example, khflare_custom phrase.
 

Craig

Active member
#3
No add-on needed.

Open the sidebar_online_users template and find this:

Code:
        <div class="footnote">
            {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
        </div>
Add this below, adjusting the color and phrasing accordingly to match your user groups' colors and names:

Code:
<font color="#FF0000">{xen:phrase administrators}</font>, <font color="#0000FF">{xen:phrase moderators}</font>
View attachment 110852

If a phrase doesn't exist, I suggest creating one instead of hard-coding it so it can be easily changed later, using your site initials so you know it's custom. For example, khflare_custom phrase.
Thank you so very much!
However, as I know nothing about coding, except to cut and paste, I don't under stand where or how to place your suggestion (khflare_custom).
 

Craig

Active member
#4
No add-on needed.

Open the sidebar_online_users template and find this:

Code:
        <div class="footnote">
            {xen:phrase online_now_x_members_y_guests_z_robots_a, 'total={xen:number $onlineUsers.total}', 'members={xen:number $onlineUsers.members}', 'guests={xen:number $onlineUsers.guests}', 'robots={xen:number $onlineUsers.robots}'}
        </div>
Add this below, adjusting the color and phrasing accordingly to match your user groups' colors and names:

Code:
<font color="#FF0000">{xen:phrase administrators}</font>, <font color="#0000FF">{xen:phrase moderators}</font>
View attachment 110852

If a phrase doesn't exist, I suggest creating one instead of hard-coding it so it can be easily changed later, using your site initials so you know it's custom. For example, khflare_custom phrase.
I am having an issue in that I get a syntax error when I use a multi word title, i.e. Global Moderator, VIP Elite. The only way it works is to place an underscore in between the words. is there a character i can use that won't show up?
 

Amaury

Well-known member
#5
I don't under stand where or how to place your suggestion (khflare_custom).
The khflare_custom_phrase was an example. Change it to reflect your site initials and your actual phrase name.

The only way it works is to place an underscore in between the words. is there a character i can use that won't show up?
Are you referring to when trying to create a phrase? If so, that is correct. The title requires underscores, but the actual text it displays comes from the Phrase Text field.

For example:

KHF Phrase 1.PNG

This is an example phrase will be the text you see.

Then you just call it within the template followed by the color coding as I posted above:

KHF Phrase 2.PNG
 

Craig

Active member
#6
Are you referring to when trying to create a phrase? If so, that is correct. The title requires underscores, but the actual text it displays comes from the Phrase Text field.
No, when I used the code you showed me some of the User Group Titles are two words, i.e., VIP Gold, Top Poster, etc.
In order for me to get them to show up I have had to use and under score between the words per the attached picture.
How can I do this so there is no need for some sort of character in between each word.

Snip20150709_1.png
 

Craig

Active member
#15
Admin CP > Users > User Groups

Put in your desired colors in the User Name CSS box.
I had already done that, and the color is shown in post bit, profiles, etc, but NOT in the Members Online Area. I thought at one time this was an add-on.....
 

Amaury

Well-known member
#16
You need to make the usernames rich in the sidebar_online_users template.

Search:

Code:
class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
Make this change:

Code:
class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}"><xen:username user="$user" rich="true" /></a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
 

Craig

Active member
#17
You need to make the usernames rich in the sidebar_online_users template.

Search:

Code:
class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}">{$user.username}</a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
Make this change:

Code:
class="username{xen:if '!{$user.visible}', ' invisible'}{xen:if {$user.followed}, ' followed'}"><xen:username user="$user" rich="true" /></a><xen:if is="{$i} < {$onlineUsers.limit}">,</xen:if>
Thanks so much again! It worked like a charm!
I greatly appreciate all your help!