2010-09-04, 03:51 PM
I added this to the prostats.php file to include the thankyou plugin as suggested by Saeed:
function ps_GetMostThanks($NumOfRows)
{
global $mybb, $db, $templates, $theme, $lang, $ps_align;
if($db->table_exists("thx"))
{
$query = $db->query("SELECT u.uid, u.username, u.usergroup, u.displaygroup, COUNT(t.adduid) as thxcount FROM ".TABLE_PREFIX."thx t LEFT JOIN ".TABLE_PREFIX."users u ON (t.adduid=u.uid) GROUP BY t.adduid ORDER BY thxcount DESC LIMIT 0,{$NumOfRows}");
while($most_thanks = $db->fetch_array($query))
{
$uid = $most_thanks['uid'];
$username = ps_FormatName(htmlspecialchars_uni($most_thanks['username']), $most_thanks['usergroup'], $most_thanks['displaygroup']);
$thxnum = $most_thanks['thxcount'];
$profilelink = get_profile_link($uid);
eval("\$mostthanks_row .= \"".$templates->get("prostats_mostthanks_row")."\";");
}
}
eval("\$column_mostthanks = \"".$templates->get("prostats_mostthanks")."\";");
return $column_mostthanks;
}
and it works fine!
I just wanted to exclude the admin group of that list as they will always be on top... Is that possible?
Thanks in advance and I love the plugin
function ps_GetMostThanks($NumOfRows)
{
global $mybb, $db, $templates, $theme, $lang, $ps_align;
if($db->table_exists("thx"))
{
$query = $db->query("SELECT u.uid, u.username, u.usergroup, u.displaygroup, COUNT(t.adduid) as thxcount FROM ".TABLE_PREFIX."thx t LEFT JOIN ".TABLE_PREFIX."users u ON (t.adduid=u.uid) GROUP BY t.adduid ORDER BY thxcount DESC LIMIT 0,{$NumOfRows}");
while($most_thanks = $db->fetch_array($query))
{
$uid = $most_thanks['uid'];
$username = ps_FormatName(htmlspecialchars_uni($most_thanks['username']), $most_thanks['usergroup'], $most_thanks['displaygroup']);
$thxnum = $most_thanks['thxcount'];
$profilelink = get_profile_link($uid);
eval("\$mostthanks_row .= \"".$templates->get("prostats_mostthanks_row")."\";");
}
}
eval("\$column_mostthanks = \"".$templates->get("prostats_mostthanks")."\";");
return $column_mostthanks;
}
and it works fine!
I just wanted to exclude the admin group of that list as they will always be on top... Is that possible?
Thanks in advance and I love the plugin