add ?entry text? to Quests and show them instead of the name
This commit is contained in:
parent
1e2c55a34e
commit
7958dddd05
4 changed files with 61 additions and 8 deletions
|
|
@ -69,6 +69,47 @@
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get count of Questtexts for a Quest.
|
||||
*
|
||||
* @param int $questId ID of the Quest
|
||||
* @param string $questtexttypeUrl URL of the Questtexttype
|
||||
* @return int Amount of Questtexts for a Quest
|
||||
*/
|
||||
public function getQuesttextCountOfQuest($questId, $questtexttypeUrl=null)
|
||||
{
|
||||
if(is_null($questtexttypeUrl))
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT count(questtexts.id) AS c '.
|
||||
'FROM questtexts '.
|
||||
'LEFT JOIN questtexttypes ON questtexttypes.id = questtexts.questtexttype_id '.
|
||||
'WHERE questtexts.quest_id = ?',
|
||||
'i',
|
||||
$questId
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT count(questtexts.id) AS c '.
|
||||
'FROM questtexts '.
|
||||
'LEFT JOIN questtexttypes ON questtexttypes.id = questtexts.questtexttype_id '.
|
||||
'WHERE questtexts.quest_id = ? and questtexttypes.url = ?',
|
||||
'is',
|
||||
$questId,
|
||||
$questtexttypeUrl
|
||||
);
|
||||
}
|
||||
if(!empty($data)) {
|
||||
return $data[0]['c'];
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get corresponding Questtext for a Sidequest.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue