Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Top forumo nariai su avatarais taisymas
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
Parašė And2s· 2009 Lie. 5 11:07:55
#2
<?
$sql=dbquery("SELECT * FROM ".$db_prefix."GROUP BY user_name ORDER BY user_posts DESC LIMIT 0,10");
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 And2s· 2009 Lie. 5 13:07:29
Parašė west14· 2009 Lie. 5 11:07:45
#3
Parse error: syntax error, unexpected ';' in /home/bumsoradij/domains/e-mp3.lt/public_html/viewpage.php(26) : eval()'d code on line 2
va ka meta
Parašė And2s· 2009 Lie. 5 13:07:51
#4
Dabar bandyk
Parašė west14· 2009 Lie. 5 13:07:17
#5
dabar:
You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'BY user_name ORDER BY user_posts DESC LIMIT 0,10' at line 1You have an error in your SQL syntax; check the manual that corresponds to your
MySQL server version for the right syntax to use near 'BY user_name ORDER BY user_posts DESC LIMIT 0,10' at line 1
Parašė And2s· 2009 Lie. 5 13:07:54
#6
<?
$sql=dbquery("SELECT * FROM ".$db_prefix." ORDER BY user_posts DESC LIMIT 0,10");
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 And2s· 2009 Lie. 5 13:07:16
Parašė ex-it· 2009 Lie. 5 13:07:16
#7
<?
$sql=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_posts DESC LIMIT 0,10");
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>";
?>
Parašė ramon· 2009 Lie. 5 13:07:30
#8
Kintamasis
$i bereiksmis, ta prasme nekur nenauduojamas tai kaip ji rasyt ? :D
Parašė ex-it· 2009 Lie. 5 16:07:51
#9
As tik uzklausa pakeiciau, neziurejau viso kodo :D