$json["status"] = 0; $json["statusInfo"] = "fail"; } } } if ($_REQUEST["operation"] == "onlineuserlist") { if (!isset($_REQUEST["userid"]) || !isset($_REQUEST["appid"])) { $json["status"] = 0; $json["statusInfo"] = "fail"; $json["error"] = "parameter missing"; } else { $chat->getAppids($_REQUEST["userid"], $_REQUEST["appid"]); $rec = $chat->numofrows(); $appids[] = $_REQUEST["appid"]; if ($rec > 0) { while ($chat->getRow()) { $appids[] = $chat->getField('id'); } } //print_r($appids); $appids = implode(",", $appids); // get all app users $list = $chat1->getOnlineUserList($appids, $_REQUEST["userid"]); $total_message = $chat->getUnreadChatMessageCount($_REQUEST["userid"]); $json["status"] = 1; $json["statusInfo"] = "success"; $json["onlineUserList"] = $list; $json["total_unread_message"] = $total_message; $json["user_status"] = $chat->getUserSatus($_REQUEST["userid"]); } }