Since there deliberately isn’t the concept of achievements for posting, I’ve managed to implement it on ours, since we had it on our old forums and some were complain about the lack thereof.
Generic version:
SELECT user_id, 0 post_id, current_timestamp granted_at
FROM badge_posts
WHERE (:backfill OR user_id IN (:user_ids) OR 0 NOT IN (:post_ids) )
GROUP BY user_id
HAVING count(*) > 1000
Change the 1000 for whatever post limit you’re after. I’ve themed ours (due to the nature of our board) on powers of 2.
Note that this will (should) only count posts that are public (not in categories that are restricted or private messages) or otherwise unrestricted (checkbox on edit category ignoring badges)
Additionally, for our board I’ve had to exclude certain topics due to the nature of my charges:
SELECT user_id, 0 post_id, current_timestamp granted_at
FROM badge_posts
WHERE topic_id NOT IN (
[elided]
) AND topic_id NOT IN (
[elided]
) AND (:backfill OR user_id IN (:user_ids) OR 0 NOT IN (:post_ids) )
GROUP BY user_id
HAVING count(*) >= 2048
Thanks. This is very helpful. I am also thinking about encouraging users to initiate discussions. I am messing around your query to count original posts with p.post_number = 1
I just found this little gem here. I wanted to create my own custom badge queries for number of posts in specific categories. How can one modify this to also include the condition of specific category ids so only posts in a specific category will count?
Should be a modification of the first query here where badges are awarded based on creating topics in a specific category. The difference is we award based on number of posts in a specific category.