Discourse 在线用户

:discourse2: Summary Discourse Who’s Online displays a list of users currently active on the site
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-whos-online
:open_book: Install Guide How to install plugins in Discourse

Features

:information_source: Think carefully before installing this plugin. Discourse is designed for asynchronous discussion, and a list of online users can be harmful for some communities

:information_source: This plugin is built for communities with <100 concurrent logged-in users. Installing on larger sites is possible, but is likely to negatively affect the performance of the whole forum.

It can also optionally display a user’s online status on their avatar. Either with a “ring”, “glow”, or with a “flair” icon in the top left.
45 39 10

The plugin uses the MessageBus to keep up-to-date, so user status is reflected in real-time. Users which have enabled the “hide profile and presence” setting will not be displayed. You can customize a number of things using the available site settings and language strings:

Configuration

These are available in the “plugins” section of the admin settings panel.

  • whos_online_active_timeago: maximum “last seen” for which users are considered online (minutes)
  • whos_online_collapse_threshold: number of users before the avatars overlap each other (see gif above). Set very high to disable this feature
  • whos_online_maximum_display: the maximum number of avatars to display. The numeric counter will still count higher than this. The choice of who gets displayed is currently inconsistent
  • whos_online minimum_display: the minimum number of avatars to display. Below this, a “no users online” message is displayed
  • whos_online_hide_below_minimum_display: if enabled, the widget will be entirely hidden when the number of users is less than minimum_display
  • whos_online_display_public: should the plugin be displayed to people who aren’t logged in? Defaults to true.
  • whos_online_display_min_trust_level: the minimum trust level that this plugin is displayed to. Defaults to 0
  • whos_online_avatar_indicator: choose how to display online status on user avatars. Defaults to “ring”
  • whos_online_avatar_indicator_topic_lists: display avatar indicators in mobile topic lists, and the “Categories & Latest” view. Defaults to off.
  • whos_online_count_only: when enabled, only the count will be displayed. Online user identities will not be revealed

:speech_balloon: Frontend Language Strings

These are available in the admin panel under CustomizeText Content (search for whos_online). These include:

  • js.whos_online.no_users | “No users currently online”:The message displayed when the number of users < whos online minimum display setting.
  • js.whos_online.title | “Online ({{count}})”: The text displayed before the list of avatars. {{count}} is the number of users online.
  • js.whos_online.tooltip | “Users seen in the last 5 minutes”: the text displayed on mouseover of the text.

Last edited by @dax 2024-08-22T14:22:33Z

Check documentPerform check on document:
150 个赞

3 个帖子被拆分到一个新主题:Who’s Online 的更详细信息

请注意,此插件(至少在我们的论坛上)会显示以下消息。当我们关闭该插件时,消息就会消失。还有其他人遇到此问题吗?我们的服务器足以应对活跃用户数量。正在使用 Lightsail 8 GB RAM、2 vCPU、160 GB SSD Ubuntu


1 个赞

这个插件非常好用,特别是开启聊天功能后。不过,我想问一下是否可以添加一项功能,与个人用户设置集成,以隐藏自己的个人状态,这与其他聊天应用程序类似。

5 个赞

@bksubhuti 您是指这个吗?

1 个赞

我认为这个选项有点过了。在在线指示器方面,“隐身”是一项相当标准的功能,不应要求完全禁用您的个人资料。这也是我没有为非管理员用户启用此插件的原因之一。

3 个赞

我没看到那个属性,但快速谷歌了一下,发现它在界面里。
我可能会发个帖子建议 discourse 的开发者将隐藏个人资料的功能放到个人资料标题下。这似乎更合乎逻辑。界面更多地与布局和设置相关。

是的,它正如你所说的那样工作。

我真的很喜欢你的插件,也很感谢你的工作和快速响应。我们是一个拥有 100 多名用户的小型 discourse 社区,同时在线的用户很少超过 4 人,但能有这个功能和聊天功能很有趣。

1 个赞

2 篇帖子已拆分为新主题:允许用户隐藏在线状态

简单来说,只有将个人资料设置为私密的用户才不会显示在“在线用户”列表中,这是出于隐私设置的考虑。

1 个赞

3 篇帖子已合并到现有主题:Right now,I am in TL1. Can anyone tell me a boy trust level thing?

想知道是否可以将此作为主题组件来显示基本信息,而不是所有这些详细信息,\n例如,仅显示过去 5 或 10 分钟的访客人数。\n\n谢谢

设置 whos_online_active_timeagowhos_online_count_only

嘿,@david
感谢这个很棒的插件。
有一些建议:

  • 是否可以显示所有登录用户的数量,而不仅仅是活跃用户?现在,如果有人登录但没有发帖/回复,他们就不会被计算在内。
  • 是否可以添加访客(未登录用户)的数量?

感谢您的辛勤工作!希望您可以考虑这些增强功能,不确定是否可能/容易实现。

5 个赞

Can this be used on Discourse hosted by Discourse?

I tried adding it to components and get an error. I’m new to this but get it quick

此内容是否可以在由 Discourse 托管的 Discourse 上使用?

我尝试将其添加到组件中,但出现错误。我对此是新手,但很快就会明白。

这是一个插件,而不是 Discourse 主题/组件。您需要检查您注册的套餐是否包含此功能。

3 个赞

这是一个#插件,而不是#主题或#主题组件。
您可以使用哪些插件取决于您的托管计划

您需要企业托管才能使用此插件

4 个赞

有在线用户组件吗?这是一个非常老式和基本论坛的功能?似乎不应该被限制在更高级别的订阅中?

1 个赞

欢迎大家随时纠正我

我想到的最接近的#theme-component是这个:

2 个赞

是否有地方像插件一样列出所有组件? 谢谢!

所有 TC 都位于 Theme component 类别中,您可以通过标签(例如 official)进一步进行筛选。

1 个赞