Hi - I had this mod installed before I had to upgrade to 1.7.4
I don't have a problem getting it to work after modifyin by the third or so post. The problem is I want to show the top 5 users by # of comments. How do I modify this code to show it? I am using {user_comments_list} as my call in the home.html.
here is the original code for the top uploaders:
// top uploaders
$last_action_user_list = "";
$sql = "SELECT COUNT(i.image_id) AS user_t_images, u.user_name, u.user_id
FROM ".USERS_TABLE." u
LEFT JOIN ".IMAGES_TABLE." i ON (i.user_id = u.user_id)
WHERE u.user_level > ".GUEST."
GROUP BY u.user_id
ORDER BY user_t_images DESC
LIMIT 5";
$result = $site_db->query($sql);
while ($row = $site_db->fetch_array($result)) {
$last_action_user_list .= '<a href ="'.ROOT_PATH.'member.php?action=showprofile&user_id='.$row['user_id'].'"><b>'.$row['user_name'].'</b></a> <span class="smalltext">'.$row['user_t_images'].'</span><br>';
}
$site_template->register_vars(array(
"user_uploaders_list" => $last_action_user_list,
));
unset($user_uploaders_list);
how do I modify this to sort by the top # of comments by user? I did it before I just can't figure out what I did!
Thanks