Parašė west14· 2009 Lie. 5 11:07:22
#1
noriu padaryti kad top butu pagal parasytu zinuciu tvarka ir kad butu top 10 kaip padaryti stai kodas:
<?
$sql=dbquery("SELECT * FROM ".$db_prefix."GROUP BY user_name 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']."'>";
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='http://www.e-mp3.lt/moduliai/user_info_panel/images/noimage.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>";
?>
Redagavo west14· 2009 Lie. 5 11:07:18