PDA

View Full Version : Query: Display most participating users from actual forum


ThorstenA
03-19-2010, 08:28 AM
This query displays the most participating users from actual forum - you can place it in plugin forumdisplay_start:

SELECT user.userid, user.username, count( * ) AS postcount
FROM user, post, thread,
(SELECT " . $foruminfo[forumid] . " AS forumid UNION
SELECT forumid
FROM forum
WHERE parentlist LIKE \"%," . $foruminfo[forumid] . ",%\"
) AS tmp_a
WHERE thread.forumid = tmp_a.forumid
AND user.userid = post.userid
AND post.threadid = thread.threadid
GROUP BY user.username
ORDER BY postcount DESC
LIMIT 5

borbole
03-19-2010, 11:51 AM
SHouldn''t this be better posted at the Add on''s section?

ThorstenA
03-19-2010, 12:07 PM
I have done several plugins for myself however I do not have currently the time to publish them as real products. Therefore I provide here my queries and if a developer likes to write a product out of it - that's cool :D