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

(David Taylor) #21

Finally had a chance to do some more work on this :slight_smile:

There is already a way to do this “properly” using the i18n features in Discourse - you shouldn’t need a CSS hack. Just go to the admin panel --> customise --> text content, then type whos_online and you should see the various language strings you can override. Also if you do it this way, you won’t lose the numeric counter!

These are great, I love the mouseover animations. This is now implemented in the plugin itself, and there’s a “collapse threshold”. So if the number of users goes over a certain value, they all slide on top of each other. The default is set to 10 users.

@meglio out of your long list, 2, 4 & 7 were implemented before you posted. 8 is controlled by Discourse (on mobile opens profile page, on desktop opens popup user card)

There is now a setting for maximum_display (default 50). Over this value new avatars are not displayed, but still contribute to the numeric counter.

3 and 5 I would like to get around to at some point :slight_smile:

The plugin now displays this if there are 0 users online.

If you want this, just set the “js.whos_online.no_users” language string to an empty string, it’ll disappear.

The threshold for displaying this string instead of the list is configurable (“minimum display”), so if you want you can hide it for < 5 users or similar.

You will probably need to be on the latest master version of discourse before you update, as I may have used some ember 2.10 features. I will update the top post to reflect the changes.

(gauthier) #23

Thanks a lot for your work!

Doesn’t work for me, I have to rebuild or something after change the string?

(Daniel Marquard) #24

Great work on this! I’ll be updating tomorrow.

(David Taylor) #25

For me I just reload the page and it works immediately. I suspect you’re hitting this bug, since your forum is not in English:

(gauthier) #26

Yes, exactly. It’s working fine for label in discourse core, but not for your plugin, or cakeday for example. Thanks.

Editing plugin translation strings in the admin panel when the forum language is not defined for the plugin has no effect
Translation of tagging selector does not change
(David Taylor) #27

If you’re able to create a language file for french then that would fix the problem for you, I’m afraid my french is very bad so I won’t attempt it. There are two translation files, one for the client, and one for the admin panel. Both can be found here

Just had a pull request for a spanish translation - thanks @DavidGNavas

(gauthier) #28

Yes, I will do it asap

(David Taylor) #29

I’ve now moved the count into the language string, so if you want something like this:

you can set js.whos_online.title to

{{count}} Users Online: 

(Daniela) #30

PR for italian translation submitted.

(Angel Raul Molina Muñoz) #31

Awesome plugin, I have a fork with a custom code for my forum but the base code it’s really cool. Suggestion: a custom page like Discourse Meta but with the online users, with a lot of users connected probably on the header could be too much.

(Angel Raul Molina Muñoz) #32

Another suggestion: an option to limit the “online users” feature only for registered users.

(Rafael dos Santos Silva) #33

Use this CSS:

html.anon div#whos-online {
  display: none;

(Angel Raul Molina Muñoz) #34

Oh! good one, I forgot the CSS workaround! thank you Rafael

(Anton) #35

This is a work-around, but it will not with the other settings, for example the number of online users to show.

So I suggest it should be another plugin setting.

(David Taylor) #36

It is a bit of a work-around, but all the other options should still work… everything will just be hidden until the user is logged in.

(Penar Musaraj) #37

I’m having trouble getting this plugin to work, either locally or on a production site. Using current Discourse (v1.8.0.beta1 +44), plugin is installed fine, admin settings are all there, but I see nothing on the frontend… and no errors either.

(David Taylor) #38

Interesting. I’m not seeing any issues with v1.8.0.beta1 +44 on my instance…

I see the discourse instance linked from your profile is very heavily customised - it might be that another plugin is conflicting in some way. What plugins do you have installed?

(Penar Musaraj) #39

I’m using these two plugins: Discourse Topic Previews and Discourse Sidebar Blocks (I am the author of the latter)… and sure enough, mine is the conflicting plugin.

I’ll track this down, thanks for you help.

Edit: Now fixed in this commit

(fearlessfrog) #40

Thanks for the plugin @david. We ran it on the site for a week and it worked well, feedback:

  • The ‘enabled on site’ switch I don’t think is hooked up. What’s the best way to deactivate temporarily, put 0 for all of active timeago, collapse threshold or max display?

  • We combined this with Babble, as we’d really like a way to see who was ‘in the room’ of the shoutbox like chat rather than as a general forum ‘whos online’. Have you considered some sort of display/style integration with @gdpelican with Babble?

  • We used a CSS style tweak not to show this for people not signed in on desktop or mobile styles, so a good candidate for a plugin setting.

Thanks again for your work on this.

(David Taylor) #41

Will try and get this fixed ASAP

This does indeed seem like a popular request, will try and add it at some point.

Unfortunately the way this plugin works could not really be adapted to only display users that are currently “in the room”. But of course, if someone wanted to take bits of the plugin and rewrite to integrate with babble, that would be great :slight_smile: