public function closeGroup() { $gid = isset($_POST['inboxid']) ? addslashes($_POST['inboxid']) : die("NO GID"); $g = new ChatGroup(); $g->getByID($gid); //check apa dia owner if ($g->inbox_from == Account::getMyID()) { //delete process //3 steps : 1 group, 2 chat, 3 member $json['bool'] = $g->delete($gid); $cm = new ChatMsg(); $cm->deleteMsgByGID($gid); $cg = new ChatMember(); $arrMember = $cg->getMemberFromGID($gid); $cg->deleteMemberByGID($gid); $g2 = new ChatGroup(); foreach ($arrMember as $mm) { if ($mm->admin_id != Account::getMyID()) { $g2->removeNotifPortalForAllMember($gid, $mm->admin_id); } } } else { $json['bool'] = 0; $json['err'] = Lang::t("Not Authorize"); } echo json_encode($json); die; }
/** * 得到聊天信息列表 * @param $uid * @param $os * @param $uid2 * @param $pagenum * @param pagesize */ function getChatList($uid, $ot = false, $uid2 = 0, $pagenum = 1, $pagesize = 10) { global $_MooClass; include_once '../module/chat/ChatMsg.class.php'; $cm = new ChatMsg($_MooClass['MooMySQL']); $data = $cm->getAllMsg($uid, $pagenum, $pagesize, $uid2, $ot); return $data; }