SELECT u.username AS username, COUNT(*) AS totalPosts
FROM xf_post AS p
LEFT JOIN xf_user AS u ON (u.user_id = p.user_id)
LEFT JOIN xf_thread AS t ON (t.thread_id = p.thread_id)
WHERE p.post_date > UNIX_TIMESTAMP('2012-05-01 00:00:00')
AND t.node_id NOT IN (5,4,3,2,1,6,7,8)
GROUP BY p.user_id
ORDER BY totalPosts
DESC;