Hook: forumhome_complete
Title: Most Actived Member Of The Week
Execution Order : 5
Code
Code:
$cutofftime = TIMENOW - 7*86400;
$mostactive = $db->query_first("select count(postid) as count, post.userid, user.username from ".TABLE_PREFIX."post INNER JOIN ".TABLE_PREFIX."user on user.userid = post.userid where post.dateline > $cutofftime GROUP BY post.userid ORDER BY count DESC LIMIT 1");
vB_Template::preRegister('FORUMHOME',array('mostactive' => $mostactive));
Now To Display Username of the Most Active Member
Use:
Code:
{vb:raw mostactive.username}
anywhere in the FORUMHOME TEMPLATE
I know this is old, but maybe someone can help. This works great - I have vb 4.2.5.
I was wondering what I would need to add to the code to exclude my user id, so I'm not showing up as the most active member of my site.