sort
This commit is contained in:
parent
61cdb6775e
commit
6df859f963
1 changed files with 13 additions and 3 deletions
|
@ -36,10 +36,20 @@
|
||||||
$pr[$usern['username']] = log($h/10 + 1)*10* M_E;
|
$pr[$usern['username']] = log($h/10 + 1)*10* M_E;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach ($result as $usern) { ?>
|
|
||||||
|
function cmp($a, $b) {
|
||||||
|
if ($a == $b) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return ($a > $b) ? -1 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
uasort($pr,'cmp');
|
||||||
|
|
||||||
|
foreach ($pr as $usern => $rr) { ?>
|
||||||
<div class='comment'>
|
<div class='comment'>
|
||||||
<b><?php echo $usern['username'] ?></b>
|
<b><?php echo $usern ?></b>
|
||||||
<div>Rank: <?php echo (int)($pr[$usern['username']] * 10) ?></div>
|
<div>Rank: <?php echo (int)($rr * 10) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?php }
|
<?php }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue