Here you go, clickable usernames in the last column - enjoy. Great hack ...
PHP Code:
<?php
error_reporting(7);
$templatesused='reflistbit,reflist';
require('./global.php');
$max=25; //This number decides how many users to display
$referrers = $DB_site->query("SELECT COUNT(*) AS referrals, user.username, user.userid FROM user AS users
LEFT JOIN user ON (users.referrerid = user.userid)
WHERE users.referrerid <> 0
GROUP BY users.referrerid
ORDER BY referrals DESC
LIMIT $max");
while ($referrer=$DB_site->fetch_array($referrers)) {
$referreds = $DB_site->query("SELECT username FROM user WHERE referrerid = '$referrer[userid]'");
while ($referred = $DB_site->fetch_array($referreds)){
$enc_username = urlencode($referred[username]);
if ($referrerlist) {
$referrerlist .= ", <A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";
} else {
$referrerlist .= "<A HREF=member.php?action=getinfo&username=$enc_username>$referred[username]</A>";
}
}
eval("\$reflistbits .= \"".gettemplate("reflistbit")."\";");
$referrerlist="";
}
eval("dooutput(\"".gettemplate("reflist")."\");");
?>