I’m looking for a way for me, as admin, to see a list of the most popular posts, forum-wide, based on the number of likes.
Basically a posts-centered version of…
Discourse Meta, which lists and allows sorting of users, or
Discourse Meta, which lists and allows sorting of topics.
My use case is that I’d like to identify posts that were judged most valuable by the community, so I can use them the basis for articles I write for readers of my email newsletter who are not on the forum.
I use the following query in the Data Explorer plugin:
SELECT p.id as post_id, p.like_count
FROM posts p
LEFT JOIN topics t ON t.id = p.topic_id
LEFT JOIN users u ON u.id = p.user_id
WHERE NOT u.blocked
ORDER BY p.like_count DESC, p.created_at ASC
LIMIT 10
Also, consider using “score” rather than like count. Score takes a weighted average of different measures of post value.