MN Forum

Full Version: Top 10 Users Overall Widget
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Someone requested this

[IMG]Hidden content for guests[/IMG]

So I attempted to create it the best I could.....

I ran into trouble when it came to column spacing with the user names so I used table-layout:fixed since it seem to give a temporary fix until someone decides to build off this little release.

This code is based off the Top 3 Active users code and I only take credit for the few edits I added.


Code:
Hidden content for guests



If you run into any problems with the code above please let me know. I will not fix formatting issues, only errors.
its good thank you for sharing
(05-27-2013, 09:55 AM)Preston Wrote: [ -> ]Hidden content for guests


Hello preston,

I solved everything - I changed a little the code and I entered the right style, the style is obviously linked to my site ..

If you have problems with the css contact me, also as well as the code you have posted to me did not work, I had to edit ..
Please note that this code is to modify the folder or file name of the author of php Are
I have removed the Today Clicks table from the block and adjusted the size of the rows data.


<?
$sql = $db->Query("SELECT a.uid, SUM(a.total_clicks) AS total, b.login FROM user_clicks a LEFT JOIN users b ON b.id = a.uid GROUP BY a.uid ORDER BY total DESC LIMIT 10");
if($db->GetNumRows($sql) >= 10){
?>
<div class="home_top">
<table class="table" style="table-layout:5;60;10">
<thead>
<tr><td colspan="3">Top 10 Members</td></tr>
</thead>
<tbody>
<tr><td><center>Rank</center></td><td><center>Member</center></td><td><center>Clicks</center></td></tr>
<?
$j = 0;
foreach($db->FetchArrayAll($sql) as $top){
$j++;
echo '<tr><td><center>'.$j.'</center></td><td style="overflow:hidden;"><center>'.$top['login'].'</center></td><td><center>'.$top['total'].'</center></td></tr>';
}
?>
</tbody>
</table>
</div>
<?}?>
Can anyone say me where put this code?
This code must be placed in the header.php
I place them but nothing happening...
Hi, anyone knows how to make the table only leaves 10 who have more clicked and not to leave the total.

a greeting

* Sorry for my English
Can someone help me out?
Pages: 1 2