mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-18 12:16:24 +01:00
Merge branch 'develop' into feature/refactor-account-lost
This commit is contained in:
29
system/pages/#examples/top-5.php
Normal file
29
system/pages/#examples/top-5.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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
|
||||
}
|
||||
|
||||
@@ -51,6 +51,8 @@ if($player_name != null) {
|
||||
'description' => 'The character information has been changed.'
|
||||
));
|
||||
$show_form = false;
|
||||
|
||||
$hooks->trigger(HOOK_ACCOUNT_CHARACTERS_CHANGE_COMMENT_AFTER_SUCCESS, ['player' => $player]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -70,9 +72,11 @@ if($show_form) {
|
||||
}
|
||||
|
||||
if(isset($player) && $player) {
|
||||
$twig->display('account.characters.change-comment.html.twig', array(
|
||||
'player' => $player->toArray()
|
||||
));
|
||||
$_player = $player->toArray();
|
||||
$_player['id'] = $player->id; // Hack, as it's somehow missing in the toArray() function
|
||||
|
||||
$twig->display('account.characters.change-comment.html.twig', [
|
||||
'player' => $_player,
|
||||
]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -70,7 +70,7 @@ foreach($posts as &$post) {
|
||||
}
|
||||
|
||||
$post['group'] = $groupName;
|
||||
$post['player_link'] = getPlayerLink($player->getName());
|
||||
$post['player_link'] = '<a href="' . getPlayerLink($player, false) . '" style="position: relative;">' . $player->getName() . '</a>';
|
||||
|
||||
$post['vocation'] = $player->getVocationName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user