summaryrefslogtreecommitdiff
path: root/includes/model
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2017-01-03 15:32:12 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2017-01-03 15:59:33 +0100
commit8254a79c58ab5f80bfd5549f6141fda8039599ab (patch)
tree318cdf59ba302b28c02601497fd06f7a55797244 /includes/model
parent1c27bf1375fe769ab53cbd67278ce41a5cc2a9d8 (diff)
Bugfixes & improvements
Diffstat (limited to 'includes/model')
-rw-r--r--includes/model/Room_model.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php
index a96ca715..3eb9f452 100644
--- a/includes/model/Room_model.php
+++ b/includes/model/Room_model.php
@@ -53,12 +53,18 @@ function Room_create($name, $from_frab, $public, $number = null)
/**
* Returns room by id.
*
- * @param int $room_id RID
+ * @param int $room_id RID
+ * @param bool $show_only
* @return array|false
*/
-function Room($room_id)
+function Room($room_id, $show_only = true)
{
- $room_source = sql_select("SELECT * FROM `Room` WHERE `RID`='" . sql_escape($room_id) . "' AND `show` = 'Y'");
+ $room_source = sql_select("
+ SELECT *
+ FROM `Room`
+ WHERE `RID`='" . sql_escape($room_id) . "'
+ " . ($show_only ? "AND `show` = 'Y'" : '')
+ );
if ($room_source === false) {
return false;