MyBB Community Forums

Full Version: WIP - Post Activity | Sorting not working?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

My Dev guy is working on a plugin, and is pretty much done with the Post Activity plugin. The only problem now is that it works and all but doesn't sort the posts and forums from "Most Posts" to "Least Posts".

Snippets of the coding:
$query = $db->query("
    SELECT COUNT(pid) AS number_posts
    FROM ".TABLE_PREFIX."posts
    WHERE uid = {$uid} AND fid = {$fid}
    ORDER BY number_posts DESC");

Breakdown:
SELECT COUNT(pid) AS number_posts
= counts the posts and makes number_posts

FROM ".TABLE_PREFIX."posts
= this says it's in TABLE_PREFIX (mybb) posts

WHERE uid = {$uid} AND fid = {$fid}
= that just fetches the user id and then counts the posts per fid.

ORDER BY number_posts DESC");
= and this tells it to order it descending

Thank You!
This is the code exactly taken from THIS plugin , and you're not subscriber: http://yaldaram.com/user-10846.html so where did you downloaded it from??
(2012-12-15, 06:11 AM)Yaldaram Wrote: [ -> ]This is the code exactly taken from THIS plugin , and you're not subscriber: http://yaldaram.com/user-10846.html so where did you downloaded it from??

Check your site, I've PM'ed you.