Jump to content

Top 5 Posters


balkan7

Recommended Posts

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>"; ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.