summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/model/Room_model.php')
-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;