check XP-level for user?s Character listing
This commit is contained in:
parent
798f3089d1
commit
355afb1e20
2 changed files with 8 additions and 1 deletions
|
|
@ -119,7 +119,12 @@
|
|||
$character['characterroles'] = array_map(function($a) { return $a['name']; }, $character['characterroles']);
|
||||
|
||||
// Level
|
||||
$character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']);
|
||||
try {
|
||||
$character['xplevel'] = $this->Xplevels->getXPLevelById($character['xplevel_id']);
|
||||
}
|
||||
catch(\nre\Exceptions\IdNotFoundException $e) {
|
||||
// No XP-level
|
||||
}
|
||||
|
||||
// Avatar
|
||||
$avatar = $this->Avatars->getAvatarById($character['avatar_id']);
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@
|
|||
<?=$character['name']?>
|
||||
<?php endif ?>
|
||||
</p>
|
||||
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||
<p><small><?=_('Level')?> <?=$character['xplevel']['level']?></small></p>
|
||||
<?php endif ?>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue