Would there be any way to run a badge query on number of clicks on a link? I find that users will click a link and it will be really popular, but the topic originator never gets any likes to the post (or far less than the number of clicks to the website).
That is a very good idea for a badge. Maybe we can slot that for 1.4, as we like to add at least one useful (encourages “good” behavior) badge each release.
select l.user_id, post_id, min(l.created_at) granted_at
from topic_links l
join posts p on p.id = post_id and p.deleted_at IS NULL
join topics t on t.id = p.topic_id and t.deleted_at IS NULL and t.archetype <> 'private_message'
where not internal and clicks >= 50
group by l.user_id, l.post_id
@codinghorror I don’t mind adding this in for current release … seems pretty simple, your call
If the badge is bronze, nobody’s ever going to receive a notification for that; the granted_at will be too old. You’re going to have to use row_number() to get the correct date for the badge.