It’s possible to add automatically badge on user have most 100 solved accept ?
AI-generated summary
In a discussion titled ‘Is it possible to have a badge for 100 solutions?’, barto_95 asks if a badge can be automatically awarded to users who reach 100 accepted solutions. JammyDodger explains that while the Solved plugin includes built-in badges for 1, 10, 50, and 150 solutions, a custom SQL-triggered badge for 100 can be created by modifying an existing badge’s SQL query and adjusting the threshold. barto_95 tests the query but notices discrepancies — one user with 106 solutions doesn’t appear in the badge results. JammyDodger clarifies that the badge query excludes self-solutions (where the topic creator accepts their own answer) and solutions from deleted topics, unlike the user directory which includes them. barto_95 asks for clarification on ‘self-solutions’, and JammyDodger points to the SQL line AND p.user_id <> t.user_id which filters out solutions by the topic’s original poster. barto_95 confirms understanding and thanks for help with translating badge text, which can be customized via /admin/customize/site_texts?q=badges.solved.
The Solved plugin comes with badges built in for 1, 10, 50, and 150 solutions - you just need to enable them - https://meta.discourse.org/t/discourse-solved/30155#solved-badges-9
Though to create one for 100, you can copy the SQL of one of those, change the threshold, and add it back in as a new custom SQL-triggered badge. There’s more info on that in Creating triggered custom badge queries, and how to enable it here Enable Badge SQL.
Thank’s for your reply I understand now ![]()
But when i test this query:
SELECT post_id, user_id, created_at AS granted_at
FROM (
SELECT p.id AS post_id, p.user_id, pcf.created_at,
ROW_NUMBER() OVER (PARTITION BY p.user_id ORDER BY pcf.created_at) AS row_number
FROM post_custom_fields pcf
JOIN badge_posts p ON pcf.post_id = p.id
JOIN topics t ON p.topic_id = t.id
WHERE pcf.name = 'is_accepted_answer'
AND p.user_id <> t.user_id -- ignore topics solved by OP
AND (:backfill OR p.id IN (:post_ids))
) x
WHERE row_number = 100
The result is :
Just 2 badges for 2 users but I know a other user have mor than 100 and not show on result query…
But this user have 106 solution:
Just another question it’s possible to change the text for my language ?I don’t understand how to that
The badge query doesn’t count self-solutions or solutions from deleted topics, whereas the directory one currently does. This can lead to a small mismatch in the counts.
You can update the text of the solved badges by searching for badges.solved in your customised texts, and that should bring up all the relevant fields: ![]()
/admin/customize/site_texts?q=badges.solved
What do you mean by “self-solutions”?
thank’s for update text is ok ![]()
This line here:
It excludes any solutions where the solution is given by the person who created the topic.
OK thank’s you ![]()

