Online indicator based on user ID | XenForo Italia | Your guide to the xenForo world
Online indicator based on user ID

Online indicator based on user ID

wizardVerified member

Administrator

Staff member
Vip Member
Reputation: 61%

Bored with the same online indicator for everyone?


Compatibility with XenForo: 2.1, 2.2, 2.3

Me too, which is why I came up with this.

Online indicator based on user ID-1.webp


It's a selection of 10 different indicators which are automatically applied based on user ID.

Implementation is very simple.
It consists of one template edit and some CSS for each icon.
The CSS can be applied per style via the extra.less template.

The first step is to edit the message_macros template.

Look for this on line 10:

HTML:
You must log in to view
(1 lines)

Replace it with this:

RICH:
You must log in to view
(2 lines)

Feel free to change the name of the variable (ctaOnlineIconValue) and CSS class (ctaOnlineIcon--) as you wish.
Just make sure you use the same name in the extra.less template if you do.


Then all you have to do is add your custom CSS to the extra.less template.

You will need a unique entry (10 in total) for each value from 0 to 9 for the ctaOnlineIcon-- class, like so:

LESS:
You must log in to view
(36 lines)

And that's it!


As mentioned at the start, this can be applied per style just by changing the CSS in the extra.less template.
The message_macros template will only need to be edited if the other styles are not children of the edited style.
 
Back
Top