Who's Online Plugin (discourse-whos-online)


(AstonJ) #164

Nice work David! I finally got around to giving it a go.

Do we need for some sort of caching to come into play? I increased the online time but it didn’t make any difference.

Also, would it be possible to edit the online () message? I’d like to experiment with change the time to one day and that text to Online today (): (would that cause any performance issues btw?). Other forum platforms I have used have often had a ‘Who’s been on line today’ block and they have always gone down well with users…


(David Taylor) #165

There is no caching, but it won’t act retrospectively. You need to wait for users to be active after you change the setting before they start appearing on the list.

Sure, go to /admin/customize/site_texts and search for whos_online - you can change any of the text there.

The length of time won’t cause performance issues. If you have a very large number of users it might cause issues, but I have seen it working for forums with many hundreds of users ‘online’ at the same time.


(AstonJ) #166

Ah that’s awesome - thanks David!


(AstonJ) #167

Hi David! I love this plugin! :heart:

We’re using it in a slightly different way though - to show who’s been online in the last 24 hours :smiley:

I personally feel that seeing who’s online ‘today’ is more interesting for the community on a forum - than seeing who’s online right now (which is more beneficial for chat rooms imo).

Using it like this though has led to some feedback and I was wondering if you had any thoughts on this or whether you could incorporate the feedback into the next build please?

First some images to show how we’re using it:

  • As you can see the location has been placed on the right hand side using text-align and a negative margin to ensure in the preview state, the avatars overlap each other (so effectively show as a single avatar). However this results in some odd behaviour because when you hover over the avatar (especially if it’s near the right hand side) the full list begins to expand but then starts to contract again once they begin expanding. If the cursor is in just the right spot it endlessly begins to expand then contracts again, haha! Not sure if you can suggest a way to fix this or offer a ‘Show on right hand side’ option where this doesn’t occur?

  • The other concern raised, is, understandably, the impact on page load/number of requests it adds to the page. So would it be possible to only load the initial number of avatars first (perhaps with a ‘max number of avatars on preview’ setting) and then only load the others when someone specifically requests that info - i.e on hover or click. This way it does not add any unnecessary load or delay for those who are not interested in that feature.

  • The last bit of feedback was that some users might not want to feature on that list. So would it be possible to add a user option that allows them to not show in the list? I realise that people can see when someone was last online by going to their profile anyway, but if it’s possible to add this option to keep those who do not want to feature on it happy, I think it would be worth it. In their place the system could simply append “+15 more” etc. Also slightly related to this, maybe there could be an additional ‘off’ switch in the user settings so that if it’s a feature they do not like then it does not show on the forum homepage at all.

What do you think? I love this plugin and I reckon it should be part of core :+1:t3:


(David Taylor) #168

This is very interesting, but not really how the plugin was intended to be used :wink:

I had a play with the CSS on your site to try and improve the experience. I came up with this which makes things a bit less crazy: (add this to a theme component on your site)

div#whos-online:hover {
    max-height: 1000px;
}

div#whos-online {
    padding-bottom: 0px;
    transition:  1s linear;
    transition-delay:  0.2s;
    overflow:  hidden;
    max-height:  25px;
}

#whos-online a {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

That gives something like this:

I understand the concern, but I’m afraid this isn’t something I’ll be adding - I never intended the plugin to show 400+ users on the page! If someone else wants to submit a PR, that would be welcome.

There is some discussion about this above. Again, a pull request would be welcome, but it’s unlikely that I would build it.


(AstonJ) #169

Thanks David, that CSS change is fantastic :+1:

I understand, it was great playing with this and I really like the end result :smiley:

Unfortunately I cannot ignore the biggest concern of the impact on page speed/load. This is understandable given many of our members do not have fibre or fast broadband and are often checking in on the forum while commuting, at the office (on their mobile) or while at conferences.

If I ever get around to learning Ember I will definitely have a look at seeing if I can submit a PR.

Thanks once again for all your help and a brilliant plugin!


(Dan) #170

This is great for small/new forums.


(AstonJ) #171

It’s great for all forums - just on the largest of forums you’d have a cut off and say “+ XXXX more” with the avatars that do show showing the most recent users.


(Jeff Van Dellen) #172

Is there a way to display the usernames and not the avatars? or at the very least both?


(Jeff Wong) #173

I would suspect usernames are going to be very difficult to display in a good way to be at-a-glance. What is your use case that is not covered by display on hover here?


(Jeff Van Dellen) #174

Use case is simply just for a more basic simple user experience.


(📹Scammer Revolts💻) #175

Awesome plugin! I only noticed one bug. When I go to the users summary page it shows the online flare behind the icon instead of over the icon.

UserOnline