Parašė bad_user· 2008 Vas. 13 07:02:12
#3
Čia top forumo nariai su avatarais:
openside("Top Forumo Nariai");
$sql=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY 'user_posts' DESC LIMIT 0, 8");
echo "<table width='auto' cellspacing='0' cellpadding='0'>";
$i=0;
while ($data=dbarray($sql)) {
echo "<tr>
<td align='left'>
<a href='".BASEDIR."profile.php?lookup=".$data ['user_id']."'>";
if(!empty($data['user_avatar']))
{
$avatar="<img src='".IMAGES."avatars/".$data['user_avatar']."' alt='".$data['user_name']."' width='50' height='50'>";}
else
{
$avatar="<img src='".IMAGES."noavatar.gif' alt='".$data['user_name']."' width='50' height='50'>";}
echo"$avatar</a></td>
<td align='left'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a><br> - ".$data['user_posts']." Pranesimai</td></tr>";
$i++;
}
echo "</table>";
closeside();
Variantas be avatariku:
openside("Top Forumo Nariai");
$sql=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY 'user_posts' DESC LIMIT 0, 5");
echo "<table width='auto' cellspacing='0' cellpadding='0'>";
$i=0;
while ($data=dbarray($sql)) {
echo "<tr>
<td align='left'>
<a href='".BASEDIR."profile.php?lookup=".$data ['user_id']."'>";
echo"</a></td>
<td align='left'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>".$data['user_name']."</a> - ".$data['user_posts']." Pranesimai</td></tr>";
$i++;
}
echo "</table>";
closeside();
;)