Beispiel #1
0
function getone()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $sendid = MooGetGPC('sendid', 'integer', 'G');
    //$sendid = '21691205';
    $user = MooMembersData($sendid);
    if ($user['uid'] != $sendid || $sendid == '') {
        $error = '查无此人';
        echo return_data($error, false);
        exit;
    }
    if (MooGetphoto($user['uid'], 'com')) {
        $mainimg = MooGetphoto($userid, 'com');
        $user['mainimg'] = $mainimg;
    }
    $user['password'] = '';
    $user['regip'] = '';
    $user['qq'] = '';
    $user['msn'] = '';
    $user['telphone'] = '';
    $user['username'] = '';
    //print_r($user);
    echo return_data($user, true);
    exit;
}
Beispiel #2
0
function ajax_sendRose()
{
    global $dbTablePre;
    $sendfromuid = MooGetGPC('sendfrom', 'string', 'P');
    $sendtouid = MooGetGPC('sendto', 'string', 'P');
    $sendtime = strtotime(MooGetGPC('sendtime', 'string', 'P'));
    $sendfrom = MooMembersData($sendfromuid);
    $sendto = MooMembersData($sendtouid);
    if ($sendfrom['usertype'] != 3) {
        exit('1');
    }
    if ($sendto['usertype'] == 3) {
        exit(3);
    }
    if (MooGetScreen($sendfromuid, $sendtouid)) {
        exit(0);
    }
    if ($sendfrom['gender'] == $sendto['gender']) {
        exit(10);
    }
    $is_first_send = true;
    $rose = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtouid}' AND senduid = '{$sendfromuid}' ORDER BY rid DESC LIMIT 1");
    if ($rose['rid']) {
        $is_first_send = false;
        $rid = $rose['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$sendfromuid}',receiveuid = '{$sendtouid}' ");
    }
    $gender = $sendfrom['gender'] == 1 ? '女' : '男';
    if ($is_first_send && $sendto['is_phone'] && $sendto['telphone']) {
        Push_message_intab($sendtouid, $sendto['telphone'], "鲜花", "真爱一生网 用户ID:" . $sendfromuid . "," . $gender . ",已给您发送鲜花, 请及时把握您的缘分!4008787920【真爱一生网】", $sendfromuid, $sendtime);
    }
}
Beispiel #3
0
function sendnewfl()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer', 'P');
    //
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $return = array();
    $is_first_send = true;
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        $error = "自己不可以给自己发过送鲜花";
        echo return_data($error, false);
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        //只能模拟全权会员
        $error = "对不起您不能模拟操作";
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        $error = "因特殊原因,送鲜花失败";
        echo return_data($error, false);
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        $error = "同性之间不可互发鲜花";
        echo return_data($error, false);
        exit;
        exit;
    }
    if ($user['rosenumber'] <= 0) {
        $error = '您没有鲜花了,获取更多鲜花';
        echo return_data($error, false);
        exit;
    }
    //
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    $res = MooMembersData($sendtoid);
    $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid));
    //头像路径
    $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
    //省
    $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板
    $body = ob_get_clean();
    if ($res['usertype'] != 3) {
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    //if(empty($uid)){
    //	MooMessage('您还没有登录','index.php?n=login');
    //}
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    //库中验证鲜花数
    //$rosenum_check =  $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1",true);
    //if($rosenum_check['rosenumber'] > 0) {
    if ($leer['rid']) {
        $is_first_send = false;
        $rid = $leer['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
    }
    //note 发送一朵玫瑰,自己就要减少一朵玫瑰
    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1", true);
        $value['rosenumber'] = $user_rosenum['rosenumber'];
        MooFastdbUpdate('members_base', 'uid', $userid, $value);
    }
    //}
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    $sendinfo = MooGetGPC('sendinfo', 'string', 'G');
    if (!empty($sendinfo)) {
        $sendinfo = ",对您说:" . $sendinfo;
    }
    if ($res['usertype'] != 3) {
        if ($serverid) {
            //客服模拟会员登录可以选择发送短信或彩信
            $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G');
            if ($SMStype == 'SMS' && $res['is_phone']) {
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            } elseif ($SMStype == 'CMS' && $res['is_phone']) {
                //====发送彩信   begin  ====
                //发送人有照片
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0";
                $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1";
                   $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/
                if ($sendfrom_user_info['uid']) {
                    $sendedMMSCount = $memcached->get('hznsimulate' . $serverid);
                    if (empty($sendedMMSCount)) {
                        $sendedMMSCount = 0;
                    }
                    //if($sendedMMSCount > 10){
                    //	MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose');
                    //}
                    send_mms_commission($res['telphone'], 'rose', $userid);
                    $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800);
                }
                //====发送彩信 end =====
            }
        } else {
            //真实会员登录
            if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) {
                //第一次发才短信提示
                // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo."     请及时把握您的缘分!4006780405");
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            }
        }
    }
    /*
    	$week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	//echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit;
    
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    		 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    		 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    		 if($cos[c] <= 1){
    			//fanglin暂时屏蔽
    			Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    		 }
    	}else{
    		  //echo $today_rose_count;exit;
    		  if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    			   $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    			   
               //print_r($cos);exit;
    			   if($cos[c]<5){
    				  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    				  //fanglin暂时屏蔽
    				  Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    			   }
    		}
    	}
    */
    /*
    	//发送彩信
    	$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
    	//$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'";
    	$sendout_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送人有照片
    	$sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1";
    	$sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
        
    	//echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit;
    	if($sendto_user_info['telphone']&&$sendout_user_info['uid']){
    		//echo 'ffff';exit;
    		if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){
    			$note="。";
    		}else{
    			$note="!";
    		}
    	}
    */
    /*普通会员对全权会员反馈白名单*/
    if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
        white_list($res['uid'], $user_arr['uid']);
    }
    /*客服模拟全权记录*/
    if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
        $action = '鲜花';
        fulllog($user_arr['uid'], $serverid, $action, $res);
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $return = "发送鲜花成功";
    echo return_data($return);
    exit;
    //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05");
    //require MooTemplate('public/service_rose_sendrose', 'module');
}
Beispiel #4
0
function sendcontact()
{
    global $_MooClass, $dbTablePre, $timestamp, $user, $user_arr, $hzn, $serverid, $memcached;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendid = MooGetGPC('sendid', 'integer', 'P');
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    //note 目前默认系统不审核
    $contact_sys_check = '0';
    //note 目前系统默认是委托真爱一生等待对方的回应
    $contact_stat = '1';
    $content = MooCutstr(safeFilter(MooGetGPC('content', 'string', 'P')), 200, '');
    //客服不可模拟操作
    /*if($hzn == "hongniangwang"){
          MooMessage('对不起您不能模拟操作','javascript:history.go(-1);','04');
          exit;
      }*/
    if ($serverid && $user_arr['usertype'] != 3) {
        // MooMessage('对不起您不能模拟操作','javascript:history.go(-1);','04');
        $error = '对不起您不能模拟操作';
        echo return_data($error, false);
        exit;
    }
    //自己不可委托真爱一生联系自己
    if ($sendid == $userid) {
        //MooMessage('自己不可委托真爱一生联系自己','javascript:history.go(-1);','02');
        $error = '自己不可委托真爱一生联系自己';
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendid)) {
        //MooMessage('因特殊原因,委托失败',"index.php?n=service&h=rose&t=getmorerose",'03');
        $error = '因特殊原因,委托失败';
        echo return_data($error, false);
        exit;
    }
    //$formsubmit1 = MooGetGPC('formsubmit1','string');
    //委托联系人表
    $checkuser = $_MooClass['MooMySQL']->getOne("SELECT mid,sendtime FROM {$dbTablePre}service_contact WHERE you_contact_other='{$sendid}' AND other_contact_you = '{$userid}' and receive_del=0 and send_del=0 and is_server=0");
    //查今天委托次数
    $checkuser2 = $user_arr;
    //note 委托也要做性别限制
    $user_s = array_merge(MooMembersData($sendid), MooGetData('members_login', 'uid', $sendid));
    //note 获得照片总数
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(imgid) as c FROM {$dbTablePre}pic WHERE uid = '{$user_s['uid']}'");
    $pic_total = $ret_count['c'];
    if ($checkuser2['gender'] == $user_s['gender']) {
        //MooMessage('同性之间不可委托真爱一生','javascript:history.go(-1);','02');
        $error = '同性之间不可委托真爱一生';
        echo return_data($error, false);
        exit;
    }
    //note 检查绑定是否过期
    if ($user_s['isbind'] == 1) {
        //note 如果被绑定,检测绑定是否到期
        $user_s['isbind'] = check_bind($user_s['bind_id']);
        if ($user_s['isbind'] == 1) {
            //MooMessage('不能向绑定中的会员发委托','javascript:history.go(-1);','02');
            $error = '不能向绑定中的会员发委托';
            echo return_data($error, false);
            exit;
        }
    }
    if ($user_s['showinformation'] != 1) {
        //MooMessage('发起委托失败,该会员已经关闭资料!','javascript:history.go(-1);','02');
        $error = '发起委托失败,该会员已经关闭资料!';
        echo return_data($error, false);
        exit;
    }
    //note 如果已经联系他就直接提示
    if ($checkuser['mid']) {
        //MooMessage("对不起,您已经委托真爱一生联系TA了",'javascript:history.go(-1);','02');
        $error = '对不起,您已经委托真爱一生联系TA了';
        echo return_data($error, false);
        exit;
    }
    //note 如果是今天超过3次就直接提示
    $mtime = date("Ymd");
    $contact_time_Ymd = date("Ymd", $checkuser2['contact_time']);
    if ($contact_time_Ymd == $mtime && $checkuser2['contact_num'] >= 3) {
        //MooMessage("今天委托真爱一生已经超过3次",'javascript:history.go(-1);','02');
        $error = '今天委托真爱一生已经超过3次';
        echo return_data($error, false);
        exit;
    }
    //提交时
    if ($content && $sendid) {
        if (!$checkuser['mid']) {
            //发送短信和邮件
            include_once "./module/crontab/crontab_config.php";
            $res = MooMembersData($sendid);
            if (MOOPHP_ALLOW_FASTDB) {
                $send_user_info = MooMembersData($userid);
                $send_user_info = array_merge($send_user_info, MooFastdbGet('members_choice', 'uid', $userid));
            } else {
                $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,a.* from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '{$userid}'");
                $send_user_info = $send_user_info['0'];
            }
            //头像路径
            $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
            if (file_exists($path)) {
                $img_path = $path;
            } else {
                if ($send_user_info['gender'] == 1) {
                    $img_path = "/public/images/service_nopic_woman.gif";
                } else {
                    $img_path = "/public/images/service_nopic_man.gif";
                }
            }
            $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
            //发送者用户名
            $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
            //发送者性别
            $province = $provice_list[$send_user_info['province']];
            //省
            $city = $city_list[$send_user_info['city']];
            //市
            $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
            //身高
            ob_start();
            //require_once MooTemplate('public/mail_space_commissiontpl', 'module'); //模板
            $body = ob_get_clean();
            MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendid);
            /*发送短信提醒   begin
                          $week_time = 24*3600*7;//一周时间秒数
                          $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
                          $date1 = date("Y-m-d",strtotime("last Monday"));
                          $date2 = date("Y-m-d",strtotime("Sunday"));
                          
                          if($interval_time > $week_time){//不活跃用户每周发一条短信
                               $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                               $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
                              if($cos['c'] <= 1){
                                  //fanglin暂时屏蔽
                                  Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']);
                              }
                          }else{
                               //每天该用户超过5条信息不发送短信
                             $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendid' and sendtime='".date("Y-m-d")."'");
                             if($cos['c']<5){
                                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                                //fanglin暂时屏蔽
                                Push_message_intab($sendid,$res['telphone'],"委托","真爱一生网 用户ID:".$send_user_info['uid'].",".$send_user_grade.",已委托真爱一生联系您,请及时把握您的缘分!4006780405",$send_user_info['uid']);
                             }
                          }
            		end */
            //note 今天提交委托真爱一生,表中的委托计数还是昨天的就 update为0
            if ($contact_time_Ymd != $mtime) {
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = 0,contact_time = '{$timestamp}' WHERE uid = '{$userid}'");
                if (MOOPHP_ALLOW_FASTDB) {
                    $value = array();
                    $value['contact_num'] = 0;
                    $value['contact_time'] = $timestamp;
                    MooFastdbUpdate('members_base', 'uid', $userid, $value);
                }
            }
            //note 如果今天提交委托真爱一生次数超过3次不能再发起委托,否则更新次数
            $today_contact_num = $_MooClass['MooMySQL']->getOne("SELECT contact_num FROM {$dbTablePre}members_base WHERE uid = '{$userid}'", true);
            //$today_contact_num = $checkuser2;
            $today_contact_num = $today_contact_num['contact_num'];
            //今天委托的次数
            //if($user_arr['uid']=='20796965') $today_contact_num=0;
            // if($today_contact_num < 3) {
            //优质会员列表
            $update_sql = '';
            if (empty($user_arr['sid']) && $user_arr['usertype'] == 1) {
                $update_sql = ',is_well_user=1';
            }
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET contact_num = contact_num + 1,contact_time = '{$timestamp}' {$update_sql}  WHERE uid = '{$userid}'");
            if (MOOPHP_ALLOW_FASTDB) {
                $oldarr = MooFastdbGet('members_base', 'uid', $userid);
                $value = array();
                $value['contact_num'] = $oldarr['contact_num'] + 1;
                $value['contact_time'] = $timestamp;
                if ($update_sql != '') {
                    $value['is_well_user'] = 1;
                }
                MooFastdbUpdate('members_base', 'uid', $userid, $value);
            }
            //note 记录委托真爱一生的内容
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_contact SET content = '{$content}',other_contact_you = '{$userid}',you_contact_other='{$sendid}',stat = '{$contact_stat}',syscheck='{$contact_sys_check}',sendtime = '{$timestamp}'");
            //将新注册的会员更新为优质会员
            if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
                update_iswell_user($user_arr['uid']);
            }
            //if($user_arr['uid']=='20796965'){
            //====发送委托彩信   begin  ====
            //发送人有照片
            $sendout_user_info = MooMembersData($userid);
            if (!($sendout_user_info['mainimg'] != '' && $sendout_user_info['images_ischeck'] == 1 && $sendout_user_info['pic_num'] > 0)) {
                $sendout_user_info['uid'] = false;
            }
            //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
            //echo $sendid."<br />".$userid;
            $sendto_user_info = MooMembersData($sendid);
            if (!($sendto_user_info['is_phone'] == 1 && $sendto_user_info['telphone'] != '' && $sendto_user_info['usertype'] == 1)) {
                $sendto_user_info['telphone'] = false;
            }
            //print_r($sendout_user_info);
            //exit;$sendout_user_info['telphone']
            if ($sendto_user_info['telphone'] && $sendout_user_info['uid']) {
                //SendMsg('18911883821',"真爱一生网 用户ID:".$user_arr['uid'].",".$gender.",已给委托真爱一生 委托您,请及时把握您的缘分!4006780405");
                send_mms_commission($sendto_user_info['telphone'], 'contact', $sendout_user_info['uid']);
            }
            //====发送委托彩信 end =====
            //}
            //*********提醒所属客服**********
            $sid = $user_arr['sid'];
            $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendid . ' 发送了委托';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            /*普通会员对全权会员反馈白名单*/
            if ($user_s['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($user_s['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $user_s['usertype'] != 3) {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $user_s);
            }
            //MooMessage("委托成功",'index.php?n=service','05');
            $error = '委托成功';
            echo return_data($error, true);
            exit;
            //} else {
            //MooMessage("今天委托真爱一生已经 超过3次",'javascript:history.go(-1);','02');
            //     $error = '今天委托真爱一生已经 超过3次';
            //	echo return_data($error,false);exit;
            // }
        } else {
            //MooMessage("对不起,您已经委托真爱一生联系TA了",'javascript:history.go(-1);','02');
            $error = '对不起,您已经委托真爱一生联系TA了';
            echo return_data($error, false);
            exit;
        }
    }
    //是否有手机号码
    if (MOOPHP_ALLOW_FASTDB) {
        $status = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $status = $_MooClass['MooMySQL']->getOne("SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'", true);
    }
    if (!$status['telphone']) {
        //MooMessage("对不起,您没有通过手机验证,请先通过验证再委托",'index.php?n=myaccount&h=telphone','02');
        $error = '对不起,您没有通过手机验证';
        echo return_data($error, false);
        exit;
    } else {
        $tel = $status['telphone'];
    }
    //require MooTemplate('public/service_contact_sendcontact', 'module');
}
Beispiel #5
0
<?php

include "module/andriod/function.php";
global $_MooClass, $dbTablePre, $userid, $memcached, $user_arr;
$status = array();
$uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
if ($uid) {
    $userid = $mem_uid = $memcached->get('uid_' . $uid);
}
$user_arr = MooMembersData($userid);
$and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
$checkuuid = check_uuid($and_uuid, $userid);
if (!$checkuuid) {
    $error = "uuid_error";
    echo return_data($error, false);
    exit;
}
//登录会员信息
if ($userid) {
    $sql = "select s.uid, s.birthyear, s.height, s.marriage, s.education, s.city, s.salary, s.certification, b.mainimg from {$dbTablePre}members_search s\n     left join {$dbTablePre}members_base b on b.uid = s.uid where s.uid = {$userid}";
    $user = $_MooClass['MooMySQL']->getOne($sql);
    $all_len = 0;
    if ($userid) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    echo $all_len;
    exit;
    $user['all_len'] = $all_len;
    $user['cer'] = get_integrity($user['certification']);
    echo return_data($user);
    exit;
        echo $v;
        ?>
"><?php 
        echo $v;
        ?>
号  <?php 
        echo $server_arr[$v];
        ?>
</option>
		<?php 
    }
    ?>
	</select>
	<span class="desc">升级时间:</span>
	<input type="text" name="startdate" id="startdate" value="<?php 
    echo Date('Y-m-d H:i:s', MooMembersData($uid, 'bgtime')) ? Date('Y-m-d H:i:s') : Date('Y-m-d H:i:s', MooMembersData($uid, 'bgtime'));
    ?>
" class="WdateFmtErr" maxlength="30" /> 到
	<input type="text" name="enddate" id="enddate" onFocus="WdatePicker({startDate:'%y-%M-%D 00:00:00',dateFmt:'yyyy-MM-dd',alwaysUseStartDate:true})"  style="width:100px;"/>
	牵线模式: <select name="mode" id="mode">
		<option value="0">未选择</option>
		<?php 
    foreach ((array) $modes as $k => $v) {
        ?>
		<option value='<?php 
        echo $k;
        ?>
'><?php 
        echo $v;
        ?>
</option>
Beispiel #7
0
function to_send_message()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $timestamp, $serverid;
    //print_r($_POST);
    //note s_cid 发送者的权限(回复时才有)
    $s_cid = MooGetGPC('s_cid', 'integer', 'P');
    //echo $s_cid;exit;
    //收件人id
    $sid = MooGetGPC('s_id', 'integer', 'P');
    //发件人id
    $mid = MooGetGPC('m_id', 'integer', 'P');
    ///echo $sid;exit;
    $s_title = MooGetGPC('s_title', 'string', 'P');
    $s_title = rtrim($s_title);
    //对主题字数限制
    $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = ''));
    $s_content = MooGetGPC('s_content', 'string', 'P');
    //note 特殊字符
    $s_content = rtrim(MooStrReplace(safeFilter($s_content)));
    $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P');
    $message_back = MooGetGPC('message_back', 'integer', 'P');
    //note 双方屏蔽不给操作
    if (MooGetScreen($mid, $sid)) {
        MooMessage('因特殊原因,消息发送失败', "index.php?n=service&h=rose&t=getmorerose", '01');
        exit;
    }
    if ($mid && $sid && $s_title && $s_content) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level == 2 && $user_arr['usertype'] != 3) {
            //普通会员需要审核(除采集会员之外)
            //if($user_arr['gender'] == 0){	//如果是男方发的,需要审核,0表示
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')");
        } else {
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')");
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        $res = MooMembersData($sid);
        //	   $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '$userid'");
        $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid));
        //	   $send_user_info = $send_user_info[0];
        //头像路径
        $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
        //省
        $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
        //市
        $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
        //身高
        ob_start();
        require_once MooTemplate('public/mail_space_messagetpl', 'module');
        //模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid);
        $week_time = 24 * 3600 * 7;
        //一周时间秒数
        $interval_time = $timestamp - $user_arr['last_login_time'];
        //当前时间-最后登录时间
        $date1 = date("Y-m-d", strtotime("last Monday"));
        $date2 = date("Y-m-d", strtotime("Sunday"));
        if ($interval_time > $week_time) {
            //不活跃用户每周发一条短信
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true);
            if ($cos['c'] <= 1) {
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], "邮件", "用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc查看!4008787920【真爱一生网】", $userid);
            }
        } else {
            //活跃用户每天一条
            //每天该用户超过5条信息不发送短信
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true);
            if ($cos['c'] < 5) {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], '邮件', "用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc!4008787920【真爱一生网】", $userid);
            }
        }
        //note 发送资料给接收方
        if ($send_mymessage) {
        }
        //note 备份邮件操作
        if ($message_back) {
            //note 发送MAIL时所需信息
            $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'");
            //note 发送MAIL时收信人的邮箱
            $ToAddress = $user['username'];
            //note 发送MAIL时主题
            $ToSubject = '提示:您在真爱一生网所发的消息备份';
            //note 发送MAIL时Body内容所需信息
            $username = $user['nickname'];
            //note 发送MAIL时Body内容所需信息
            $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'");
            if ($username) {
                $ToBody = $username;
            } else {
                $ToBody = 'ID号为' . $mid . '的会员<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>';
            } else {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>';
            }
            if ($username) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                MooMessage('发送成功,真爱一生审核后对方即可以收到。', 'index.php?n=service&h=message&t=sendmessage', '05');
            } else {
                MooMessage('发送成功', 'index.php?n=service&h=message&t=sendmessage', '05');
            }
        } else {
            MooMessage('发送失败', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '03');
        }
    } else {
        MooMessage('数据填写不完整', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '02');
    }
}
Beispiel #8
0
function space_viewpro()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr, $val_arr, $style_user_arr, $diamond, $_MooCookie, $memcached;
    //$val_arr统计资料完善度
    //	$uid = $GLOBALS ['style_uid'];
    $uid = $_GET['other_uid'];
    $is_only_show = true;
    $status = array();
    //验证是否合法成功登陆
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $userid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($userid) {
        $userid = $mem_uid = $memcached->get('uid_' . $userid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $user_oth = MooMembersData($uid);
    //note 判断被浏览的会员是否存在
    $status = array_merge(MooMembersData($uid), MooGetData('members_login', 'uid', $uid));
    $user_per_num = getUserinfo_per($user_arr);
    $error = array();
    //*****************白名单*******************
    if ($uid != $userid) {
        $is_only_show = false;
    }
    //*****************白名单*******************
    if (empty($is_only_show)) {
        //if(MOOPHP_ALLOW_FASTDB && $status['is_lock'] != 1){//is_lock默认1不封锁用户,0则封锁
        if ($status['is_lock'] != 1) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
        }
        if (!$status) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
            //note 判断被浏览的用户是否允许其他会员查看他的资料
        } elseif (!$status['showinformation'] && $status['uid'] != $userid) {
            //showinformation默认1允许其他会员查看,0则不允许
            switch ($status['showinformation_val']) {
                //showinformation_val用户关闭资料的理由
                case 1:
                    $error = "此会员已找到正在交往的对象,故资料未公开";
                    echo return_data($error, FALSE);
                    exit;
                    break;
                case 2:
                    $error = "此会员已找到真爱,即将踏上红地毯,故资料未公开,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
                case 3:
                    $error = "此会员最近很忙,无法及时回复邮件,故资料未公开,转向我的真爱一生";
                    break;
                case 4:
                    $error = "此会员资料未公开,原因可能是TA已经找到真爱了,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
            }
        }
    }
    //note 浏览资料页面时候,写入谁浏览谁表,自己浏览自己的除外
    if ($userid && $uid && $userid != $uid) {
        //note 不让屏蔽的会员查看
        if (MooGetScreen($userid, $uid)) {
            $error = "由于特殊原因对方资料未公开,转向我的真爱一生";
            echo return_data($error, false);
            exit;
        }
        if ($user_oth['gender'] != $user_arr['gender']) {
            //service_visitor 某某会员浏览某某会员记录表
            $visitor = $_MooClass['MooMySQL']->getOne("SELECT vid FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND visitorid = '{$uid}'");
            //note 再次浏览的,更新浏览时间
            if ($visitor['vid']) {
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_visitor SET visitortime = '{$timestamp}' WHERE uid='{$userid}' AND visitorid = '{$uid}' limit 1");
            } else {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_visitor SET uid = '{$userid}',visitorid='{$uid}',visitortime = '{$timestamp}'");
            }
            if (MooUserIsOnline($uid)) {
                $browser = $_MooClass['MooMySQL']->getOne("SELECT id FROM {$dbTablePre}service_browser WHERE uid = '{$userid}' AND browserid = '{$uid}'");
                //note 再次浏览的,更新浏览时间
                if ($browser['id']) {
                    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_browser SET browsertime = '{$timestamp}' WHERE uid='{$userid}' AND browserid = '{$uid}' limit 1");
                } else {
                    $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_browser SET uid = '{$userid}',browserid='{$uid}',browsertime = '{$timestamp}'");
                }
            }
        }
    }
    //note 查看会员资料信息
    $c = MooGetData('members_choice', 'uid', $uid) + MooGetData('members_introduce', 'uid', $uid);
    $user =& $status;
    /***创建浏览队列 ***/
    if ($userid && $uid && $userid != $uid) {
        if ($user_oth['gender'] != $user_arr['gender'] && $user['uid'] != $userid) {
            if ($user['usertype'] == 3 && $user_arr['usertype'] != 3 && $user['showinformation'] == 1 && $user_arr['s_cid'] >= 40) {
                $iscan = $GLOBALS['fastdb']->get($userid . '_scan_space');
                //浏览的全权会员列表
                $iscan = empty($iscan) ? array() : json_decode($iscan, true);
                $iscan = in_array($uid, $iscan) ? $iscan : array_push($iscan, $uid);
                $GLOBALS['fastdb']->set($userid . '_scan_space', json_encode($iscan));
            }
            if ($user['usertype'] != 3) {
                $scan_i = $GLOBALS['fastdb']->get('scan_space_' . $uid);
                //访问的记录列表
                $scan_i = empty($scan_i) ? array() : json_decode($scan_i, true);
                if (!empty($scan_i)) {
                    $scan_s = array();
                    foreach ($scan_i as $k => $scan) {
                        $scan_s[$k] = $scan[0];
                    }
                    if (in_array($userid, $scan_s)) {
                        $scan_i[array_search($userid, $scan_s)] = array($userid, time());
                    } else {
                        array_push($scan_i, array($userid, time()));
                    }
                } else {
                    array_push($scan_i, array($userid, time()));
                }
                $GLOBALS['fastdb']->set('scan_space_' . $uid, json_encode($scan_i));
            }
        }
    }
    //note_显示相册中的普通照片
    $user_pic = $_MooClass['MooMySQL']->getAll("SELECT imgurl,pic_date,pic_name FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$uid}'");
    $user['pic'] = $user_pic;
    $gender = $user_arr['gender'] == '0' ? '1' : '0';
    //0为男,1为女
    $agebegin = date("Y") - $user_arr['birthyear'] - 3;
    $ageend = date("Y") - $user_arr['birthyear'] + 3;
    $workprovince = $user_arr['province'];
    $workcity = $user_arr['city'];
    $search_url = MOOPHP_URL . "/index.php?n=search&h=quick&gender=" . $gender . "&age_start=" . $agebegin . "&age_end=" . $ageend . "&workprovince=" . $workprovince . "&workcity=" . $workcity . "&isphoto=1&imageField=&quick_search=搜索";
    //note 您可能喜欢的人,匹配相同地区
    $able_like = $userid ? youAbleLike(5) : array();
    //note 获取会员认证证件
    //note 当查看其他个人主页时,当前浏览的主页条件是否匹配
    $user2 = false;
    if ($uid != "" && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $c2 = MooGetData('members_choice', 'uid', $userid);
        $user2 = MooMembersData($userid);
    }
    //note 获得用户资料的完整度,以百分比显示makui
    $all_len = 0;
    if ($uid == $user_arr['uid']) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    $user['all_len'] = $all_len;
    //note 匹配指数分数得出
    $mark = 0;
    if ($uid && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $cho = MooGetData('members_choice', 'uid', $user_arr['uid']);
        $year = isset($cho['birthyear']) ? $cho['birthyear'] : $user_arr['birthyear'];
        if ($year - 5 <= $user['birthyear'] && $user['birthyear'] <= $year + 5) {
            $mark_age = 9;
            $mark += 9;
        } else {
            $mark_age = 6;
            $mark += 6;
        }
        if ($cho['height1'] <= $user['height'] && $user['height'] <= $cho['height2']) {
            $mark_height = 7;
            $mark += 7;
        } else {
            $mark_height = 5;
            $mark += 5;
        }
        if ($cho['weight1'] <= $user['weight'] && $user['weight'] <= $cho['weight2']) {
            $mark_weight = 5;
            $mark += 5;
        } else {
            $mark_weight = 3;
            $mark += 3;
        }
        if ($cho['workprovince'] == $user['province']) {
            $mark_workprovince = 8;
            $mark += 8;
        } else {
            $mark_workprovince = 6;
            $mark += 6;
        }
        if ($cho['workcity'] == $user['city']) {
            $mark_workcity = 16;
            $mark += 16;
        } else {
            $mark_workcity = 5;
            $mark += 10;
        }
        if ($cho['education'] == $user['education']) {
            $mark_education = 8;
            $mark += 8;
        } else {
            $mark_education = 5;
            $mark += 5;
        }
        if ($cho['salary'] == $user['salary']) {
            $mark_salary = 9;
            $mark += 9;
        } else {
            $mark_salary = 7;
            $mark += 7;
        }
        if ($cho['marriage'] == $user['marriage']) {
            $mark_marriage = 8;
            $mark += 8;
        } else {
            $mark_marriage = 5;
            $mark += 5;
        }
        if ($cho['children'] == $user['children']) {
            $mark_children = 8;
            $mark += 8;
        } else {
            $mark_children = 6;
            $mark += 6;
        }
        if ($cho['drinking'] == $user['drinking']) {
            $mark_drinking = 5;
            $mark += 5;
        } else {
            $mark_drinking = 3;
            $mark += 3;
        }
        if ($cho['smoking'] == $user['smoking']) {
            $mark_smoking = 5;
            $mark += 5;
        } else {
            $mark_smoking = 2;
            $mark += 2;
        }
        if ($cho['body'] == $user['body']) {
            $mark_body = 6;
            $mark += 12;
        } else {
            $mark_body = 4;
            $mark += 8;
        }
    }
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    //note 检查绑定是否过期
    if ($user['isbind'] == 1) {
        $user['isbind'] = check_bind($user['bind_id']);
    }
    $activity = $_MooClass['MooMySQL']->getOne("SELECT uid,username,regtime,channel FROM {$dbTablePre}ahtv_reguser where  uid='{$uid}' and  isattend=1");
    //鲜花发送语
    if ($user_arr['gender'] == 0) {
        //boy
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=2 and isShow=1";
    } else {
        //girl
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
    }
    $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
    $users = array();
    $mainimg = MooGetphoto($status['uid'], $style = "com");
    $status['mainimg'] = $mainimg;
    $users['material'] = $status;
    $users['mating'] = $c;
    //资料完整度
    $users['inte'] = $user_per_num * 100;
    $users['inte'] = round($users['inte']);
    $users['material']['password'] = '';
    $users['material']['regip'] = '';
    $users['material']['qq'] = '';
    $users['material']['msn'] = '';
    $users['material']['telphone'] = '';
    $users['material']['username'] = '';
    if (empty($error)) {
        echo return_data($users);
        exit;
    } else {
        echo return_data($error, false);
        exit;
    }
}
Beispiel #9
0
function simulateSend()
{
    global $userid, $_MooClass, $timestamp;
    $user = array_merge(MooGetData('members_login', 'uid', $userid), MooMembersData($userid));
    //ob_clean();
    $json = array();
    //=======================模拟发送秋波,关注,鲜花===========================
    //男女匹配
    if ($user['gender'] == 1) {
        // 年龄段分析
        $start_year = $user['birthyear'] - 2;
        $end_year = $user['birthyear'] + 10;
        $index = 'members_man';
        $gender = 0;
    } else {
        // 年龄段分析
        $start_year = $user['birthyear'] - 10;
        $end_year = $user['birthyear'] + 2;
        $index = 'members_women';
        $gender = 1;
    }
    //在sphinx中搜索
    $sp = searchApi($index);
    //满足省市
    $sp->getResultOfReset(array(array("is_lock", 1), array("images_ischeck", 1), array("province", $user['province']), array("city", $user['city']), array("gender", $gender), array("usertype", 3), array("birthyear", array($start_year, $end_year))), array("offset" => 0, "limit" => 20));
    $member_list = $sp->getIds();
    $member_key = array_rand($member_list, rand(1, 5));
    $member_list_ = array();
    foreach ($member_key as $v) {
        $member_list_[] = $member_list[$v];
    }
    $last_login_time = $user['last_login_time'] ? $user['last_login_time'] : $timestamp;
    $opaction = array('1' => '礼物', '2' => '秋波', '3' => '关注');
    $_uidlist_ = '';
    $_result_ = array();
    $_uidlist_ = implode(',', $member_list_);
    if ($_uidlist_) {
        $_result_ = $_MooClass['MooMySQL']->getAll("SELECT screenid FROM web_screen WHERE mid='{$userid}' and uid in ({$_uidlist_})");
    }
    if (count($_result_) > 0) {
        exit;
    }
    foreach ($member_list_ as $senduid) {
        $key = array_rand($opaction, 1);
        $sendtime = $last_login_time - rand(1000, 259200);
        $json[$senduid] = $key . ',' . $opaction[$key];
        if ($key == '1') {
            //$rosenum_check =  $_MooClass['MooMySQL']->getOne("SELECT rosenumber FROM web_members_base  WHERE `uid`='{$userid}'  LIMIT 1",true);
            //if($rosenum_check['rosenumber'] > 0) {
            $rose = $_MooClass['MooMySQL']->getOne("SELECT rid FROM web_service_rose WHERE receiveuid = '{$userid}' AND senduid = '{$senduid}' ORDER BY rid DESC LIMIT 1");
            if (isset($rose['rid'])) {
                $rid = $rose['rid'];
                //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
                $_MooClass['MooMySQL']->query("UPDATE web_service_rose SET  receivenum = receivenum + 1,sendtime = '{$sendtime}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
            } else {
                //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
                $_MooClass['MooMySQL']->query("INSERT INTO web_service_rose SET receivenum = 1, sendtime = '{$sendtime}',receivetime='{$timestamp}',senduid  = '{$senduid}',receiveuid = '{$userid}' ");
            }
            //note 发送一朵玫瑰,自己就要减少一朵玫瑰
            //$_MooClass['MooMySQL']->query("UPDATE web_members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$userid}'");
            //if(MOOPHP_ALLOW_FASTDB){
            //	$user_rosenum =  $_MooClass['MooMySQL']->getOne("SELECT rosenumber FROM web_members_base  WHERE `uid`='{$userid}'  LIMIT 1",true);
            //	$value['rosenumber']= $user_rosenum['rosenumber'];
            //	MooFastdbUpdate('members_base','uid',$userid,$value);
            //}
            //}
        } elseif ($key == '2') {
            $leer = $_MooClass['MooMySQL']->getOne("SELECT lid FROM web_service_leer WHERE receiveuid = '{$userid}' AND senduid = '{$senduid}' ", true);
            if (isset($leer['lid'])) {
                //已经发送过秋波
                $lid = $leer['lid'];
                //增加发送秋波的次数
                $_MooClass['MooMySQL']->query("UPDATE web_service_leer SET receivenum = receivenum + 1,`stat`='0',sendtime = '{$sendtime}',receivetime = '{$timestamp}',receive_del =0,is_read=0 WHERE lid = '{$lid}'");
            } else {
                //note 发送新的秋波,写入数据库 发送者,接受者,发送时间
                $_MooClass['MooMySQL']->query("INSERT INTO web_service_leer SET sendtime = '{$sendtime}',receivetime = '{$timestamp}',receivenum = '1', num = '1', senduid  = '{$senduid}',receiveuid = '{$userid}'");
            }
        } elseif ($key == '3') {
            //note 加为意中人,新插入一行记录
            $friend = $_MooClass['MooMySQL']->getOne("SELECT fid FROM web_service_friend WHERE friendid = '{$userid}' AND  uid= '{$senduid}' ", true);
            if (isset($friend['fid'])) {
                $fid = $friend['fid'];
                $_MooClass['MooMySQL']->query("update web_service_friend SET friendid  = '{$userid}',uid = '{$senduid}',sendtime='{$sendtime}' where fid='{$fid}'");
            } else {
                $_MooClass['MooMySQL']->query("Insert INTO web_service_friend SET friendid  = '{$userid}',uid = '{$senduid}',sendtime='{$sendtime}'");
            }
        }
    }
    //$json=array('30000027'=>'2,秋波','30000007'=>'1,鲜花','30000008'=>'3,关注');
    echo json_encode($json);
    exit;
}
Beispiel #10
0
function service_request_sms()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $hzn, $serverid, $timestamp;
    $userid = $user_arr['uid'];
    if (empty($userid)) {
        header("Location:login.html");
    }
    $member_level = get_userrank($userid);
    if ($member_level != 1) {
        MooMessage('您不是钻石或高级会员,不能请求查看身份证信息,快升级为钻石或高级会员吧', 'index.php?n=payment&h=diamond');
    }
    $sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='{$userid}'";
    $certification = $_MooClass['MooMySQL']->getOne($sql, true);
    if ($certification['sms'] != 1) {
        MooMessage('您未进行身份通认证,请先进行身份通认证', 'index.php?n=myaccount&h=smsindex');
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $send_user = leer_send_user1($sendtoid);
    //$send_user_gender = $send_user['gender'] == 1 ? "女" : "男"; //发送者性别
    $send_user_gender = $user_arr['gender'] == 1 ? "女" : "男";
    //发送者性别
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    if ($sendtoid == $userid) {
        MooMessage('自己不可以请求查看自己的信息', 'javascript:history.go(-1);');
        exit;
    }
    if ($send_user['gender'] == $user_arr['gender']) {
        MooMessage('同性之间不可以请求查看', 'javascript:history.go(-1);');
        exit;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //$sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='$userid'";
    $time = time();
    $sql = "SELECT id FROM {$dbTablePre}members_requestsms WHERE uid='{$sendtoid}' AND ruid='{$userid}'";
    if ($_MooClass['MooMySQL']->getOne($sql, true)) {
        $sql = "UPDATE {$dbTablePre}members_requestsms SET request_total=request_total+1 WHERE uid='{$sendtoid}' AND ruid='{$userid}'";
        $_MooClass['MooMySQL']->query($sql);
    } else {
        $sql = "INSERT INTO {$dbTablePre}members_requestsms SET uid='{$sendtoid}',ruid='{$userid}',dateline='{$time}'";
        $_MooClass['MooMySQL']->query($sql);
    }
    //***********提醒所属客服************
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 索取身份';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $members = MooMembersData($sendtoid);
    //fanglin暂时屏蔽
    Push_message_intab($sendtoid, $members['telphone'], "索取身份", "真爱一生网www.zhenaiyisheng.cc用户ID:" . $userid . "," . $send_user_gender . ",请求查看您的身份证信息,请速回复哦!4006780405", $userid);
    require MooTemplate('public/service_requestsms', 'module');
}
Beispiel #11
0
function register_stepfive()
{
    global $_MooClass, $dbTablePre, $uid, $user_arr;
    $userinfo = MooMembersData($uid);
    if (MooSubmit('register_submitfive')) {
        $search_base5 = getMemberfield();
        $members_search5 = isset($search_base5["search"]) ? $search_base5["search"] : array();
        $members_base5 = isset($search_base5["base"]) ? $search_base5["base"] : array();
        $where_arr = array('uid' => $uid);
        if (!empty($members_search5)) {
            updatetable('members_search', $members_search5, $where_arr);
            if (MOOPHP_ALLOW_FASTDB) {
                MooFastdbUpdate('members_search', 'uid', $uid, $members_search5);
            }
        }
        if (!empty($members_base5)) {
            updatetable('members_base', $members_base5, $where_arr);
            if (MOOPHP_ALLOW_FASTDB) {
                MooFastdbUpdate('members_base', 'uid', $uid, $members_base5);
            }
        }
        MooMessage("您已经完成了您的资料填写,请尽快进入我的帐户完成您的认证!", "index.php?n=service");
    }
    include MooTemplate('public/register_stepfive', 'module');
}
Beispiel #12
0
/**
 * 会员交接表
 */
function ajax_join()
{
    $id = MooGetGPC('id', 'integer');
    $uid = MooGetGPC('uid', 'integer');
    // first get method
    $sid = MooGetGPC('sid', 'integer');
    // first get method
    $action = MooGetGPC('act', 'string');
    $db = $GLOBALS['_MooClass']['MooMySQL'];
    $dbpre = $GLOBALS['dbTablePre'];
    $bgtime = MooMembersData($uid, 'bgtime');
    // 提交升级时间
    $allotdate = MooMembersData($uid, 'allotdate');
    // 分配时间
    if (empty($bgtime)) {
        $bgtime = time();
    }
    $bgtime = date('Y-m-d H:i:s', $bgtime);
    if (!empty($allotdate)) {
        $allotdate = date('Y-m-d H:i:s', $allotdate);
    } else {
        $allotdate = '';
    }
    $modes = array(1 => '全权', 2 => '全权1+1', 3 => '炫服务', 4 => '信息刺激', 5 => '本站牵线');
    $periods = array(1 => '一个月', 2 => '三个月', 3 => '五个月', 4 => '六个月');
    if ($action == 'query') {
        $join = $db->getOne("select * from {$dbpre}admin_join where id={$id}");
        if (!empty($join)) {
            $join['bgtime'] = date('Y-m-d H:i:s', $join['bgtime']);
            $join['allottime'] = date('Y-m-d H:i:s', $join['allottime']);
            $arr_convert = array('uid' => 'localid', 'gid' => 'manageid', 'sid' => 'kefuid', 'fid' => 'joinid', 'mid' => 'delegateid', 'bgtime' => 'uptime', 'isfake' => 'hasfake', 'istalk' => 'hastalk', 'isnegative' => 'hasnegative');
            $keys = array_keys($join);
            $key = 0;
            foreach ($join as $k => $v) {
                if (isset($arr_convert[$k])) {
                    $keys[$key] = $arr_convert[$k];
                }
                ++$key;
            }
            $join = array_combine($keys, $join);
            echo json_encode($join);
        } else {
            echo '"fail"';
        }
        exit;
    } elseif ($action == 'delete') {
        $db->query("delete from {$dbpre}admin_join where id={$id}");
        if (isset($_GET['from'])) {
            exit('ok');
        }
        // come from financial_joinstatistics
    }
    if (!empty($_POST)) {
        // post
        //if ($id === 0) { $id = 'null'; }
        $uid = MooGetGPC('localid', 'integer', 'P');
        $sid = MooGetGPC('kefuid', 'integer', 'P');
        $gid = MooGetGPC('manageid', 'integer', 'P');
        $fid = MooGetGPC('joinid', 'string', 'P');
        $mid = MooGetGPC('delegateid', 'string', 'P');
        $telephone = MooMembersData($uid, 'telphone');
        $money = (double) MooGetGPC('money', 'string', 'P');
        $bgtime = MooGetGPC('uptime', 'string', 'P');
        $allottime = MooGetGPC('allottime', 'string', 'P');
        $period = MooGetGPC('period', 'integer', 'P');
        $mode = MooGetGPC('mode', 'integer', 'P');
        $isfake = MooGetGPC('hasfake', 'integer', 'P');
        $istalk = MooGetGPC('hastalk', 'integer', 'P');
        $isnegative = MooGetGPC('hasnegative', 'integer', 'P');
        $maininfo = MooGetGPC('maininfo', 'string', 'P');
        $simulateinfo = MooGetGPC('simulateinfo', 'string', 'P');
        $lastinfo = MooGetGPC('lastinfo', 'string', 'P');
        $remark = MooGetGPC('remark', 'string', 'P');
        $time = time();
        $bgtime = strtotime($bgtime);
        $allottime = strtotime($allottime);
        $db->query("replace into {$dbpre}admin_join values({$id}, {$uid}, {$gid}, {$sid}, {$money}, {$period}, {$bgtime}, {$allottime}, {$mode}, {$isfake}, {$istalk}, '{$telephone}', '{$fid}', '{$mid}', '{$maininfo}', '{$simulateinfo}', '{$lastinfo}', '{$remark}', {$isnegative}, {$time})");
    } elseif (empty($action)) {
        $manage_list = $db->getAll("select id, manage_name, manage_list from {$dbpre}admin_manage where type=1 order by manage_name");
        $server_list = $db->getAll("select uid, username from {$dbpre}admin_user");
        foreach ($server_list as $v) {
            $server_arr[$v['uid']] = $v['username'];
        }
        $manageids = '{';
        $founded = false;
        $current_group_kefu_list = array();
        foreach ($manage_list as $v) {
            $single_manage_arr = explode(',', $v['manage_list']);
            $manageids .= $v['id'] . ':{';
            foreach ($single_manage_arr as $v2) {
                if (empty($v2)) {
                    $v2 = 0;
                }
                $manageids .= $v2 . ':"' . $server_arr[$v2] . '",';
            }
            $manageids = substr($manageids, 0, -1) . '},';
            if (!$founded && in_array($sid, $single_manage_arr)) {
                $founded = true;
                $manageid = $v['id'];
                $current_group_kefu_list = $single_manage_arr;
            }
        }
        $manageids = substr($manageids, 0, -1) . '}';
    }
    $join_list = $db->getAll("select * from {$dbpre}admin_join where uid={$uid}");
    include adminTemplate('allmember_join');
}
Beispiel #13
0
function sendnewleer()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'");
    //$pic_total = $_MooClass['MooMySQL']->numRows($query);
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        MooMessage('自己不可以给自己发过送秋波', 'javascript:history.go(-1);', '04');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,送秋波失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('同性之间不可互发秋波', 'javascript:history.go(-1);', '02');
        exit;
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    if (empty($uid)) {
        MooMessage('您还没有登录', 'index.php?n=login');
    }
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ", true);
    if ($leer['lid']) {
        $lid = $leer['lid'];
        //note 如果已经发送过秋波,就增加发送秋波的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET num = num + 1,receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime = '{$timestamp}',receive_del = '0' WHERE lid = '{$lid}'");
        //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '0' WHERE senduid = '{$sendtoid}' AND receiveuid = '{$uid}' AND stat = '2'");
    } else {
        //note 发送新的秋波,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_leer SET sendtime = '{$timestamp}',receivetime = '{$timestamp}',receivenum = '1', num = '1', senduid  = '{$uid}',receiveuid = '{$sendtoid}'");
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    /*if(MOOPHP_ALLOW_FASTDB){
    		$res = MooFastdbGet('members','uid',$sendtoid);
    	}else{
    	   $res= $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members where uid='$sendtoid'");
       }*/
    $res = MooMembersData($sendtoid);
    $send_user_info = $_MooClass['MooMySQL']->getOne("select b.*,c.*,a.* from `{$dbTablePre}members_search` a  left join {$dbTablePre}members_base c on a.uid=c.uid left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '{$uid}' LIMIT 1");
    //头像路径
    $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name]);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = isset($provice_list[$send_user_info[province]]) ? $provice_list[$send_user_info[province]] : '';
    //省
    $city = isset($city_list[$send_user_info[city]]) ? $city_list[$send_user_info[city]] : '';
    //市
    $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_leertpl', 'module'); //秋波模板
    require_once MooTemplate('public/mail_space_leertpl', 'module');
    //秋波模板
    $body = ob_get_clean();
    MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce);
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_leer_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_leer_count = isset($leer['lid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_leer_date) {
        $today_leer_count = 1;
    }
    //include "./module/{$name}/function.php";
    if ($res['is_phone']) {
        SendMsg($res['telphone'], "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送秋波,请及时把握您的缘分!4006780405");
    }
    //SendMsg($res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
    /*
        $week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    			$_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    	   		$cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    	    	if($cos['c']<=1){
    				//fanglin暂时屏蔽
    			  Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
    		   }
    	}else{ //活跃用户每天一条
    		 if($send_leer_date==date("Y-m-d") && $today_leer_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    	       $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    		   if($cos[c]<5){
    		   	  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    			  //fanglin暂时屏蔽
    			  Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
    		   }
    	   }    
    	}*/
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了秋波';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $users =& $res;
    require MooTemplate('public/service_leer_sendnewleer', 'module');
}
Beispiel #14
0
/**
 * 登录表单处理
 * 描述:
 */
