From 8254a79c58ab5f80bfd5549f6141fda8039599ab Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Tue, 3 Jan 2017 15:32:12 +0100 Subject: Bugfixes & improvements --- includes/model/Room_model.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'includes/model') 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; -- cgit v1.2.3-70-g09d2