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

Discussion in 'Resource and Add-on Requests' started by Craig, Jul 9, 2015.

  1. Craig

    Craig Active Member

    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:


    Thank you in advance!
  2. Amaury

    Amaury Well-Known Member

    No add-on needed.

    Open the sidebar_online_users template and find this:

            <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}'}
    Add this below, adjusting the color and phrasing accordingly to match your user groups' colors and names:

    <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.
    maszd and Craig like this.
  3. Craig

    Craig Active Member

    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).
  4. Craig

    Craig Active Member

    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?
  5. Amaury

    Amaury Well-Known Member

    The khflare_custom_phrase was an example. Change it to reflect your site initials and your actual phrase name.

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

    Craig Active Member

    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.

  7. Amaury

    Amaury Well-Known Member

    You need to create phrases for them if you're going to take the phrase approach.
  8. Craig

    Craig Active Member

    pardon my ignorance, but i haven't a clue what that means nor how to do it.
  9. Amaury

    Amaury Well-Known Member

    Admin CP > Appearance > Phrases > Create New Phrase
  10. Craig

    Craig Active Member

    Ok, I found the section, but not knowing how to write code I don't know what is required to make Phrases.
  11. Amaury

    Amaury Well-Known Member

    See my screenshot above in post #5 and then my first reply to this thread.
  12. Craig

    Craig Active Member

    Hold on! I think I got it......
  13. Craig

    Craig Active Member

    I got it!
    Thank you so much for your help and patience!


    Now to make each members user group show up instead of everyone showing up "tan"
    Amaury likes this.
  14. Amaury

    Amaury Well-Known Member

    Admin CP > Users > User Groups

    Put in your desired colors in the User Name CSS box.
  15. Craig

    Craig Active Member

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

    Amaury Well-Known Member

    You need to make the usernames rich in the sidebar_online_users template.


    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:

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

    Craig Active Member

    Thanks so much again! It worked like a charm!
    I greatly appreciate all your help!
    Amaury likes this.
  18. Tilkißey

    Tilkißey Well-Known Member

    maszd and Craig like this.
  19. Craig

    Craig Active Member

    Thanks much! I will certainly check it out!!

Share This Page