prevent divisons by zero for progress bars

This commit is contained in:
oliver 2015-04-19 16:09:45 +02:00
commit 6c5fbb3f22
5 changed files with 7 additions and 7 deletions

View file

@ -24,7 +24,7 @@
<?php if(array_key_exists('usercharacter', $seminary)) : ?>
<div class="cf">
<div class="xpbar">
<span style="width:<?=round($seminary['usercharacter']['xps'] * 100 / $seminary['xps'])?>%"></span>
<span style="width:<?=($seminary['xps'] > 0) ? round($seminary['usercharacter']['xps'] * 100 / $seminary['xps']) : 0?>%"></span>
</div>
<p class="xpnumeric"><?=$seminary['usercharacter']['xps']?> / <?=sprintf(_('%dXPs'), $seminary['xps'])?></p>
</div>