mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
New layout (Znote AAC AtomIO)
Layout is primarily changed to this because the old layout had obsolete javascript dependencies. I still want to make another default layout eventually, which is mobile friendly. This layout has a very nice character search widget though that looks for names realtime and displays them in a list beside the search.
This commit is contained in:
27
layout/widgets/topplayers.php
Normal file
27
layout/widgets/topplayers.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<div class="well widget">
|
||||
<div class="header">
|
||||
Top 5 players
|
||||
</div>
|
||||
<div class="body">
|
||||
<table>
|
||||
<?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 `level` DESC, `experience` DESC LIMIT 5;');
|
||||
|
||||
$cache->setContent($players);
|
||||
$cache->save();
|
||||
} else {
|
||||
$players = $cache->load();
|
||||
}
|
||||
|
||||
if ($players) {
|
||||
foreach($players as $count => $player) {
|
||||
$nr = $count+1;
|
||||
echo "<tr><td>{$nr}</td><td><a href='characterprofile.php?name={$player['name']}'>{$player['name']}</a> ({$player['level']}).</td></tr>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user