Parašė Jaunelis· 2010 Rugp. 3 00:08:34
#6
openside ("Komentatoriu Top 15");
$result=dbquery("SELECT user_name, user_avatar, user_id, count(user_id) AS comment_count FROM ".$db_prefix."comments INNER JOIN
".$db_prefix."users ON comment_name=user_id GROUP BY user_name ORDER BY comment_count DESC LIMIT 15");
echo "<table width='100%' cellpadding='0' cellspacing='0'>";
if(dbrows($result)!=0){
while($data = dbarray($result)){
echo "<tr><td class='small2' align='left'> <a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['comment_count']."<br/>";
if (!$data['user_avatar']) {
$avatar = "images/nera.jpeg";
} else
$avatar = IMAGES."avatars/".$data['user_avatar'];
echo "<img src='$avatar' height='10'></a></td><td class='small2' align='right'></td></tr>";
}
}
echo "</table>";
closeside();