function login_submit()
{
    global $_MooClass, $dbTablePre, $_MooCookie, $uuid, $memcached;
    $error = array();
    //noet 对提交的数据过滤
    if ($_POST) {
        $username = trim($_POST['username']);
        //		$username = "******";
        $md5_password = md5($_POST['password']);
        //		$md5_password = md5(123456);
        $cookietime = intval(isset($_POST['cookietime']) ? $_POST['cookietime'] : '');
        $remember_username = MooGetGPC('remember', 'integer', 'P');
    }
    /*****设置回转的页面*****/
    if (empty($_POST['username']) && empty($_POST['password'])) {
        //note 转至邮箱验证页
        $error = "用户名和密码为空";
        echo return_data($error, false);
        exit;
    }
    //note 用户名不能为空
    if (empty($_POST['username'])) {
        //note 转至邮箱验证页
        $error = "用户名为空";
        echo return_data($error, false);
        exit;
    }
    //note 密码不能为空
    if (empty($_POST['password'])) {
        //note 转至邮箱验证页
        $error = "密码为空";
        echo return_data($error, false);
        exit;
    }
    if (empty($error)) {
        $userid = 0;
        $sp = searchApi('members_man members_women');
        $limit = array(0, 1);
        //note 验证用户名,密码     enky
        if (is_numeric($username)) {
            if (strlen($username) == 11) {
                //判断手机号是否存在
                $filter = array();
                $filter[] = array('telphone', $username);
                if ($sp->getResultOfReset($filter, $limit)) {
                    $ids = $sp->getIds();
                    if (isset($ids[0])) {
                        $userid = $ids[0];
                    }
                }
            }
            if (!$userid) {
                //判断uid是否存在
                $filter = array();
                $filter[] = array('@id', $username);
                if ($sp->getResultOfReset($filter, $limit)) {
                    $ids = $sp->getIds();
                    if (isset($ids[0])) {
                        $userid = $ids[0];
                    }
                }
            }
            if (!$userid) {
                if ($user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_base` where qq='{$username}'", true)) {
                    $userid = $user_one['uid'];
                }
            }
        } else {
            $filter = array();
            $filter[] = array('username', $username);
            if ($sp->getResultOfReset($filter, $limit)) {
                $ids = $sp->getIds();
                if (isset($ids[0])) {
                    $userid = $ids[0];
                }
            }
        }
        //note 用户名找不到
        if (!$userid) {
            $login_where = is_numeric($username) ? "uid='{$username}' or telphone='{$username}'" : "username='******'";
            $user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_search` where {$login_where}", true);
            if ($user_one) {
                $userid = $user_one['uid'];
            } else {
                $error = "用户名不存在";
                echo return_data($error, false);
                exit;
            }
        }
        //获取
        $user = array_merge(MooGetData('members_login', 'uid', $userid), MooMembersData($userid));
        if ($user['is_lock'] != '1') {
            $error = "用户已经被锁定";
            echo return_data($error, false);
            exit;
        }
        //note 用户密码错误
        if ($user['uid'] && $user['password'] != $md5_password) {
            //note 转至邮箱验证页
            $error = "密码错误";
            echo return_data($error, FALSE);
            exit;
        }
        if (empty($error)) {
            //note 验证通过
            if ($user['uid'] && $user['password'] == $md5_password) {
                //生成随机唯一id,andriod用
                $userid = $user['uid'];
                $uuid = user_md5_id($user['uid']);
                $memcached->set('uuid_' . $userid, $uuid, 0, 0);
                $memcached->set('uid_' . $userid, $userid, 0, 0);
                $user['uuid'] = $uuid;
                if ($user['automatic'] == 1) {
                    MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400 * 7);
                } else {
                    MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400);
                }
                $user_sha = $_MooClass['MooMySQL']->getOne("SELECT lastvisit from `{$dbTablePre}members_login` where uid='{$userid}'");
                $s_time = $user_sha['lastvisit'];
                $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(uid) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2 and visitortime > '{$s_time}' ");
                $shadow_numb = $ret_count['c'] ? $ret_count['c'] : 0;
                // MooSetCookie('auth','SDFSFGAFGD\AHFGHGHJ',86400);
                $time = time();
                $_MooClass['MooMySQL']->query("update {$dbTablePre}members_login set last_login_time = '{$time}',login_meb = login_meb+1,lastvisit='{$time}' where uid = '{$user['uid']}'");
                //更新最后登录时间
                //会员最后登录时间
                MooSetCookie('last_login_time', $time, 86400);
                //note 客服提醒
                if ($user['is_awoke'] == '1') {
                    $awoketime = time() + 120;
                    $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$user['sid']}',title='会员上线',content='ID:{$user['uid']}会员刚刚通过pc机上线,请联系',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'";
                    $_MooClass['MooMySQL']->query($sql);
                }
                MooPlugins('ipdata');
                $online_ip = GetIP();
                if ($online_ip != $user['lastip']) {
                    $user_address = convertIp($online_ip);
                    include "./module/crontab/crontab_config.php";
                    foreach ($provice_list as $key => $provice_arr) {
                        if (strstr($user_address, $provice_arr) !== false) {
                            //if(){
                            $province = $key;
                            break;
                        }
                    }
                    if (empty($province)) {
                        $province = $current_user['province'];
                    }
                    //得到市对应的城市代号
                    foreach ($city_list as $city_key => $city_val) {
                        if (strstr($user_address, $city_val) !== false) {
                            $city = $city_key;
                            break;
                        }
                    }
                }
                MooSetCookie('province', $user['province'], 86400);
                MooSetCookie('city', $user['city'], 86400);
                $lastactive = time();
                $uid = $user['uid'];
                //note 更新用户的最近登录ip和最近登录时间
                $updatesqlarr = array('lastip' => $online_ip);
                $wheresqlarr = array('uid' => $uid);
                updatetable("members_login", $updatesqlarr, $wheresqlarr);
                if (MOOPHP_ALLOW_FASTDB) {
                    $val = array();
                    $val['lastip'] = $online_ip;
                    //$val['client']=0;
                    $val['last_login_time'] = $time;
                    $val['lastvisit'] = $time;
                    //$val['isOnline']=1;
                    MooFastdbUpdate('members_login', 'uid', $uid, $val);
                    //!!
                }
                //记录本次登录ip及上次的ip,及真实的最后访问时间
                $sql_ip = "SELECT last_ip,finally_ip FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'";
                $member_admin_info = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql_ip);
                if (!empty($member_admin_info)) {
                    $sql_ip = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET last_ip='{$member_admin_info['finally_ip']}',finally_ip='{$online_ip}',real_lastvisit='{$lastactive}' WHERE uid='{$uid}'";
                } else {
                    $sql_ip = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo SET finally_ip='{$online_ip}',uid='{$uid}',real_lastvisit='{$lastactive}'";
                }
                $GLOBALS['_MooClass']['MooMySQL']->query($sql_ip);
            }
        }
    }
    //资料完善度
    $all_len = 0;
    $user_arr = MooMembersData($uid);
    if ($uid) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    $user['all_len'] = $all_len;
    $user['choice'] = MooGetData('members_choice', 'uid', $uid);
    if (MooGetphoto($user['uid'], 'com')) {
        $mainimg = MooGetphoto($user['uid'], 'com');
    }
    $user_sha = $_MooClass['MooMySQL']->getOne("SELECT telphone from `{$dbTablePre}certification` where uid='{$userid}'");
    if (empty($error)) {
        $user['telphonesha'] = isset($user_sha['telphone']) ? $user_sha['telphone'] : 0;
        $user['mainimg'] = $mainimg;
        $user['password'] = '';
        $user['regip'] = '';
        $user['qq'] = '';
        $user['msn'] = '';
        $user['telphone'] = '';
        $user['username'] = '';
        $user['numofvis'] = $shadow_numb;
        $ret_count1 = $_MooClass['MooMySQL']->getOne("SELECT count(s_uid) as c FROM {$dbTablePre}services WHERE s_uid = '{$userid}' and flag = '1' and s_uid_del='0' and s_status = '0' ", true);
        $total1 = $ret_count1['c'];
        //2009-11-22日修改(得到总数)
        $user['nummail'] = $total1;
        echo return_data($user, true);
        exit;
        //            echo "<pre>$return</pre>";exit;
    } else {
        $error = "用户名或密码错误";
        echo return_data($error, false);
        exit;
    }
}
Beispiel #15
0
/**
 *  usersid : -1 无限
 *          :0   0客服
 */
