Se il tuo forum ha installato il plugin Data Explorer, potresti scrivere query SQL per recuperare queste informazioni dal database di Discourse. Questa query tenta di recuperare l’ID e il titolo degli argomenti e l’ID dell’utente dell’ultimo post nell’argomento. Seleziona solo gli argomenti in cui l’ultimo post è stato effettuato da un utente nel gruppo ‘clients’.
Questo è solo un esempio.
SELECT
t.id AS topic_id,
t.title AS topic_title,
(SELECT user_id FROM posts WHERE topic_id = t.id ORDER BY created_at DESC LIMIT 1) AS last_post_user_id
FROM
topics t
JOIN
posts p ON p.topic_id = t.id
JOIN
group_users gu ON gu.user_id = p.user_id
JOIN
groups g ON g.id = gu.group_id
WHERE
g.name = 'clients'
GROUP BY
t.id
HAVING
MAX(p.user_id) = last_post_user_id
ORDER BY
MAX(p.created_at) DESC