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…
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.
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
I understand, it was great playing with this and I really like the end result
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!
The another thing is that I would also like to be able to display online users from last 30, 60 or X minutes. It’d be helpful for people to know who was today available on forum and problably will still for a little bit longer.