mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-04-29 18:59:21 +02:00
24 lines
649 B
PHP
24 lines
649 B
PHP
<div class="sidebar">
|
|
<h3>Top 5 players</h3>
|
|
<?php
|
|
|
|
$cache = new Cache('engine/cache/topPlayer');
|
|
if ($cache->hasExpired()) {
|
|
$players = mysql_select_multi('SELECT `name`, `level`, `experience` FROM `players` WHERE `group_id` < ' . $config['highscore']['ignoreGroupId'] . ' ORDER BY `experience` DESC LIMIT 5;');
|
|
|
|
$cache->setContent($players);
|
|
$cache->save();
|
|
} else {
|
|
$players = $cache->load();
|
|
}
|
|
|
|
if ($players) {
|
|
$count = 1;
|
|
foreach($players as $player) {
|
|
echo "$count - <a href='characterprofile.php?name=". $player['name']. "'>". $player['name']. "</a> (". $player['level'] .").<br>";
|
|
$count++;
|
|
}
|
|
}
|
|
?>
|
|
<br>
|
|
</div>
|