function check_photo()
{
    global $_MooCookie, $dbTablePre, $allow_order, $rsort;
    //$sid=$GLOBALS['adminid'];
    //$pass = MooGetGPC('pass','integer','R');
    $type = MooGetGPC('type', 'string', 'R') == '' ? 'list' : MooGetGPC('type', 'string', 'R');
    //$usersid=MooGetGPC('usersid','string','R');
    $lei = "会员形象照审核";
    $uid = MooGetGPC('uid', 'integer', 'R');
    $id = MooGetGPC('id', 'integer', 'R');
    $myservice_idlist = get_myservice_idlist();
    $checkArr = array(1 => '审核通过', 2 => '未审核');
    switch ($type) {
        case 'list':
            //note 获得当前url
            $pass = MooGetGPC('pass', 'integer', 'R');
            //是否审核
            $pass = $pass ? $pass : 2;
            //分页
            $page = get_page();
            $prepage = 20;
            $start = ($page - 1) * $prepage;
            $sql_where = $sql_and = '';
            $condition[] = " WHERE s.images_ischeck={$pass}";
            //返回的会员ID
            $usersid = MooGetGPC('usersid', 'string', 'R');
            if ($usersid === null) {
                $usersid = -1;
            } else {
                $usersid = intval($usersid);
            }
            //echo $_MooCookie['usersid'].'and'.$usersid;
            if (isset($_MooCookie['usersid']) && $_MooCookie['usersid'] != $usersid || MooGetGPC('submit', 'string', 'P')) {
                //刷新了会员
                $start = 0;
            }
            //==各组权限==
            if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) {
                //本客服
                $condition[] = " s.sid ={$GLOBALS['adminid']}";
            } elseif ($myservice_idlist == 'all') {
                //all为客服主管能查看所有的
                if ($usersid >= 0) {
                    $condition[] = " s.sid='{$usersid}'";
                }
                $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user", 0, 0, 0, true);
            } else {
                $condition[] = " s.sid IN({$myservice_idlist})";
                if ($usersid >= 0) {
                    $condition[] = " s.sid='{$usersid}'";
                }
                $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user  where uid in ({$myservice_idlist}) ", 0, 0, 0, true);
            }
            $currenturl = "index.php?action=check&h=photo&pass={$pass}";
            $currenturl = preg_replace("/(&page=\\d+)/", "", $currenturl);
            $currenturl2 = preg_replace("/(&pass=\\d+)/", "", $currenturl) . "&pass={$pass}";
            //如果按照uid查看,客服是不限的
            if (!empty($uid)) {
                $condition[] = " s.uid='{$uid}'";
                $usersid = -1;
            }
            if ($usersid >= 0) {
                $currenturl2 = $currenturl = $currenturl2 . "&usersid={$usersid}";
            }
            $sql_where = implode(' AND', $condition);
            MooSetCookie('usersid', $usersid);
            //写当前所属客服COOKIE
            //排序
            $query_builder = get_query_builder($sql_where, $allow_order, '', '', 'pic_date', 'asc', $rsort);
            $sort_arr = $query_builder['sort_arr'];
            $rsort_arr = $query_builder['rsort_arr'];
            $sql_sort = $query_builder['sort'];
            $order = MooGetGPC('order', 'string', 'R');
            $method = MooGetGPC('method', 'string', 'R');
            if (!empty($order) && !empty($method)) {
                $sql_sort = "order by {$order} {$method} ";
                $currenturl2 .= "&order={$order}&method={$method}";
            }
            $sql = "SELECT count(1) as c FROM {$GLOBALS['dbTablePre']}members_search as s left join {$GLOBALS['dbTablePre']}members_base b on s.uid=b.uid {$sql_where}";
            $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
            $total = $total_count['c'];
            $sql = "SELECT `mainimg`,`lastvisit`,`allotdate`,`sid`,s.uid,s.uid as id,`images_ischeck` AS syscheck,`nickname`,`birthyear`,`gender` FROM {$GLOBALS['dbTablePre']}members_search as s left join {$GLOBALS['dbTablePre']}members_base as b on s.uid=b.uid left join {$GLOBALS['dbTablePre']}members_login as l on l.uid=b.uid  {$sql_where} {$sql_sort} LIMIT {$start},{$prepage}";
            //`lastvisit`,
            $list = array();
            $list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true);
            //获取形象照的上传日期
            foreach ($list as $key => $val) {
                $uidpic = $val['uid'];
                $sql = "select pic_date from web_pic where uid='{$uidpic}'";
                $resultpic = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                if (!empty($resultpic)) {
                    $picdate = date('Y-m-d', strtotime($resultpic['pic_date']));
                    $list[$key]['pic_date'] = $picdate;
                } else {
                    $list[$key]['pic_date'] = null;
                }
            }
            $currenturl = $currenturl2;
            require adminTemplate("check_list");
            break;
        case 'show':
            header("Cache-Control: no-cache, must-revalidate");
            // HTTP/1.1
            header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
            // 过去的时间
            $bili = "4:5";
            $photo = MooMembersData($uid);
            //var_dump($photo);echo '<br/>';
            $mainimg_preg = preg_replace("(\\.)", "_nowater.", $photo['mainimg']);
            //var_dump($mainimg_preg);
            $photo_src = $mainimg_preg;
            $photo_arr = explode('.', $photo_src);
            $count = count($photo_arr);
            $num = MooGetGPC('num', 'integer', 'G');
            if (isset($_GET['num'])) {
                if (file_exists('../' . $mainimg_preg)) {
                    $src = $photo_arr[0] . '.' . ($num + 1) % 4 . '.' . $photo_arr[$count - 1];
                } else {
                    $src = preg_replace("(_nowater)", '.' . ($num + 1) % 4, $mainimg_preg);
                }
                if (file_exists('../' . $src)) {
                    $photo['mainimg'] = $src;
                } else {
                }
            } else {
                $src = $mainimg_preg;
                if (file_exists('../' . $src)) {
                    $photo['mainimg'] = $src;
                }
            }
            //==========页面返回url=====取值================================
            $usersid = MooGetGPC('usersid', 'string', 'R');
            if ($usersid === null) {
                $usersid = -1;
            } else {
                $usersid = intval($usersid);
            }
            MooSetCookie('usersid', null);
            //作为标志位
            $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $url = preg_replace("/www./", "", $url);
            $url2 = $url;
            $url = preg_replace("/show/", "list", $url);
            $url = preg_replace("/&uid=\\d+/", "", $url);
            $url = preg_replace("/&usersid=\\d+/", "", $url);
            $url .= "&usersid={$usersid}";
            serverlog(1, $dbTablePre . "members_search", "{$GLOBALS['username']}查询{$uid}会员印象照", $GLOBALS['adminid'], $uid);
            require adminTemplate("check_show");
            break;
        case 'submit':
            $is_pass = MooGetGPC('pass', 'string', 'P');
            $is_onpass = MooGetGPC('nopass', 'string', 'P');
            if ($is_onpass) {
                global $_MooClass, $dbTablePre;
                MooAutoLoad('MooFiles', 'libraries');
                if ($uid == '') {
                    salert('没用传入参数', 'index.php?action=check&h=list', 1);
                }
                $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}members_search SET  `images_ischeck`='0' WHERE `uid`='{$uid}'");
                searchApi('members_man members_women')->updateAttr(array('images_ischeck'), array($uid => array(2)));
                $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}members_base SET `mainimg` = '',`pic_date` = '',`pic_name` = '' WHERE `uid`='{$uid}'");
                //更新索引数据的属性值
                if (MOOPHP_ALLOW_FASTDB) {
                    $value_b['mainimg'] = '';
                    $value_b['pic_date'] = '';
                    $value_s['images_ischeck'] = '2';
                    MooFastdbUpdate("members_search", 'uid', $uid, $value_s);
                    MooFastdbUpdate("members_base", 'uid', $uid, $value_b);
                }
                serverlog(2, $dbTablePre . "members_search", "{$GLOBALS['username']}未通过会员{$uid}的形象照" . $id, $GLOBALS['adminid'], $uid);
                if (MooGetGPC("userphoto", 'integer')) {
                    sendusermessage($uid, "您的形象照不符合图片要求,已被红娘删除,请您重新上传", "形象照审核");
                    //salert('成功设置形象照未通过');
                    $alert = '形象照未通过';
                }
                $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
                //http://7651.com/ework/index.php?action=check&h=photo&type=submit&id=21291982&uid=21291982
                // $url=preg_replace("/www./", "", $url);
                //$url=preg_replace("/submit/", "list", $url);
                //$url=preg_replace("/&uid=\d+/", "", $url);
                $usersid = MooGetGPC('usersid', 'string', 'R');
                if ($usersid < 0 || $usersid == null) {
                    $usersid = 0;
                    $sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=2  limit 1";
                    //`lastvisit`,
                } else {
                    $usersid = intval($usersid);
                    $sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=2 and sid={$usersid}  limit 1";
                    //`lastvisit`,
                }
                /*    $usersid=MooGetGPC('usersid','string','R');
                				if($usersid<0 || $usersid==null){ 
                					$usersid=-1;
                					$sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=0  limit 1";//`lastvisit`,
                				}else{
                					$usersid=intval($usersid);
                					$sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=0 and sid={$usersid}  limit 1";//`lastvisit`,
                				}
                			*/
                $list = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
                if (!empty($list)) {
                    $url = preg_replace("/submit/", "show", $url);
                    $url = preg_replace("/&uid=\\d+/", "", $url);
                    $url = $url . "&uid={$list['uid']}&ispass=0";
                } else {
                    $url = preg_replace("/submit/", "list", $url);
                    $url = preg_replace("/&uid=\\d+/", "", $url);
                }
                salert($alert, $url);
                break;
            } elseif ($is_pass) {
                $userphoto = MooGetGPC('userphoto', 'string', 'P');
                //$incoduce=MooGetGPC('incoduce','string','P');
                //$contentincoduce=MooGetGPC('contentincoduce','string','P');
                if ($userphoto) {
                    //保存形象照
                    savePhoto($uid);
                    $filename = MooGetGPC('photoimage');
                    if (file_exists($filename)) {
                        $file_arr = explode('.', $filename);
                        $num = count($file_arr) - 2;
                        if (strlen($file_arr[$num]) == 1) {
                            $_MooClass['MooFiles']->fileDelete($filename);
                        }
                    }
                }
                //更新诚信值
                reset_integrity($uid);
                $alert = '审核成功';
                //note 审核通过后,写入前台搜索表
                //                fastsearch_update($uid,1); //note 写入常用搜索表
                //                fastsearch_update($uid,2); //note 写入高级搜索表
                $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
                //http://7651.com/ework/index.php?action=check&h=photo&type=submit&id=21291982&uid=21291982
                $url = preg_replace("/www./", "", $url);
                $usersid = MooGetGPC('usersid', 'string', 'R');
                if ($usersid < 0 || $usersid == null) {
                    $usersid = 0;
                    $sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=2  limit 1";
                    //`lastvisit`,
                } else {
                    $usersid = intval($usersid);
                    $sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=2 and sid={$usersid}  limit 1";
                    //`lastvisit`,
                }
                /*    $usersid=MooGetGPC('usersid','string','R');
                				if($usersid<0 || $usersid==null){ 
                					$usersid=-1;
                					$sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=0  limit 1";//`lastvisit`,
                				}else{
                					$usersid=intval($usersid);
                					$sql = "SELECT `uid` FROM {$GLOBALS['dbTablePre']}members_search where images_ischeck=0 and sid={$usersid}  limit 1";//`lastvisit`,
                				}
                			*/
                $list = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
                if (!empty($list)) {
                    $url = preg_replace("/submit/", "show", $url);
                    $url = preg_replace("/&uid=\\d+/", "", $url);
                    $url = $url . "&uid={$list['uid']}&ispass=0";
                } else {
                    $url = preg_replace("/submit/", "list", $url);
                    $url = preg_replace("/&uid=\\d+/", "", $url);
                }
                salert($alert, $url);
                break;
            }
    }
}
Beispiel #16
0
function material_upinfo_submit()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    //checkAuthMod('index.php?n=material');//客服模拟登录操作没有修改权限
    $validation = MooAutoLoad('MooValidation');
    $uid = $userid;
    //$user_rank_id=get_userrank($userid);
    //var_dump($user_rank_id);
    //$update1_arr = $update2_arr = $update3_arr = array();
    //note members表字段
    $members_search = array();
    $members_base = array();
    $members_choice = array();
    $members_introduce = array();
    $birthyear = MooGetGPC('year', 'string', 'P');
    $members_search['birthyear'] = $birthyear;
    $birthmonth = MooGetGPC('month', 'string', 'P');
    $birthday = MooGetGPC('days', 'string', 'P');
    $members_search['updatetime'] = time();
    $members_search['nickname'] = safeFilter(MoogetGPC('nickname', 'string', 'P'));
    $members_search['telphone'] = MoogetGPC('telphone', 'string', 'P');
    $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P');
    $members_search['height'] = MoogetGPC('height', 'integer', 'P');
    $members_search['salary'] = MoogetGPC('salary', 'integer', 'P');
    $members_search['education'] = MoogetGPC('education1', 'integer', 'P');
    $members_search['children'] = MoogetGPC('children1', 'integer', 'P');
    $members_search['house'] = MoogetGPC('house', 'integer', 'P');
    $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P');
    $members_search['province'] = MoogetGPC('province', 'integer', 'P');
    $members_search['city'] = MoogetGPC('city', 'integer', 'P');
    if (in_array($members_search['province'], array(10101201, 10101002))) {
        //note 修正广东省深圳和广州的区域查询 2010-09-04
        $members_search['city'] = $members_search['province'];
        $members_search['province'] = 10101000;
    }
    //note choice表字段
    $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true);
    if ($gender['gender'] == 0) {
        $members_choice['gender'] = 1;
    } else {
        $members_choice['gender'] = 0;
    }
    //$update2_arr['sex'] = MoogetGpc('sex','integer','p');
    $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P');
    $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P');
    $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P');
    $members_choice['workcity'] = MoogetGPC('workCity', 'integer', 'P');
    if (in_array($members_choice['workprovince'], array(10101201, 10101002))) {
        //note 修正广东省深圳和广州的区域查询 2010-09-04
        $members_choice['workcity'] = $members_choice['workprovince'];
        $members_choice['workprovince'] = 10101000;
    }
    $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P');
    $members_choice['education'] = MoogetGPC('education2', 'integer', 'P');
    $members_choice['children'] = MoogetGPC('children2', 'integer', 'P');
    $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P');
    $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P');
    $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P');
    $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P');
    $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P');
    $members_choice['body'] = MoogetGPC('body2', 'integer', 'P');
    $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P');
    $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P');
    $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P');
    $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P');
    $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P');
    $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P');
    if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) {
        //note 修正广东省深圳和广州的区域查询 2010-09-04
        $members_choice['hometowncity'] = $members_choice['hometownProvince'];
        $members_choice['hometownprovince'] = 10101000;
    }
    $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P');
    $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P');
    $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P');
    $members_introduce['introduce_check'] = safeFilter(trim(MoogetGPC('introduce', 'string', 'P')));
    $rs = $user_arr;
    //note 验证状态
    if (MOOPHP_ALLOW_FASTDB) {
        $sta = MooFastdbGet('certification', 'uid', $uid);
    } else {
        $sta = $_MooClass['MooMySQL']->getOne("select telphone from {$dbTablePre}certification WHERE uid='{$uid}'", true);
    }
    $where_arr = array('uid' => $uid);
    foreach ($members_search as $key => $val) {
        //无手机号吗
        if ($key == 'telphone' && $val == '') {
            continue;
        }
        $memberssearch[$key] = $val;
    }
    //	foreach ($members_base as $key=>$val){
    //		$membersbase[$key]=$val;
    //	}
    if (count($members_base) >= 1 || count($memberssearch) >= 1) {
        $members_search['updatetime'] = time();
        if (!rtrim($members_search['nickname'])) {
            $error = "昵称必填";
            echo return_data($error, false);
            exit;
        }
        if (preg_match('/^(1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*)$/', $members_search['nickname'])) {
            //MooMessage("昵称不符合规范!", "javascript:history.go(-1)");
            $error = "昵称不符合规范!";
            echo return_data($error, false);
            exit;
        }
        //echo 'sss';exit;
        str_length($members_search['nickname']);
        //note 昵称截取
        $members_search['nickname'] = MooCutstr($members_search['nickname'], 18, $dot = '');
        if ($members_search['telphone'] && !preg_match('/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/', $members_search['telphone'])) {
            //MooMessage('请输入正确的手机号码','javascript:history.go(-1)');
            $error = "请输入正确的手机号码";
            echo return_data($error, false);
            exit;
        }
        //$birth=strtotime("$birthyear/$birthmonth/$birthday");
        $birth = "{$birthyear}-{$birthmonth}-{$birthday}";
        $members_base['birth'] = $birth;
        updatetable('members_base', $members_base, $where_arr);
        updatetable('members_search', $memberssearch, $where_arr);
        if (MOOPHP_ALLOW_FASTDB) {
            MooFastdbUpdate('members_base', 'uid', $uid, $members_base);
            MooFastdbUpdate('members_search', 'uid', $uid, $memberssearch);
        }
        //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_search));
    }
    //提交会员动态makui
    UpdateMembersSNS($uid, '修改了资料');
    //内心独白必填
    //if(rtrim($update2_arr['introduce_check'] != '')){
    $members_introduce['introduce'] = '';
    $members_introduce['introduce_pass'] = '******';
    //if(isset($members_choice)){
    $members_choice['updatetime'] = time();
    updatetable('members_choice', $members_choice, $where_arr);
    //}
    updatetable('members_introduce', $members_introduce, $where_arr);
    if (MOOPHP_ALLOW_FASTDB) {
        $members_choice['uid'] = $uid;
        $members_introduce['uid'] = $uid;
        //print_r($update2_arr);exit;
        if (isset($members_choice)) {
            $members_choice['updatetime'] = time();
            MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice);
        }
        MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce);
    }
    //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_choice));
    if (MOOPHP_ALLOW_FASTDB) {
        $userchoice = MooFastdbGet('members_choice', 'uid', $uid);
        $introduce = MooFastdbGet('members_introduce', 'uid', $uid);
        $userchoice = array_merge($userchoice, $introduce);
    } else {
        $userchoice = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_choice mc left join {$dbTablePre}members_introduce mi WHERE mc.uid=mi.uid AND uid = '{$uid}'", true);
    }
    //}else{
    //	MooMessage("内心独白必填!", "index.php?n=material&h=upinfo");
    //}
    /*
    //低质量会员自动分配
    if($user_rank_id == 0){
    	//以下信息都没选,都规为垃圾会员,自动分配给普通客服
    	if($update1_arr['height']=='-1' || $update1_arr['salary']=='-1' || $update1_arr['children']=='-1' || $update1_arr['oldsex']=='-1' || $update2_arr['age1']=='-1' || $update2_arr['age2']=='-1' || $update2_arr['marriage'] == '-1' || $update2_arr['children'] == '-1' || $update2_arr['body'] == '-1'){
    		invalid_user_allotserver($uid);
    	}
    }
    */
    if ($rs['telphone'] == $members_search['telphone'] || $sta['telphone'] == '' || $members_search['telphone'] == '') {
        $error = "修改成功";
        echo return_data($error, true);
        exit;
    } else {
        //重新手机认证
        $sql = "update {$dbTablePre}certification  set telphone='' where uid='{$uid}'";
        $_MooClass['MooMySQL']->query($sql);
        $certif_arr['telphone'] = '';
        MooFastdbUpdate('certification', 'uid', $uid, $certif_arr);
        if (MOOPHP_ALLOW_FASTDB) {
            if (MOOPHP_ALLOW_FASTDB) {
                $certification_1 = MooFastdbGet('certification', 'uid', $userid);
            } else {
                $certification_1 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification  WHERE uid = '{$userid}'", true);
            }
        }
        //Message("您的手机信息有变动请再次通过我们的验证",'index.php?n=myaccount&h=telphone');
        $error = "您的手机信息有变动请再次通过我们的验证";
        echo return_data($error, true);
        exit;
    }
    //note 快速常用搜索表更新
    //fastsearch_update($userid,'1');
    //note 快速高级搜索表更新
    //fastsearch_update($userid,'2');
}
Beispiel #17
0
    ?>
