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']);
|
$character['characterroles'] = array_map(function($a) { return $a['name']; }, $character['characterroles']);
|
||||||
|
|
||||||
// Level
|
// 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
|
||||||
$avatar = $this->Avatars->getAvatarById($character['avatar_id']);
|
$avatar = $this->Avatars->getAvatarById($character['avatar_id']);
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@
|
||||||
<?=$character['name']?>
|
<?=$character['name']?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</p>
|
</p>
|
||||||
|
<?php if(array_key_exists('xplevel', $character) && !is_null($character['xplevel'])) : ?>
|
||||||
<p><small><?=_('Level')?> <?=$character['xplevel']['level']?></small></p>
|
<p><small><?=_('Level')?> <?=$character['xplevel']['level']?></small></p>
|
||||||
|
<?php endif ?>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue