只读模式是否会阻止用户获得奉献者徽章?

Hi!

I had to set the read-only mode on my forum for a bit more than a day for maintenance purpose.

Does it reset the day count for the Devotee badge?

Hi!
:thinking: I’d say no, as I didn’t find any reason why it would, as long as the user still visit the read-only forum. "start" seems to be only user related

And I remember that the “last seen” column of the users tab was alive even in read-only mode, so my guess is you’re in the clear :sweat_smile:

2 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

“年度回顾”中提到,我的一些用户(包括我自己)今年只访问了 364 天,但我很确定这是错误的……

有没有什么快速的方法可以查看这些用户错过了哪一天?

为了回答您的第一个问题,我预计将网站设为只读模式会影响用户获得“Devotee”徽章的能力。当网站处于只读模式时,不会有新数据写入数据库,因此在网站处于只读模式时,用户访问的详细信息将不会被记录。

可以试试这个查询。它会返回用户在给定开始日期和结束日期之间未访问网站的日期:

用户未访问天数

--[params]
-- date :start_date
-- date :end_date
-- string :username

WITH days AS (
SELECT date_trunc('day', day)::date AS day
FROM generate_series(:start_date::date, :end_date::date, '1 day') AS day
),
users_visits AS (
SELECT
visited_at
FROM user_visits uv
JOIN users u ON u.id = uv.user_id
WHERE u.username = :username
AND visited_at BETWEEN :start_date AND :end_date
),
visits_days AS (
SELECT
day,
visited_at
FROM days
LEFT JOIN users_visits uv
ON uv.visited_at = day
ORDER BY day DESC
)

SELECT day AS days_without_visits
FROM visits_days WHERE visited_at IS NULL
ORDER BY day DESC

如果您想为一些不符合技术资格的用户授予徽章,请查看 https://meta.discourse.org/t/how-to-award-a-non-custom-badge-through-the-console/103269。请注意,这种方法仅在自托管网站上可用。对于托管在我们服务器上的网站,我们可以为您授予该主题中列出的徽章。

4 个赞

非常感谢您详尽的回复。

查询确实显示用户在论坛只读的那天没有访问论坛。

我将从控制台授予徽章,感谢您提供这些额外信息 :slight_smile:


由于“Devotee”徽章不能授予多次,因此无法授予该徽章。但无论如何,知道这一点还是好的!

3 个赞

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.