</span></span>
            <span>全权会员ID: <span><?php 
    echo $v['fid'];
    ?>
</span></span>
            <span>手机号: <span><?php 
    echo MooMembersData($uid, 'telphone');
    ?>
</span></span>
            <span>升级时间: <span><?php 
    echo date('Y-m-d H:i:s', $v['bgtime']);
    ?>
</span></span>
            <span>分配时间: <span><?php 
    echo date('Y-m-d H:i:s', MooMembersData($uid, 'allotdate'));
    ?>
</span></span>	
        </p>
        <p>
            <span><span><?php 
    echo $v['isfake'] == 1 ? '有' : '没有';
    ?>
</span> 网站模拟行为</span>
            <span><span><?php 
    echo $v['istalk'] == 1 ? '已经' : '没有';
    ?>
</span> 和VIP(全权会员)交流过</span>
            <span><span><?php 
    echo $v['isnegative'] == 1 ? '有' : '没有';
    ?>
Beispiel #18
0
function to_send_message()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $uuid = $memcached->get('uuid_' . $userid);
    //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid);
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $contentid = MooGetGPC('s_id', 'integer', 'P');
    //不可给同性别发送消息
    $receive_info = MooMembersData($contentid);
    $receive_gender = $receive_info['gender'];
    if ($user_arr['gender'] == $receive_gender) {
        $err = "不可给同性别发送消息";
        echo return_data($err, false);
        exit;
    }
    //系统管理员权限
    /*$result=$_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
      $groupid=$result['groupid'];
      
      //$GLOBALS['system_admin'] = array(60);
      if(in_array($groupid,$GLOBALS['system_admin'])){
          $serverid=null;
      }*/
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    if ($serverid && $user_arr['usertype'] != 3) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    //如果是本站注册会员
    if ($user_arr['usertype'] == 1) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level != 1) {
            //不是高级会员
            if (!checkIsMobileCertical($userid)) {
                //没有通过了手机验证
                $err = "您还没有进行手机验证,请先认证";
                echo return_data($err, false);
                exit;
            } else {
                //if(!checkIsOver($userid)){ //过了试用期
                $err = "只有钻石或高级会员才可以发送电子邮件给对方";
                echo return_data($err, false);
                exit;
                //}
            }
        }
    }
    //print_r($_POST);
    //note s_cid 发送者的权限(回复时才有)
    $s_cid = MooGetGPC('s_cid', 'integer', 'P');
    //echo $s_cid;exit;
    //收件人id
    $sid = $contentid;
    //发件人id
    $mid = $userid;
    ///echo $sid;exit;
    $s_title = MooGetGPC('s_title', 'string', 'P');
    $s_title = rtrim($s_title);
    //对主题字数限制
    $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = ''));
    $s_content = MooGetGPC('s_content', 'string', 'P');
    //note 特殊字符
    $s_content = rtrim(MooStrReplace(safeFilter($s_content)));
    $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P');
    $message_back = MooGetGPC('message_back', 'integer', 'P');
    //note 双方屏蔽不给操作
    if (MooGetScreen($mid, $sid)) {
        $err = "因特殊原因,消息发送失败";
        echo return_data($err, false);
        exit;
    }
    if ($mid && $sid && $s_title && $s_content) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level == 2 && $user_arr['usertype'] != 3) {
            //普通会员需要审核(除采集会员之外)
            //if($user_arr['gender'] == 0){	//如果是男方发的,需要审核,0表示
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')");
        } else {
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')");
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        $res = MooMembersData($sid);
        //	   $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '$userid'");
        $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid));
        //	   $send_user_info = $send_user_info[0];
        //头像路径
        $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
        //省
        $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
        //市
        $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
        //身高
        ob_start();
        require_once MooTemplate('public/mail_space_messagetpl', 'module');
        //模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid);
        $week_time = 24 * 3600 * 7;
        //一周时间秒数
        $interval_time = $timestamp - $user_arr['last_login_time'];
        //当前时间-最后登录时间
        $date1 = date("Y-m-d", strtotime("last Monday"));
        $date2 = date("Y-m-d", strtotime("Sunday"));
        if ($interval_time > $week_time) {
            //不活跃用户每周发一条短信
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true);
            if ($cos['c'] <= 1) {
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        } else {
            //活跃用户每天一条
            //每天该用户超过5条信息不发送短信
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true);
            if ($cos['c'] < 5) {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        }
        //note 发送资料给接收方
        if ($send_mymessage) {
        }
        //note 备份邮件操作
        if ($message_back) {
            //note 发送MAIL时所需信息
            $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'");
            //note 发送MAIL时收信人的邮箱
            $ToAddress = $user['username'];
            //note 发送MAIL时主题
            $ToSubject = '提示:您在真爱一生网所发的消息备份';
            //note 发送MAIL时Body内容所需信息
            $username = $user['nickname'];
            //note 发送MAIL时Body内容所需信息
            $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'");
            if ($username) {
                $ToBody = $username;
            } else {
                $ToBody = 'ID号为' . $mid . '的会员<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>';
            } else {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>';
            }
            if ($username) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                $suc = "发送成功,真爱一生审核后对方即可以收到。";
                echo return_data($suc, true);
                exit;
            } else {
                $suc = "发送成功";
                echo return_data($suc, true);
                exit;
            }
        } else {
            $err = "发送失败";
            echo return_data($err, false);
            exit;
        }
    } else {
        $err = "数据填写不完整";
        echo return_data($err, false);
        exit;
    }
}
Beispiel #19
0
function update_mail_status()
{
    global $_MooClass, $dbTablePre;
    $time = time() - 3600 * 24 * 3;
    $start = 0;
    isset($_GET['s']) && ($start = intval($_GET['s']));
    echo $start;
    if ($start < 500000) {
        $sql = "SELECT * FROM {$dbTablePre}services where s_time<'{$time}' and s_status=0 limit {$start},500";
        $email_arr = $_MooClass['MooMySQL']->getAll($sql);
        if ($email_arr) {
            foreach ($email_arr as $email_inf) {
                /*if(MOOPHP_ALLOW_FASTDB){
                			$get_email_user=MooFastdbGet('members','uid',$email_inf['s_uid']);
                		}else{
                			$get_email_user=$_MooClass['MooMySQL']->getOne("SELECT usertype FROM {$dbTablePre}members_search where uid={$email_inf['s_uid']}");
                		}*/
                if (MooMembersData($email_inf['s_uid'], 'usertype') == 3) {
                    $_MooClass['MooMySQL']->query("update {$dbTablePre}services set s_status=1,read_time=now() where s_id={$email_inf['s_id']}");
                }
                $start += 500;
                exit('<html><head><meta http-equiv="refresh" content="2;url=?n=crontab&param=123456&h=update_mail_status&s=' . $start . '"> </head><body></body></html>');
            }
        } else {
            exit("ok");
        }
    } else {
        exit("ok");
    }
}
Beispiel #20
0
function material_skin()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $timestamp;
    $uid = $GLOBALS['style_uid'];
    //note 查看会员资料信息
    //	if(MOOPHP_ALLOW_FASTDB){
    //		$user = MooFastdbGet('members','uid',$uid);
    //	}else{
    //		$user = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members WHERE uid='$uid'");
    //	}
    $user = MooMembersData($uid);
    //note_显示相册中的普通照片
    $user_pic = $_MooClass['MooMySQL']->getAll("SELECT imgurl,pic_date,pic_name FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$uid}'");
    //note 您可能喜欢的人,匹配相同地区
    $able_like = youAbleLike($l, 5);
    //note 显示所有皮肤风格
    $skin_style = $_MooClass['MooMySQL']->getAll("select * from {$dbTablePre}members_skin");
    include MooTemplate('public/material_skin', 'module');
}
Beispiel #21
0
<?php

