2013-11-01, 10:16 PM
2013-11-01, 10:24 PM
call a table for reputations and add order by reputation DESC LIMIT x
So you have the limit to the threads you wanna show, and order by rep DESC you told more to minus rep, cheers, hope it helps.
So you have the limit to the threads you wanna show, and order by rep DESC you told more to minus rep, cheers, hope it helps.
2013-11-01, 10:29 PM
can you please post the query cos it is complicated for me.
2013-11-01, 10:37 PM
Something like this:
SELECT r.pid, p.uid, p.subject, p.message, p.username, COUNT(*) as count
FROM mybb_reputation r
LEFT JOIN mybb_posts p ON (r.pid=p.pid)
GROUP BY r.pid
ORDER BY count DESC
LIMIT 5
2013-11-01, 10:46 PM
thank you. this will get all posts with reputations? How can i get all posts with negative reputations? what query do i need. thank you again
2013-11-01, 10:56 PM
It should select 5 uid/username/subject/message from posts with the most positive/negative/neutral (so overall) reputations. Change 5 to higher value if you want more.
For negative only, this would work I guess:
For negative only, this would work I guess:
SELECT r.pid, p.uid, p.subject, p.message, p.username, COUNT(*) as count
FROM mybb_reputation r
LEFT JOIN mybb_posts p ON (r.pid=p.pid)
WHERE r.reputation < 0
GROUP BY r.pid
ORDER BY count DESC