balkan7 Posted February 3, 2008 Share Posted February 3, 2008 code working good just not show id of last user ? first 4 posters show profile.php?clen=ID on last poster not show ID (profile.php?clen=) <?php echo "<table cellpading='0' cellspacing='1' width=100%' class='tbl-border'><tr>"; echo "<td width='25%' class='tbl1'>".$locale['EJ_2020']."</td><td width='25%' class='tbl1'>".$locale['EJ_2016']."</td>\n<td width='50%' class='tbl1'>".$locale['EJ_2017']."</td></tr> <tr><td class='tbl2' nowrap>"; $cats = dbcount("(joke_cat_id)", "joke_cat"); $jokes = dbcount("(joke_id)", "joke"); $i = 0; $query = dbquery("SELECT user_id FROM ".$db_prefix."users WHERE user_name='".$user['joke_nick']."'"); $user_info = dbarray($query); $result = dbquery("SELECT joke_nick, COUNT(*) AS top_5 FROM ".$db_prefix."joke GROUP BY joke_nick ORDER BY top_5 DESC LIMIT 0,5"); while ($user = dbarray($result)){ $query = dbquery("SELECT user_id FROM ".$db_prefix."users WHERE user_name='".$user['joke_nick']."'"); $user_info = dbarray($query); $i++; echo "<table cellpading='0' cellspacing='0' width=100%'><tr><td width=1%' class='small2'>".$i.".</td><td class='tbl2'><a href='../../profile.php?clen=".$user_info['user_id']."'>".$user['joke_nick']."</a></td><td class='small2' width='1%'>".$user['top_5']."</td></tr></table>"; } echo "</td>"; echo "<td class='tbl2' nowrap>".$locale['EJ_2018']."<span class='small2'>".$cats."</span><br />".$locale['EJ_2019']."<span class='small2'>".$jokes."</span></td>"; $result1 = dbquery("SELECT * FROM ".$db_prefix."joke ORDER BY joke_id DESC LIMIT 0,1"); while($data1 = dbarray($result1)){ if (strlen($data1['joke_description'] < 250)) { echo "<td valign='top' class='tbl2'>".nl2br(stripslashes($data1['joke_description']))."</td>\n"; } else { echo "<td valign='top' class='tbl2'>".nl2br(stripslashes(substr($data1['joke_description'],0, 250)))."</td>\n"; } } echo "</tr></table>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/89236-top-5-posters/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.