Viser hvem der er mest aktiv idag lille gif vedhæfte
Kode opensidex("Mest aktiv i dag","off");
$result_posts = dbquery("SELECT user_id, user_name, Count('post_id') as cnt FROM ".$db_prefix."posts
LEFT JOIN ".$db_prefix."users ON user_id = post_author WHERE post_datestamp + 86400 > ".time()."
GROUP BY user_id ORDER BY cnt DESC LIMIT 5"
);
echo "<table width='100%' border='0'>
<tr>
<td width='19%'><img src='http://phpfusion.dk/images/aktiv.jpg' width='50' height='50'></td>
<td width='81%'>
<table width='100%' border='0'>
<tr valign='top'>
<td>
<table width='100%' align='right' cellpadding='0' cellspacing='0'>";
if (dbrows($result_posts) != 0) {
while($data = dbarray($result_posts)) {
echo "<tr>
<td align='left'><img src='".THEME."images/bullet.gif' alt=''>
<a href='".BASEDIR."profile.php?lookup=".$data['user_id']."' title='".$data['user_name']."' class='side'>".trimlink($data['user_name'], 10)."</a>
</td>
</tr>";
}
}
echo "</table>
</td>
</tr>
</table>
</td>
</tr>
</table>";
closesidex();
|