mirror of
https://github.com/slawkens/myaac.git
synced 2025-12-15 05:19:47 +01:00
30 lines
649 B
PHP
30 lines
649 B
PHP
<?php
|
|
/**
|
|
* Example of using getTopPlayers() function
|
|
* to display the best players for each skill
|
|
*/
|
|
defined('MYAAC') or die('Direct access not allowed!');
|
|
|
|
$skills = [
|
|
'magic', 'level',
|
|
'balance', 'frags',
|
|
POT::SKILL_FIST, POT::SKILL_CLUB,
|
|
POT::SKILL_SWORD, POT::SKILL_AXE,
|
|
POT::SKILL_DISTANCE, POT::SKILL_SHIELD,
|
|
POT::SKILL_FISH
|
|
];
|
|
|
|
foreach ($skills as $skill) {?>
|
|
<ul>
|
|
<?php
|
|
echo '<strong>' . ucwords(is_string($skill) ? $skill : getSkillName($skill)) . '</strong>';
|
|
foreach (getTopPlayers(5, $skill) as $player) {?>
|
|
<li><?= $player['rank'] . '. ' . $player['name'] . ' - ' . $player['value']; ?></li>
|
|
<?php
|
|
}
|
|
?>
|
|
</ul>
|
|
<?php
|
|
}
|
|
|