store the total amount of achievable XPs for a Questgroup in the database instead of calculating it every time (Issue #281)

This commit is contained in:
coderkun 2014-05-15 18:17:51 +02:00
commit ea828a88dc
10 changed files with 211 additions and 209 deletions

View file

View file

@ -9,6 +9,7 @@
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?><li><a href="<?=$linker->link('edit', 3)?>"><?=_('Edit seminary')?></a></li><?php endif ?>
<?php if(in_array('admin', \hhu\z\controllers\SeminaryController::$character['characterroles'])) : ?><li><a href="<?=$linker->link('delete', 3)?>"><?=_('Delete seminary')?></a></li><?php endif ?>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?><li><a href="<?=$linker->link(array('quests','index',$seminary['url']))?>"><?=_('Show Quests')?></a></li><?php endif ?>
<?php if(count(array_intersect(array('admin','moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) : ?><li><a href="<?=$linker->link(array('calculatexps',$seminary['url']),1)?>"><?=_('Recalculate XPs')?></a></li><?php endif ?>
</nav>
<?php endif ?>
<p><?=\hhu\z\Utils::t($seminary['description'])?></p>
@ -25,9 +26,9 @@
<a href="<?=$linker->link(array('questgroups','questgroup',$seminary['url'],$group['url']))?>"><?=$group['title']?></a></p>
<div class="cf">
<div class="xpbar">
<span style="width:<?=round($group['character_xps']*100/$group['xps'])?>%"></span>
<span style="width:<?=round($group['character_xps']*100/$group['achievable_xps'])?>%"></span>
</div>
<p class="xpnumeric"><?=$group['character_xps']?> / <?=$group['xps']?> XP</p>
<p class="xpnumeric"><?=$group['character_xps']?> / <?=$group['achievable_xps']?> XP</p>
</div>
<?php if(array_key_exists('text', $group)) : ?>
<p><?=$group['text']?></p>