improve users.php loading speed (major fix)

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@455 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-04-05 14:11:44 +00:00
parent 54a39f982e
commit c8979afbff

View File

@ -104,7 +104,7 @@ function thread_to_xml($thread,$link) {
}
function print_pending_threads($groupids,$since) {
global $webim_encoding, $settings;
global $webim_encoding, $settings, $state_closed;
$link = connect();
$revision = $since;
@ -112,6 +112,9 @@ function print_pending_threads($groupids,$since) {
$query = "select threadid, userName, agentName, unix_timestamp(dtmcreated), userTyping, ".
"unix_timestamp(dtmmodified), lrevision, istate, remote, nextagent, agentId, userid, shownmessageid, userAgent, (select vclocalname from chatgroup where chatgroup.groupid = chatthread.groupid) as groupname ".
"from chatthread where lrevision > $since ".
($since <= 0
? "AND istate <> $state_closed "
: "").
($settings['enablegroups'] == '1'
? "AND (groupid is NULL".($groupids
? " OR groupid IN ($groupids)"