Hi there,
here's a little patch to allow the chatroom page to display the number of messages also for archived chats (without this patch it shows 0)
$result = db_query('SELECT GREATEST(COUNT(cm.cmid), COUNT(cma.cmid)) AS msg_count,
GREATEST(MAX(cm.cmid),MAX(cma.cmid)) AS last_cmid,
cc.ccid,
cc.chatname,
cc.when_archived
FROM {chatroom} AS cr
INNER JOIN {chatroom_chat} AS cc
ON cc.crid = cr.crid
LEFT JOIN {chatroom_msg} AS cm
ON cm.ccid = cc.ccid
LEFT JOIN {chatroom_msg_archive} AS cma
ON cma.ccid = cc.ccid
WHERE cr.crid = %d
GROUP BY cc.ccid',
$room_id);
Hope this helps.
Comments
Comment #1
Anonymous (not verified) commentedhi jun,
thanks! i've applied your changes to cvs.
regards
justin
Comment #2
Anonymous (not verified) commented