global $_MooClass, $dbTablePre;
$uid = MooGetGPC('uid', 'integer');
/*
if(MOOPHP_ALLOW_FASTDB){
	$server = MooFastdbGet('members','uid',$uid);
}else{
	$server=$_MooClass['MooMySQL']->getOne("SELECT `sid` FROM `{$dbTablePre}members` WHERE `uid`=".$uid);
}
*/
if ($uid) {
    if (MooMembersData($uid, 'sid')) {
        $_MooClass['MooMySQL']->query("INSERT INTO `{$dbTablePre}custom_remark` (cid,keyword,content,awoketime,addtime) values ('{$server['sid']}','会员付款','尊敬的客服,ID为{$uid}的会员正在付款,请及时与他联系','" . (time() + 120) . "','" . time() . "')");
    } else {
        $_MooClass['MooMySQL']->query("INSERT INTO `{$dbTablePre}custom_remark` (cid,keyword,content,awoketime,addtime) values ('5','会员付款','尊敬的客服,ID为{$uid}的会员正在付款,请及时与他联系','" . (time() + 120) . "','" . time() . "')");
    }
}
Beispiel #22
0
function sendEmail()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $timestamp, $memcached;
    $sendtouid = MooGetGPC('uid', 'integer', 'P');
    $userid = $user_arr['uid'];
    $title = MooGetGPC('title', 'string', 'P');
    $content = MooGetGPC('content', 'string', 'P');
    $serverid = Moo_is_kefu();
    if ($serverid && $user_arr['usertype'] != 3) {
        exit('simulate');
    }
    if (empty($sendEmailCount)) {
        $sendEmailCount = 0;
    }
    $sendEmailCount = $memcached->get('sendEmail' . $userid);
    if ($sendEmailCount > 3) {
        exit('limited');
    }
    if ($sendtouid == $userid) {
        exit('sameone');
    }
    if (MooGetScreen($userid, $sendtouid)) {
        exit('shield');
    }
    if (!in_array($user_arr['s_cid'], array(10, 20, 30))) {
        exit('upgrade');
    }
    $sendToUser = MooMembersData($sendtouid);
    if (isset($sendToUser['gender']) && $sendToUser['gender'] == $user_arr['gender']) {
        exit('gender');
    }
    if (isset($sendToUser['showinformation']) && $sendToUser['showinformation'] != 1) {
        exit('closeInfo');
    }
    //是否有手机号码
    if (MOOPHP_ALLOW_FASTDB) {
        $_R_ = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $sql = "SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'";
        $_R_ = $_MooClass['MooMySQL']->getOne($sql, true);
    }
    if (empty($_R_['telphone']) && empty($serverid)) {
        exit('telNo');
    }
    $sql = "select count(s_id) as cnt from web_members_search where s_fromid='{$userid}' and s_uid='{$sendtouid}' and s_type=1";
    $_S_ = $_MooClass['MooMySQL']->getOne($sql, true);
    if (isset($_S_['cnt']) && $_S_['cnt'] > 3) {
        exit('已经超出了发送邮件的数量!');
    }
    $gender = $user_arr['gender'] == 1 ? "美女" : "帅哥";
    $data['s_content'] = trim(safeFilter($content));
    $data['s_title'] = $title;
    $data['s_fromid'] = $userid;
    $data['s_uid'] = $sendtouid;
    $data['s_time'] = time();
    $data['sid'] = $user_arr['sid'];
    if ($user_arr['usertype'] != 3) {
        $data['flag'] = 0;
    } else {
        $data['flag'] = 1;
    }
    inserttable('services', $data);
    $memcached->set('sendEmail' . $userid, ++$sendEmailCount, 0, 86400);
    //************提醒所属客服**************
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $userid . ' 发送邮件到' . $sendtouid;
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='发邮件',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $pattern = '/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/';
    if (isset($sendToUser['usertype']) && $sendToUser['usertype'] == 1 && preg_match($pattern, $sendToUser['telphone'])) {
        Push_message_intab($sendtouid, $sendToUser['telphone'], "站内信", "尊敬的会员您好!ID:{$userid}给您发送了邮件!幸福热线:4008787920", $userid);
    }
}
Beispiel #23
0
    $user_arr['province'] = 0;
    $user_arr['city'] = 0;
}
//时间相关
if ($uid) {
    //更新COOKIE 成活时间
    MooUpateCookie($uid);
    $new_email_num = header_show_total($uid);
    // 判断是不是已经升高级付款
    $sql = "select id from {$dbTablePre}payment_new where status = 1 and pay_type = 2 and pay_service = 1 and uid = {$uid}";
    $h_pay = $_MooClass['MooMySQL']->getOne($sql, true);
}
//获取皮肤名称
$style_uid = MooGetGPC('uid', 'integer', 'G');
$skiname = MooGetGPC('skiname', 'string', 'G');
//新邮件数
if (!empty($style_uid) && $style_uid != $uid) {
    //采用他人的样式
    $style_user_arr = array();
    if (MooMembersData($style_uid, 'is_lock') == 1) {
        $style_user_arr = MooMembersData($style_uid);
    }
} else {
    $style_uid = $uid;
    $style_user_arr = $user_arr;
}
$style_name = 'default';
include_once "module/" . strtolower($name) . "/index.php";
//$_MooClass['MooMySQL']->close();
@$memcached->close();
@$fastdb->close();
Beispiel #24
0
/**
 * 登录表单处理
 * 描述:
 */
function login_submit()
{
    global $_MooClass, $dbTablePre, $_MooCookie;
    //noet 对提交的数据过滤
    if ($_POST) {
        $username = trim($_POST['username']);
        $md5_password = md5($_POST['password']);
        $cookietime = intval(isset($_POST['cookietime']) ? $_POST['cookietime'] : '');
        $remember_username = MooGetGPC('remember', 'integer', 'P');
    }
    /*****设置回转的页面*****/
    $returnurl = MooGetGPC('returnurl', 'string', "P");
    //echo $returnurl;
    //exit;
    //note 要填写用户和密码
    if (empty($_POST['username']) && empty($_POST['password'])) {
        //note 转至邮箱验证页
        if ($returnurl) {
            $returnurl = $returnurl;
            MooMessage("请填写用户名和密码", "{$returnurl}", '03');
        } else {
            MooMessage("请填写用户名和密码", "index.php?n=login", '03');
        }
        exit;
    }
    //note 用户名不能为空
    if (empty($_POST['username'])) {
        //note 转至邮箱验证页
        if ($returnurl) {
            $returnurl = $returnurl;
            MooMessage("用户名不能为空", "{$returnurl}", '03');
        } else {
            MooMessage("用户名不能为空", "index.php?n=login", '03');
        }
        exit;
    }
    //note 密码不能为空
    if (empty($_POST['password'])) {
        //note 转至邮箱验证页
        if ($returnurl) {
            $returnurl = $returnurl;
            MooMessage("密码不能为空", "{$returnurl}", '03');
        } else {
            MooMessage("密码不能为空", "index.php?n=login", '03');
        }
        exit;
    }
    $userid = 0;
    $sp = searchApi('members_man members_women');
    $limit = array(0, 1);
    //note 验证用户名,密码     enky
    if (is_numeric($username)) {
        if (strlen($username) == 11) {
            //判断手机号是否存在
            $filter = array();
            $filter[] = array('telphone', $username);
            if ($sp->getResultOfReset($filter, $limit)) {
                $ids = $sp->getIds();
                if (isset($ids[0])) {
                    $userid = $ids[0];
                }
            }
        }
        if (!$userid) {
            //判断uid是否存在
            $filter = array();
            $filter[] = array('@id', $username);
            if ($sp->getResultOfReset($filter, $limit)) {
                $ids = $sp->getIds();
                if (isset($ids[0])) {
                    $userid = $ids[0];
                }
            }
        }
        if (!$userid) {
            if ($user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_base` where qq='{$username}'")) {
                $userid = $user_one['uid'];
            }
        }
        /*if(strlen($username)==11){
        		   $sql_where = " s.telphone='{$username}'";
                   $user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid   WHERE $sql_where");
        		}else{
        			$sql_where = " s.uid = '{$username}'";
        			$user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid   WHERE $sql_where");
        			if(empty($user)){
        			   $sql_where = "b.qq='{$username}'";
        			   //$user = $_MooClass['MooMySQL']->getOne("SELECT a.uid,username,password,birthyear,gender,province,city,automatic,is_lock,is_awoke,sid,last_login_time,lastip FROM `{$dbTablePre}members` a ,`{$dbTablePre}memberfield` b WHERE a.uid=b.uid and $sql_where");
        				$user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid   WHERE $sql_where");
        			}
        		}*/
    } else {
        $filter = array();
        $filter[] = array('username', $username);
        if ($sp->getResultOfReset($filter, $limit)) {
            $ids = $sp->getIds();
            if (isset($ids[0])) {
                $userid = $ids[0];
            }
        }
        /*$sql_where = "s.username = '******'";
        		//$user = $_MooClass['MooMySQL']->getOne("SELECT uid,username,password,birthyear,gender,province,city,automatic,is_lock,is_awoke,sid,last_login_time,lastip FROM `{$dbTablePre}members` WHERE $sql_where");
        		$user = $_MooClass['MooMySQL']->getOne("SELECT s.uid,s.username,s.password,s.birthyear,s.gender,s.province,s.city,b.automatic,s.is_lock,b.is_awoke,s.sid,l.last_login_time,l.lastip FROM `{$dbTablePre}members_search` as s left join `{$dbTablePre}members_base` as b on s.uid=b.uid left join `{$dbTablePre}members_login` as l on s.uid=l.uid   WHERE $sql_where");*/
    }
    //note 用户名找不到
    if (!$userid) {
        $login_where = is_numeric($username) ? "uid='{$username}' or telphone='{$username}'" : "username='******'";
        $user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_search` where {$login_where}");
        if ($user_one) {
            $userid = $user_one['uid'];
        } else {
            //note 转至邮箱验证页
            if ($returnurl) {
                MooMessage("用户名不存在", "{$returnurl}", '01');
            } else {
                MooMessage("用户名不存在", "index.php?n=login", '01');
            }
        }
    }
    //获取
    $user = array_merge(MooGetData('members_login', 'uid', $userid), MooMembersData($userid));
    echo $user['is_lock'];
    exit;
    if ($user['is_lock'] != '1') {
        MooMessage("很抱歉您的用户名已经被锁定!<br>请联系真爱一生网客服:<b>400-678-0405</b>", "{$returnurl}", '01', 6);
    }
    //note 用户密码错误
    if ($user['uid'] && $user['password'] != $md5_password) {
        //note 转至邮箱验证页
        if ($returnurl) {
            $returnurl = $returnurl;
            MooMessage("用户密码错误", "{$returnurl}", '01');
        } else {
            MooMessage("用户密码错误", "index.php?n=login", '01');
        }
        exit;
    }
    //note 验证通过
    if ($user['uid'] && $user['password'] == $md5_password) {
        if ($user['automatic'] == 1) {
            MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400 * 7);
        } else {
            MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400);
        }
        $time = time();
        $_MooClass['MooMySQL']->query("update {$dbTablePre}members_login set last_login_time = '{$time}',login_meb = login_meb+1,lastvisit='{$time}' where uid = '{$user['uid']}'");
        //更新最后登录时间
        //会员最后登录时间
        MooSetCookie('last_login_time', $time, 86400);
        //note 客服提醒
        if ($user['is_awoke'] == '1') {
            $awoketime = time() + 120;
            $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$user['sid']}',title='会员上线',content='ID:{$user['uid']}会员刚刚通过pc机上线,请联系',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'";
            $_MooClass['MooMySQL']->query($sql);
        }
        //note 记住用户名
        if ($remember_username == 1) {
            MooSetCookie('username', $username, time() + 3600);
        } else {
            MooSetCookie('username', $username, -1200);
        }
        //		echo print_r($_MooCookie);die;
        MooPlugins('ipdata');
        $online_ip = GetIP();
        if ($online_ip != $user['lastip']) {
            $user_address = convertIp($online_ip);
            include "./module/crontab/crontab_config.php";
            foreach ($provice_list as $key => $provice_arr) {
                if (strstr($user_address, $provice_arr) !== false) {
                    //if(){
                    $province = $key;
                    break;
                }
            }
            if (empty($province)) {
                $province = $current_user['province'];
            }
            //得到市对应的城市代号
            foreach ($city_list as $city_key => $city_val) {
                if (strstr($user_address, $city_val) !== false) {
                    $city = $city_key;
                    break;
                }
            }
        }
        MooSetCookie('province', $user['province'], 86400);
        MooSetCookie('city', $user['city'], 86400);
        $lastactive = time();
        $uid = $user['uid'];
        //note 更新用户的最近登录ip和最近登录时间
        $updatesqlarr = array('lastip' => $online_ip);
        $wheresqlarr = array('uid' => $uid);
        updatetable("members_login", $updatesqlarr, $wheresqlarr);
        if (MOOPHP_ALLOW_FASTDB) {
            $val = array();
            $val['lastip'] = $online_ip;
            //$val['client']=0;
            $val['last_login_time'] = $time;
            $val['lastvisit'] = $time;
            //$val['isOnline']=1;
            MooFastdbUpdate('members_login', 'uid', $uid, $val);
            //!!
        }
        //记录本次登录ip及上次的ip,及真实的最后访问时间
        $sql_ip = "SELECT last_ip,finally_ip FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'";
        $member_admin_info = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql_ip);
        if (!empty($member_admin_info)) {
            $sql_ip = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET last_ip='{$member_admin_info['finally_ip']}',finally_ip='{$online_ip}',real_lastvisit='{$lastactive}' WHERE uid='{$uid}'";
        } else {
            $sql_ip = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo SET finally_ip='{$online_ip}',uid='{$uid}',real_lastvisit='{$lastactive}'";
        }
        $GLOBALS['_MooClass']['MooMySQL']->query($sql_ip);
        //note 先删除表里面已存在对应用户的session
        //$_MooClass['MooMySQL']->query("DELETE FROM `{$dbTablePre}membersession` WHERE `uid` = '$uid'");
        //删除过期SESSION
        //$date=time()-1200;
        //$_MooClass['MooMySQL']->query("DELETE FROM `{$dbTablePre}membersession` WHERE lastactive<'$date'");
        //$_MooClass['MooMySQL']->query("REPLACE INTO `{$dbTablePre}membersession` SET `username`= '$user[username]',`password`='$user[password]',`ip` = '$online_ip',`lastactive` = '$lastactive',`uid` = '$uid'");
        //发送短信提醒关注的会员上线了
        //fanglin暂时屏蔽
        /*if($_MooCookie['iscontact'] != "yes"){
        		   MooSend_Contact($uid,$user['gender'],"system");
        		}
        		
        
        		//note 伪造用户访问
        		$selectuser=selectuser($user['province'],$user['city'],$user['birthyear'],$user['gender']);
        		$time=strtotime(date('Y-m-d'))-24*60*60;
        		for($i=0;$i<count($selectuser);$i++){
        		      $result=$_MooClass['MooMySQL']->getOne("SELECT `uid` FROM `".$dbTablePre."service_visitor` WHERE `uid`='".$selectuser[$i]['uid']."' AND `visitorid`='".$user['uid']."' AND `who_del`!=2");
        		      if($result['uid']==''){
        		              $_MooClass['MooMySQL']->query("INSERT INTO `".$dbTablePre."service_visitor` SET `uid`='".$selectuser[$i]['uid']."',`visitorid`='".$user['uid']."',`visitortime`='".$time."',`who_del`=1");
        		      }else $_MooClass['MooMySQL']->query("UPDATE `".$dbTablePre."service_visitor` SET `visitortime`='".$time."' WHERE `uid`='".$selectuser[$i]['uid']."' AND `visitorid`='".$user['uid']."'");
        		      
        		}*/
        //note 转至邮箱验证页
        if ($returnurl) {
            $returnurl = $returnurl;
            header("Location:" . $returnurl);
        } else {
            header("Location:index.php?n=service");
        }
        exit;
    }
}
Beispiel #25
0
function material_photo_upload()
{
    global $_MooClass, $dbTablePre, $userid, $user, $pic_size_arr, $user_arr, $memcached;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = $user = MooMembersData($userid);
    $user_rank_id = get_userrank($userid);
    if (MOOPHP_ALLOW_FASTDB) {
        $usercer = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$userid}' LIMIT 1 ", true);
    }
    if ($_POST['isupload'] == '1') {
        //note 设定用户id
        $memberid = $userid;
        //note 设定用户上传图片大小限制 最小10240字节 = 10k 最大419430字节 = 400K
        $minfilesize = 20480;
        $maxfilesize = 1024000;
        $filesize = $_FILES['userfile']['size'];
        if ($filesize > $maxfilesize) {
            $notice = "请上传小于1000KB的照片。";
            echo return_data($notice);
            exit;
        }
        if ($filesize < $minfilesize) {
            $notice = "请上传大于20KB的照片。";
            echo return_data($notice);
            exit;
        }
        //note 判断文件类型
        $flag = '';
        $true_type = file_type($_FILES['userfile']['tmp_name']);
        $extname = strtolower(substr($_FILES['userfile']['name'], strrpos($_FILES['userfile']['name'], '.') + 1));
        $images = array('/jpg/', '/jpeg/', '/gif/', '/png/', '/JPG/', '/JPEG/', '/GIF/', '/PNG/');
        if (in_array('/' . $extname . '/', $images)) {
            foreach ($images as $v) {
                //note http://ask.wangmeng.cn/question/76
                if (preg_match($v, $_FILES['userfile']['type']) && ('image/' . $true_type == $_FILES['userfile']['type'] || 'image/p' . $true_type == $_FILES['userfile']['type'] || 'image/x-' . $true_type == $_FILES['userfile']['type'])) {
                    $file_content = file_get_contents($_FILES['userfile']['tmp_name']);
                    $low_file_content = strtolower($file_content);
                    $pos = strpos($low_file_content, '<?php');
                    if ($pos) {
                        $notice = "照片中含有不安全信息请重新上传";
                        echo return_data($notice);
                        exit;
                    } else {
                        $flag = 1;
                    }
                }
            }
        }
        //echo $true_type,'_',$flag,'_',$_FILES['userfile']['type'];exit;
        if ($flag != 1) {
            $notice = "请上传JPEG,JPG,PNG或GIF格式";
            echo return_data($notice);
            exit;
        }
        //note 设定该用户最多上传20张图片(形象照除外)
        $maxuploadnum = 20;
        //note 查询出来的总数
        $query = $_MooClass['MooMySQL']->getOne("select count(1) as num from `{$dbTablePre}pic` where `uid` = '{$memberid}' AND `isimage` = '0'", true);
        $total = $query['num'];
        //note 还可以上传多少张
        $leave_num = $maxuploadnum - $total;
        if ($leave_num <= 0) {
            $notice = '您已经有' . $maxuploadnum . '张照片了,';
            if ($user_arr['mainimg']) {
                $notice .= '不可以再上传了。';
            } else {
                $notice .= '请在相册中选一张作为形象照。';
            }
            echo return_data($notice);
            exit;
        }
        //note 设定相册名
        $album = '';
        //note 设定全局路径
        $orgin = "orgin";
        //note 原图文件夹名
        $thumb_path = PIC_PATH;
        //图片路径
        $timestat = time();
        $thumb_datedir = date("Y", $timestat) . "/" . date("m", $timestat) . "/" . date("d", $timestat);
        //原图路径
        $main_img_path = $thumb_path . "/" . $thumb_datedir . "/" . $orgin . "/";
        //note 调用文件操作类库,建立无限级目录
        $mkdirs = MooAutoLoad('MooFiles');
        !is_dir($main_img_path) && $mkdirs->fileMake($main_img_path, 0777);
        //note 上传到指定目录(原图),并且获得上传后的文件描述
        $upload = MooAutoLoad('MooUpload');
        $upload->config(array('targetDir' => $main_img_path, 'saveType' => '0'));
        $files = $upload->saveFiles('userfile');
        //note 获得图片路径和缩略图的路径
        $imgurl = $files[0]['path'] . $files[0]['name'] . "." . $files[0]['extension'];
        if ($files[0]['extension'] == 'gif') {
            $output = imagecreatefromgif($imgurl);
            imagegif($output, $imgurl, 100);
            imagedestroy($output);
        }
        $imgurl2 = $files[0]['path'] . $files[0]['name'] . "_nowater." . $files[0]['extension'];
        @copy($imgurl, $imgurl2);
        //拷贝一张无水印图片(用于形象照)
        $pic_name = $files[0]['name'] . "." . $files[0]['extension'];
        $pic_name2 = $files[0]['name'] . "_nowater." . $files[0]['extension'];
        $first = new Imagick($imgurl);
        //写入水印
        $second = new Imagick('public/system/images/logo_original.png');
        //$second->setImageOpacity (0.4);//设置透明度
        $dw = new ImagickDraw();
        $dw->setGravity(Imagick::GRAVITY_SOUTHEAST);
        //设置位置
        //$dw->setGravity(Imagick::GRAVITY_SOUTH);//设置位置
        $dw->composite($second->getImageCompose(), 0, 0, 50, 0, $second);
        $first->drawImage($dw);
        $first->writeImage($imgurl);
        //将第一张图片的大小控制成我们需要的大小
        list($width, $height) = getimagesize($imgurl);
        $d = $width / $height;
        $off_wh = off_WH($width, $height);
        $new_width = $off_wh['width'];
        $new_height = $off_wh['height'];
        unset($off_wh);
        $big_path = $files[0]['path'];
        $big_name = $files[0]['name'] . '.' . $files[0]['extension'];
        $image = MooAutoLoad('MooImage');
        $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($new_width, $new_height, $imgurl);
        $image->waterMark();
        //note 缩略无水印图片
        $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name2, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($new_width, $new_height, $imgurl2);
        $image->waterMark();
        $thumb1_width = $pic_size_arr["1"]["width"];
        $thumb1_height = $pic_size_arr["1"]["height"];
        $thumb2_width = $pic_size_arr["2"]["width"];
        $thumb2_height = $pic_size_arr["2"]["height"];
        $thumb3_width = $pic_size_arr["3"]["width"];
        $thumb3_height = $pic_size_arr["3"]["height"];
        //note 生成日期目录
        $thumb1_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb1_width . "_" . $thumb1_height . "/";
        $thumb2_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb2_width . "_" . $thumb2_height . "/";
        $thumb3_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb3_width . "_" . $thumb3_height . "/";
        !is_dir($thumb1_path) && $mkdirs->fileMake($thumb1_path, 0777);
        !is_dir($thumb2_path) && $mkdirs->fileMake($thumb2_path, 0777);
        !is_dir($thumb3_path) && $mkdirs->fileMake($thumb3_path, 0777);
        //note 缩略图文件名
        $thumb_filename = md5($files[0]['name']) . "." . $files[0]['extension'];
        $c = 41 / 57;
        if ($d > $c) {
            $thumb1_width = 41;
            $b = $width / $thumb1_width;
            $thumb1_height = $height / $b;
        } else {
            $thumb1_height = 57;
            $b = $height / $thumb1_height;
            $thumb1_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb1_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($thumb1_width, $thumb1_height, $imgurl);
        $image->waterMark();
        $c = 139 / 189;
        if ($d > $c) {
            $thumb2_width = 139;
            $b = $width / $thumb2_width;
            $thumb2_height = $height / $b;
        } else {
            $thumb2_height = 189;
            $b = $height / $thumb2_height;
            $thumb2_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb2_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '139', 'waterMarkMinHeight' => '189', 'waterMarkStatus' => 9));
        $image->thumb($thumb2_width, $thumb2_height, $imgurl);
        $image->waterMark();
        $c = 171 / 244;
        if ($d > $c) {
            $thumb3_width = 171;
            $b = $width / $thumb3_width;
            $thumb3_height = $height / $b;
        } else {
            $thumb3_height = 244;
            $b = $height / $thumb3_height;
            $thumb3_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb3_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '171', 'waterMarkMinHeight' => '244', 'waterMarkStatus' => 9));
        $image->thumb($thumb3_width, $thumb3_height, $imgurl);
        $image->waterMark();
        //note 设定是否是形象照 1为形象照,0为普通照
        $isimage = (int) $_POST['isimage'];
        $updatetime = time();
        if ($isimage === 1) {
            $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_base` set `mainimg`='{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}' where `uid` = '{$memberid}'");
            $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_search` set images_ischeck='2'  where `uid` = '{$memberid}'");
            if (MOOPHP_ALLOW_FASTDB) {
                $image_arr = array();
                $image_arr['mainimg'] = $imgurl;
                $image_arr['pic_date'] = $thumb_datedir;
                $image_arr['pic_name'] = $pic_name;
                $members_search['images_ischeck'] = '2';
                MooFastdbUpdate('members_base', 'uid', $memberid, $image_arr);
                MooFastdbUpdate('members_search', 'uid', $memberid, $members_search);
            }
            searchApi("members_man members_women")->updateAttr(array('images_ischeck'), array($memberid => array(0)));
            UpdateMembersSNS($userid, '修改了形象照');
        }
        //note 写入相册表
        $isimage = 0;
        //web_members.mainimg == web_pic.imgurl 即形象照
        $_MooClass['MooMySQL']->query("insert into `{$dbTablePre}pic` set `uid` = '{$memberid}',`isimage` = '{$isimage}',`album` = '{$album}',`imgurl` = '{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}'");
        //提交会员动态makui
        UpdateMembersSNS($userid, '修改了相册');
        $notice = "成功";
        echo return_data($notice);
        exit;
    } else {
        $user1 = $user_arr;
    }
}
Beispiel #26
0
/**
 * 全权会员操作过的对象包括在首次使用一个月之内的会员也写入到白名单中
 */
