set motto and rank for Character groups
This commit is contained in:
parent
f78568dcc1
commit
de857cdfb5
2 changed files with 28 additions and 3 deletions
|
|
@ -88,7 +88,7 @@
|
||||||
public function getGroupsForGroupsgroup($groupsgroupId)
|
public function getGroupsForGroupsgroup($groupsgroupId)
|
||||||
{
|
{
|
||||||
return $this->db->query(
|
return $this->db->query(
|
||||||
'SELECT id, name, url, xps '.
|
'SELECT id, name, url, xps, motto '.
|
||||||
'FROM v_charactergroups '.
|
'FROM v_charactergroups '.
|
||||||
'WHERE charactergroupsgroup_id = ?',
|
'WHERE charactergroupsgroup_id = ?',
|
||||||
'i',
|
'i',
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
public function getGroupByUrl($groupsgroupId, $groupUrl)
|
public function getGroupByUrl($groupsgroupId, $groupUrl)
|
||||||
{
|
{
|
||||||
$data = $this->db->query(
|
$data = $this->db->query(
|
||||||
'SELECT id, name, url, xps '.
|
'SELECT id, name, url, xps, motto '.
|
||||||
'FROM v_charactergroups '.
|
'FROM v_charactergroups '.
|
||||||
'WHERE charactergroupsgroup_id = ? AND url = ?',
|
'WHERE charactergroupsgroup_id = ? AND url = ?',
|
||||||
'is',
|
'is',
|
||||||
|
|
@ -142,6 +142,31 @@
|
||||||
return $data[0];
|
return $data[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the rank of a XP-value of a Character.
|
||||||
|
*
|
||||||
|
* @param int $seminaryId ID of Seminary
|
||||||
|
* @param int $xps XP-value to get rank for
|
||||||
|
* @return int Rank of XP-value
|
||||||
|
*/
|
||||||
|
public function getXPRank($groupsgroupId, $xps)
|
||||||
|
{
|
||||||
|
$data = $this->db->query(
|
||||||
|
'SELECT count(id) AS c '.
|
||||||
|
'FROM v_charactergroups '.
|
||||||
|
'WHERE charactergroupsgroup_id = ? AND xps > ?',
|
||||||
|
'id',
|
||||||
|
$groupsgroupId, $xps
|
||||||
|
);
|
||||||
|
if(!empty($data)) {
|
||||||
|
return $data[0]['c'] + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="gdesc">
|
<div class="gdesc">
|
||||||
<h3><?=$group['name']?></h3>
|
<h3><?=$group['name']?></h3>
|
||||||
<span>Schweb wie ein Schmetterling! Stich wie eine Biene!</span>
|
<span><?=$group['motto']?></span>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li><i class="fa fa-th-list fa-fw"></i><?=$group['rank']?>. <?=_('Rank')?></li>
|
<li><i class="fa fa-th-list fa-fw"></i><?=$group['rank']?>. <?=_('Rank')?></li>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue