PDA

View Full Version : "Most Active In <forum>" shown in profile?


Gary King
01-11-2005, 11:19 PM
Anyone know of a mod that shows which forum a user is most active in? Something similiar to the one available in Invision Board profiles :)

Andreas
01-11-2005, 11:41 PM
In member.php FIND
eval('print_output("' . fetch_template($templatename) . '");');


ABOVE that ADD

$mostactive = $DB_site->query_first("SELECT thread.forumid, COUNT(post.postid) AS posts
FROM " . TABLE_PREFIX . "post AS post
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)
WHERE post.userid = $userid
GROUP BY thread.forumid
ORDER BY posts DESC
LIMIT 1");
$mostactive['title'] = $forumcache[$mostactive['forumid']]['title'];


Then use you can use array $mostactive (with keys posts, forumid and title) in template MEMBERINFO oder memberinfo_quick