Does read-only mode prevent users from getting the devotee badge?

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 Likes

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

The “year in review” stated that some of my users (including myself) have only visited 364 days this year, which I’m pretty sure is wrong…

Is there a quick way to see which day these users have missed?

To answer your first question, I would expect putting a site into read only mode to affect users ability to get the Devotee badge. When a site is in read only mode, no new data is written to the database, so details about the user’s visits will not be recorded when the site is in read only mode.

Give this query a try. It returns the days that a user has not visited the site between a given start and end date:

Days without visits for user

--[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

If you would like to award the badge to some users who do not technically qualify for it, have a look at How to award a non-custom badge through the console. Note, that approach is only possible on self-hosted sites. For sites on our hosting, we can grant the badges listed in that topic for you.

4 Likes

Thank you very much for your exhaustive reply.

The query indeed showed that users didn’t visit the forum the day it was read-only.

I’ll grant the badge from the console, thank you for this additional info :slight_smile:


Couldn’t grant the badge as the Devotee badge can’t be granted multiple times. But good to know anyway!

3 Likes

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