Пример #1
0
function service_chat_msg($uid)
{
    global $_MooClass, $dbTablePre, $user_arr, $userid, $serverid, $hzn;
    $chatorid = MooGetGPC('chatorid', 'integer', 'G');
    $screen = MooGetGPC('s', 'string', 'G');
    $chatfromid = MooGetGPC('chatfromid', 'integer');
    //note 屏蔽会员
    if ($screen) {
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}screen set uid='{$uid}',mid='{$chatorid}'");
        //MooMessage("屏蔽会员成功!", "index.php?n=myaccount&h=screen");
    }
    if (MOOPHP_ALLOW_FASTDB) {
        $chatorMsg = MooFastdbGet('members', 'uid', $chatorid);
    } else {
        $chatorMsg = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members where uid='{$chatorid}'");
    }
    //约束会员在址输入参数
    if ($chatorid == $uid) {
        //exit('自己不可与自己聊天<a href="index.php?n=service&h=history">查看聊天记录</a>');
        MooMessage('自己不可与自己聊天', 'index.php');
    } elseif (!$chatorMsg) {
        //exit('无此会员<a href="index.php?n=service&h=history">查看聊天记录</a>');
        if (!$_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}server where sid='{$chatorid}'")) {
            MooMessage('无此会员', 'index.php');
        }
    } elseif ($chatorMsg['gender'] == $user_arr['gender']) {
        MooMessage('不可与同性在线聊天', 'index.php');
    }
    //查找屏蔽会员表,查看是否允许对方邮件
    if ($sta = $_MooClass['MooMySQL']->getOne("select screenid from {$dbTablePre}screen where (uid='{$uid}' and mid='{$chatorid}') or (uid='{$chatorid}' and mid='{$uid}')")) {
        //exit('不可与此会员在线聊天,可能对方是被您屏蔽的会员,<a href="index.php?n=myaccount&h=screen">查看</a>');
        MooMessage('不可与此会员在线聊天,可能对方是被您屏蔽的会员', 'index.php?n=myaccount&h=screen');
    }
    //客服不能模拟聊天
    if ($hzn == "hongniangwang") {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    /*if($serverid){
      $chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where ((s_uid='$uid' and s_fromid='$chatorid') or (s_uid='$chatorid' and s_fromid='$uid')) and s_status=0");
      }else{*/
    $chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where s_uid='{$uid}' and s_fromid='{$chatorid}' and is_server!='{$uid}' and s_status=0");
    //$chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where ((s_uid='$uid' and s_fromid='$chatorid') or (s_uid='$chatorid' and s_fromid='$uid')) and is_server!='$uid' and s_status=0");
    //}
    //当双方消息为空时判断打开聊天窗口的会员的级别
    if (!$chatlog) {
        if (!$serverid) {
            ////判断是不是客服伪造登录
            //note 是否高级会员
            if (!get_userrank($uid)) {
                require MooTemplate('public/nochat_story', 'module');
                exit;
            }
        } else {
            Mooserverlog(4, $dbTablePre . "service_chat", "模拟用户在线聊天", $serverid);
        }
    }
    $usernickname = $user_arr;
    require MooTemplate('public/service_chat', 'module');
}
Пример #2
0
function service_chat_msg($uid)
{
    global $_MooCookie, $_MooClass, $dbTablePre, $user_arr, $serverid, $hzn;
    $chatorid = MooGetGPC('chatorid', 'integer', 'G');
    $screen = MooGetGPC('s', 'string', 'G');
    $chatfromid = MooGetGPC('chatfromid', 'integer');
    header("location:index.php?n=chat&h=inline_chat&fid={$uid}&tid={$chatorid}&sid={$serverid}&isjump=1");
    //note 屏蔽会员
    if ($screen) {
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}screen set uid='{$uid}',mid='{$chatorid}'");
        //MooMessage("屏蔽会员成功!", "index.php?n=myaccount&h=screen");
    }
    $chatorMsg = MooMembersData($chatorid);
    //约束会员在址输入参数
    if ($chatorid == $uid) {
        //exit('自己不可与自己聊天<a href="index.php?n=service&h=history">查看聊天记录</a>');
        MooMessage('自己不可与自己聊天', 'index.php');
    } elseif (!$chatorMsg) {
        //exit('无此会员<a href="index.php?n=service&h=history">查看聊天记录</a>');
        if (!$_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}server where sid='{$chatorid}'", true)) {
            MooMessage('无此会员', 'index.php');
        }
    } elseif ($chatorMsg['gender'] == $user_arr['gender']) {
        MooMessage('不可与同性在线聊天', 'index.php');
    }
    //查找屏蔽会员表,查看是否允许对方邮件
    if ($sta = $_MooClass['MooMySQL']->getOne("select screenid from {$dbTablePre}screen where (uid='{$uid}' and mid='{$chatorid}') or (uid='{$chatorid}' and mid='{$uid}')", true)) {
        //exit('不可与此会员在线聊天,可能对方是被您屏蔽的会员,<a href="index.php?n=myaccount&h=screen">查看</a>');
        MooMessage('不可与此会员在线聊天,可能对方是被您屏蔽的会员', 'index.php?n=myaccount&h=screen');
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'", true);
    $groupid = $result['groupid'];
    //系统管理员权限
    /* $GLOBALS['system_admin'] = array(60);
       if(in_array($groupid,$GLOBALS['system_admin'])){
           $serverid=null;
       } */
    //客服不能模拟聊天
    if ($serverid && $user_arr['usertype'] != 3) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'", true);
    $groupid = $result['groupid'];
    if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    /*if($serverid){
      $chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where ((s_uid='$uid' and s_fromid='$chatorid') or (s_uid='$chatorid' and s_fromid='$uid')) and s_status=0");
      }else{*/
    $chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where s_uid='{$uid}' and s_fromid='{$chatorid}' and is_server!='{$uid}' and s_status=0", 0, 0, 0, true);
    //$chatlog = $_MooClass['MooMySQL']->getAll("select s_id from {$dbTablePre}service_chat where ((s_uid='$uid' and s_fromid='$chatorid') or (s_uid='$chatorid' and s_fromid='$uid')) and is_server!='$uid' and s_status=0");
    //}
    //当双方消息为空时判断打开聊天窗口的会员的级别
    if (!$chatlog) {
        if (!$serverid) {
            ////判断是不是客服伪造登录
            //note 是否高级会员
            if (!get_userrank($uid)) {
                require MooTemplate('public/nochat_story', 'module');
                exit;
            }
        } else {
            Mooserverlog(4, $dbTablePre . "service_chat", "模拟用户在线聊天", $serverid);
        }
    }
    $usernickname = $user_arr;
    require MooTemplate('public/service_chat', 'module');
}