function white_list($uid, $anotheruid)
{
    global $_MooClass, $dbTablePre;
    $u = MooMembersData($uid);
    $another == MooMembersData($anotheruid);
    if ($u['usertype'] == 3 && $another['usertype'] == 3 || $u['usertype'] != 3 && $another['usertype'] != 3) {
        return false;
    }
    if ($u['usertype'] == 3 && $another['usertype'] != 3) {
        $isexit_sql = "`uid` = '" . $uid . "' and `anotheruid` = '" . $anotheruid . "'";
        $insert_sql = "('" . $uid . "','" . $anotheruid . "')";
    } else {
        $isexit_sql = "`uid` = '" . $anotheruid . "' and `anotheruid` = '" . $uid . "'";
        $insert_sql = "('" . $anotheruid . "','" . $uid . "')";
    }
    $isexit = $_MooClass['MooMySQL']->getOne("select `id` from `web_white_list` where " . $isexit_sql, true);
    if (!empty($isexit)) {
        return false;
    } else {
        $sql = "insert  INTO `web_white_list` (`uid`,`anotheruid`)  VALUES " . $insert_sql;
        $_MooClass['MooMySQL']->query($sql);
        return;
    }
}
Beispiel #27
0
function ableLike($num = '12')
{
    global $_MooClass, $dbTablePre, $user_arr, $memcached, $userid;
    //note 你喜欢的人,以同地区条件查询,如果城市是0,就查询省,如果省为0就查询国家
    //note 在后面注册功能完善后,有了国家,就要判断国家
    //$user1 = UserInfo();
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $limit = 12;
    $page = $_GET['page'] = empty($_GET['page']) ? 0 : $_GET['page'];
    $user_arr = MooMembersData($userid);
    $user1 = $user_arr;
    $gender = $user1['gender'] == '1' ? '0' : '1';
    if (18 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 30 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 1;
    }
    if (31 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 35 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 2;
    }
    if (36 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 40 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 3;
    }
    if (41 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 50 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 4;
    }
    if (51 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 60 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 5;
    }
    if (61 <= date("Y") - $user1['birthyear'] && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 6;
    }
    if ($user1['birthyear'] == '' || $user1['birthyear'] == 0) {
        $age = 1;
    }
    if ($user1["province"] == '' || $user1["province"] == 0 || $user1["province"] == -1) {
        $user1["province"] = 10103000;
    }
    $file = $age . "_" . $gender . "_" . $user1["province"] . "_" . $user1["city"];
    //     $cache_file = MOOPHP_DATA_DIR.'/cache/cache_' . $file . '.php';
    $data = $memcached->get($file);
    if (!$data) {
        updateVoteFeel("", "", $user1['province'], $user1['city'], $age, $gender);
        $data = $memcached->get($file);
    }
    if (empty($data)) {
        $error = "empty";
        echo return_data($error, false);
        exit;
    }
    $offset = ($page - 1) * 12;
    $count = count($data);
    if ($limit > $count) {
        $limit = $count;
    }
    //		shuffle($data);
    $data = array_slice($data, $offset, $limit);
    for ($j = 0; $j < 12; $j++) {
        //if(MOOPHP_ALLOW_FASTDB){
        if (isset($data[$j])) {
            $able_like[$j] = MooMembersData($data[$j]);
        }
        //MooFastdbGet('members_search','uid',$data[$j]);
        //}
    }
    foreach ($able_like as $k => $u) {
        $mainimg = MooGetphoto($u['uid'], $style = "com");
        $users[] = array('uid' => $u['uid'], 'nickname' => $u['nickname'], 'birthyear' => $u['birthyear'], 'height' => $u['height'], 'salary' => $u['salary'], 'province' => $u['province'], 'city' => $u['city'], 'mainimg' => $mainimg, 'gender' => $u['gender']);
    }
    echo return_data($users);
    exit;
}
Beispiel #28
0
/**
 * 注册是否过了试用期或是否客服延长了试用期
 * @Author:
 * param $userid
 * return 没过返回true,过了返回false
 */
function checkIsOver($userid)
{
    global $_MooClass, $dbTablePre;
    $cur_time = time();
    /*
    $sql  = "select regdate,tastetime,gender from " . $dbTablePre . "members where uid = '" . $userid . "' and is_lock = 1";
    $date_arr = $_MooClass["MooMySQL"]->getOne($sql);
    */
    $user_arr = MooMembersData($userid);
    if ($user_arr['is_lock'] != 1) {
        return FALSE;
    }
    if ($user_arr['gender'] == 1) {
        $regdate = $user_arr['regdate'] + 24 * 3600 * 3;
    }
    //女性会员注册时间 + 加三天试用期
    //$regdate =  $user_arr['regdate'] + (24*3600*3); //会员注册时间 + 加三天试用期
    //$user_arr['gender'] == 1 && $regdate =  $user_arr['regdate'] + (24*3600*3); //女性会员注册时间 + 加三天试用期
    $tastetime = intval($user_arr['tastetime']);
    //客服延长时间
    if ($user_arr['gender'] == 0) {
        if ($cur_time < $tastetime) {
            return true;
        }
        return false;
    } else {
        if ($cur_time < $regdate) {
            return true;
        } elseif ($cur_time < $tastetime) {
            return true;
        }
        return false;
    }
}
Beispiel #29
0
/**
 * 获得来信会员昵称
 * 
 * @param $id 来信会员id
 *       	 return 用户昵称
 */
function getfromname($id)
{
    global $_MooClass, $dbTablePre;
    $user = MooMembersData($id, 'nickname');
    return $user;
}
Beispiel #30
0
function space_mebind()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $diamond, $last_login_time;
    $bind_id = MooGetGPC('bind_id', 'integer', 'G');
    $statue = 1;
    if ($bind_id == 0) {
        //MooMessage('赶快去找到您心仪的TA去绑定吧!');
        $statue = 0;
    } else {
        $sql = "SELECT a_uid,b_uid,length_time FROM {$dbTablePre}members_bind WHERE id=" . $bind_id;
        $m_bind = $_MooClass['MooMySQL']->getOne($sql);
        $f_uid = $m_bind['a_uid'] == $user_arr['uid'] ? $m_bind['b_uid'] : $m_bind['a_uid'];
        $user_bind = MooMembersData($f_uid);
    }
    $user_s = $user_arr;
    require MooTemplate('public/space_contact_binding', 'module');
}