2012-12-14, 11:21 PM
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:
Breakdown:
Thank You!
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_postsFROM ".TABLE_PREFIX."posts
= this says it's in TABLE_PREFIX (mybb) postsWHERE 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 descendingThank You!