mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
Znote AAC rev 168 from subversion.
This commit is contained in:
24
layout/widgets/topplayers.php
Normal file
24
layout/widgets/topplayers.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<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` 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>
|
Reference in New Issue
Block a user