From f720da79d01ea80dc8a3186ffe36504411f53e14 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Mon, 17 Sep 2012 13:16:41 +0000 Subject: [PATCH] Fix bug in chat button image's generation script --- src/messenger/webim/libs/operator.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index 5bea5698..f4e7c5d3 100644 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -267,10 +267,12 @@ function has_online_operators($groupid = "") $db = Database::getInstance(); $query = "select count(*) as total, min(:now - dtmlastvisited) as time from {chatoperator}"; + $values = array(':now' => time()); if ($groupid) { $query .= ", {chatgroupoperator}, {chatgroup} where {chatgroup}.groupid = {chatgroupoperator}.groupid and " . "({chatgroup}.groupid = :groupid or {chatgroup}.parent = :groupid) and {chatoperator}.operatorid = " . "{chatgroupoperator}.operatorid and istatus = 0"; + $values[':groupid'] = $groupid; } else { if (Settings::get('enablegroups') == 1) { $query .= ", {chatgroupoperator} where {chatoperator}.operatorid = " . @@ -282,10 +284,7 @@ function has_online_operators($groupid = "") $row = $db->query( $query, - array( - ':groupid'=>$groupid, - ':now' => time() - ), + $values, array('return_rows' => Database::RETURN_ONE_ROW) ); return $row['time'] < Settings::get('online_timeout') && $row['total'] > 0;