pouet.net/stat_avatar.php

34 lines
915 B
PHP
Raw Permalink Normal View History

2013-05-07 14:20:08 -04:00
<?
require("include/top.php");
?>
<table bgcolor="#000000" cellspacing="1" cellpadding="3" border="0">
<?
if ($_GET["avatar"]) {
2013-05-07 23:15:46 +03:00
$sql = "SELECT avatar, id, nickname FROM users WHERE BINARY avatar = '".mysql_real_escape_string($_GET["avatar"])."'";
2013-05-07 14:20:08 -04:00
$r = mysql_query($sql);
while ($o = mysql_fetch_object($r)) {
?>
<tr class="bg<?=(($n++)&1)+1?>">
<td><img src="avatars/<?=$o->avatar?>"></td>
<td><a href="user.php?who=<?=$o->id?>"><?=$o->nickname?></a></td>
</tr>
<?
}
} else {
$sql = "SELECT avatar, count( * ) AS c FROM users GROUP BY BINARY avatar ORDER BY c DESC limit 50";
$r = mysql_query($sql);
while ($o = mysql_fetch_object($r)) {
?>
<tr class="bg<?=(($n++)&1)+1?>">
<td><?=$n?>.</td>
<td><a href="stat_avatar.php?avatar=<?=$o->avatar?>"><img src="avatars/<?=$o->avatar?>" border="0"></a></td>
<td><?DoBar($o->c,false);?></td>
</tr>
<?
}
}
?>
</table>
<? require("include/bottom.php"); ?>