# 如何在名字旁边显示用户总帖数

**URL:** <https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718>\
**Category:** Development\
**Created:** [2023年十二月6日 13:15 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718 "2023-12-06T13:15:25Z")\
**Posts on this page:** 11\
**Page:** 2

<div class="post-metadata">

**Author:** ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)\
**Post date:** [2025年二月16日 13:26 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/21 "2025-02-16T13:26:38Z")

</div>

不错。非常感谢你在这里的出色工作。我还应用了

```plaintext
.user-post-count {
    margin-top: .1rem;
}

```

以使其与用户名对齐。不确定这是不是最好的方法，但它有效

---

<div class="post-metadata">

**Author:** ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)\
**Post date:** [2025年二月16日 16:09 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/22 "2025-02-16T16:09:13Z")

</div>

我们使用由 @michaeld 多年前为我们编写的 [https://github.com/communiteq/discourse-custom-post-display。它显示加入日期、帖子数量和点赞数量。](https://github.com/communiteq/discourse-custom-post-display%E3%80%82%E5%AE%83%E6%98%BE%E7%A4%BA%E5%8A%A0%E5%85%A5%E6%97%A5%E6%9C%9F%E3%80%81%E5%B8%96%E5%AD%90%E6%95%B0%E9%87%8F%E5%92%8C%E7%82%B9%E8%B5%9E%E6%95%B0%E9%87%8F%E3%80%82)

 ![image](https://global.discourse-cdn.com/meta/original/4X/6/0/6/606631b2b0d4d5566e9746a0c8d1d4d3e577dea8.png)

---

<div class="post-metadata">

**Author:** ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)\
**Post date:** [2025年二月16日 16:24 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/23 "2025-02-16T16:24:48Z")

</div>

看起来也不错。在手机上看起来怎么样？您需要点击“i\*”来显示这些信息吗？

---

<div class="post-metadata">

**Author:** ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)\
**Post date:** [2025年二月16日 16:56 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/24 "2025-02-16T16:56:56Z")

</div>

在移动设备上运行效果很好——它只是省略了“Joined”一词。无需点击任何内容。“i”是单独的东西。

---

<div class="post-metadata">

**Author:** ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)\
**Post date:** [2025年二月18日 11:47 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/25 "2025-02-18T11:47:05Z")

</div>

太棒了。喜欢。如果能加上总主题和总帖子数，再加上一个 FA6 的更新就更好了。不过看起来很容易做到。

---

<div class="post-metadata">

**Author:** ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)\
**Post date:** [2025年二月18日 12:38 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/26 "2025-02-18T12:38:39Z")

</div>

我认为您应该要求 Communiteq 将其升级以使用 FA6 图标。对我来说，它看起来像是使用了 5，这在不久的将来会中断。

---

<div class="post-metadata">

**Author:** ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)\
**Post date:** [2025年二月18日 19:43 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/27 "2025-02-18T19:43:55Z")

</div>

明白了，我实际上是在运行我 fork 的项目，并且我做了一些调整和 FA6 升级。我忘了我做过这些了。[GitHub - markschmucker/discourse-custom-post-display](https://github.com/markschmucker/discourse-custom-post-display)

---

<div class="post-metadata">

**Author:** ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)\
**Post date:** [2025年二月19日 13:42 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/28 "2025-02-19T13:42:25Z")

</div>

不错。我已经更新了它以进行序列化并使用 “user\_topic\_count”。我以 @Arkshine 的代码为基础

---

<div class="post-metadata">

**Author:** ![manton](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/manton/32/389960_2.png) [@manton](https://meta.discourse.org/u/manton)\
**Post date:** [2025年三月29日 00:23 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/30 "2025-03-29T00:23:54Z")

</div>

您好，感谢您制作此插件。我刚刚安装了它，但它显示的帖子计数不准确。或者至少，“帖子创建”在 admin/users 部分显示的是一个更高的数字。

另外，我发现它截断了用户显示的徽章：

![image](https://global.discourse-cdn.com/meta/original/4X/7/f/1/7f1346ff1cd99f259db8158fb4abced64af4ad87.png)

---

<div class="post-metadata">

**Author:** ![markschmucker](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/markschmucker/32/141599_2.png) [@markschmucker](https://meta.discourse.org/u/markschmucker)\
**Post date:** [2025年三月30日 12:39 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/31 "2025-03-30T12:39:53Z")

</div>

我不确定是否会计算私信，这可能存在差异。

---

<div class="post-metadata">

**Author:** ![David\_Ghost](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@David\_Ghost](https://meta.discourse.org/u/David_Ghost)\
**Post date:** [2025年七月24日 14:45 UTC](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718/32 "2025-07-24T14:45:22Z")

</div>

它看起来很快就需要更新到 [Glimmer 组件](https://meta.discourse.org/t/upcoming-post-stream-changes-how-to-prepare-themes-and-plugins/372063)了。

[上一頁](https://meta.discourse.org/t/how-to-show-user-total-post-count-beside-name/287718.md?page=1)
