Example #1
0
function service_request_sms()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $hzn;
    $userid = $user_arr['uid'];
    if (empty($userid)) {
        header("Location:index.php?n=login");
    }
    $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);
    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 ($hzn == "hongniangwang") {
        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)) {
        $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);
    }
    if (MOOPHP_ALLOW_FASTDB) {
        $members = MooFastdbGet('members', 'uid', $sendtoid);
    } else {
        $members = $_MooClass['MooMySQL']->getOne("select telphone,is_phone,username from {$dbTablePre}members where uid='{$sendtoid}'");
    }
    //fanglin暂时屏蔽
    Push_message_intab($sendtoid, $members['telphone'], "索取身份", "真爱一生网www.zhenaiyisheng.cc用户ID:" . $userid . "," . $send_user_gender . ",请求查看您的身份证信息,请速回复哦!4006780405", $userid);
    require MooTemplate('public/service_requestsms', 'module');
}
Example #2
0
function allmessage_detail($contentid)
{
    global $_MooClass, $dbTablePre, $userid, $user_arr;
    //note 获得上一封,下一封邮件
    //	$allmessg_arr = $_MooClass['MooMySQL']->getAll("SELECT s_id FROM {$dbTablePre}services WHERE s_uid = '$userid' and flag = '1' and s_uid_del='0' order by s_time desc");
    //
    //	$total = count($allmessg_arr);
    //	foreach($allmessg_arr as $k => $v) {
    //		if($allmessg_arr[$k]['s_id'] == $contentid) {
    //			$up = ($k - 1) <= 0 ? '0' : ($k - 1);
    //			$next = ($k + 1) >= $total ? ($total- 1) : ($k+1);
    //			$upid = $allmessg_arr[$up]['s_id'];
    //			$nextid = $allmessg_arr[$next]['s_id'];
    //			//地址栏参数是否正确
    //			$flg = true;
    //		}
    //	}
    //	echo $upid,'$',$nextid,'$',$contentid;
    //exit;
    //重新实现上一封,下一封邮件
    $allmessg_arr = $_MooClass['MooMySQL']->getOne("SELECT s_id,s_time FROM {$dbTablePre}services WHERE s_uid = '{$userid}' and flag = '1' and s_uid_del='0' and s_id={$contentid}");
    if ($allmessg_arr) {
        $where = "s_uid = '{$userid}' and flag = '1' and s_uid_del='0'";
        list($upid, $nextid) = getUpNextId($allmessg_arr['s_id'], $where, $allmessg_arr['s_time']);
        $flg = true;
    }
    //地址栏参数是否正确
    if (!$flg) {
        MooMessage('您浏览的不是您的邮件,返回', 'javascript:history.go(-1)', '04');
    }
    //note 删除记录
    $delmessagecontent = MooGetGPC('delmessagecontent', 'string');
    $messageid = MooGetGPC('messageid', 'integer');
    if ($delmessagecontent && $messageid) {
        $time = time();
        //$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}services WHERE s_id = '$messageid' and s_uid = '$userid'");
        $_MooClass['MooMySQL']->query("update {$dbTablePre}services set s_uid_del='1',s_uid_deltime = '{$time}' WHERE s_id = '{$messageid}' and s_uid = '{$userid}'");
        MooMessage("删除消息成功", 'index.php?n=service&h=message&t=allmessage', '05');
    }
    //note 显示查询的内容
    $memail = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}services WHERE s_id = '{$contentid}' and flag = '1' and s_uid_del='0'");
    //如果是本站注册会员
    if ($user_arr['usertype'] == 1 && $memail['s_cid'] != 3) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level != 1) {
            //不是高级会员
            if ($user_arr['gender'] == 0) {
                //男性
                if (!checkIsMobileCertical($userid)) {
                    //没有通过了手机验证
                    MooMessage('您只有先通过手机短信验证才能读取电子邮件,现在就去认证吧', 'index.php?n=myaccount&h=index2', '03');
                } else {
                    if (!checkIsOver($userid)) {
                        //过了试用期
                        $sql = "select count(*) as c from " . $dbTablePre . "services where s_status = '1'  and s_uid = " . $userid . " and read_time = '" . date("Y-m-d") . "'";
                        $arr = $_MooClass['MooMySQL']->getOne($sql, true);
                        $today_read_count = $arr['c'];
                        if ($today_read_count > 5) {
                            MooMessage('对不起,您不是钻石或高级会员,每天只可以看5条电子邮件!', 'javascript:history.go(-1)', '03');
                        }
                    }
                }
            } else {
                //女性
                if (!checkIsOver($userid)) {
                    //过了试用期
                    if (!checkIsMobileCertical($userid)) {
                        //没有通过了手机验证
                        MooMessage('您只有先通过手机短信验证才能读取电子邮件,现在就去认证吧', 'index.php?n=myaccount&h=index2', '03');
                    }
                }
            }
        }
    }
    //note 更新已经阅读状态
    if (!$memail['s_status']) {
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}services SET s_status = '1',read_time='" . date('Y-m-d') . "' WHERE s_id = '{$contentid}'");
    }
    //note 发件人的昵称或ID
    if ($memail['s_fromid'] == 0) {
        $fromname = '真爱一生网';
        //note 当前会员昵称
        $uname = $user_arr['nickname'] ? $user_arr['nickname'] : 'ID:' . $user_arr['uid'];
    } else {
        $from_name = $_MooClass['MooMySQL']->getOne("select uid,nickname from {$dbTablePre}members_search where uid='" . $memail['s_fromid'] . "'");
        $fromname = $from_name['nickname'] ? $from_name['nickname'] : 'ID ' . $from_name['uid'];
        $uname = $user_arr['nickname'] ? $user_arr['nickname'] : 'ID:' . $user_arr['uid'];
    }
    require MooTemplate('public/service_email_allmessagecontent', 'module');
}
Example #3
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');
}
Example #4
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;
    }
}
Example #5
0
File: ajax.php Project: noikiy/zays
function getSMS()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached;
    $sendtouid = MooGetGPC('uid', 'integer', 'P');
    $userid = $user_arr['uid'];
    $serverid = Moo_is_kefu();
    if ($serverid && $user_arr['usertype'] != 3) {
        exit('simulate');
    }
    $isHigher = get_userrank($userid);
    if ($isHigher != 1) {
        exit('noHigher');
    }
    if (empty($sendSMSCount)) {
        $sendSMSCount = 0;
    }
    $sendSMSCount = $memcached->get('sendSMS' . $userid);
    if ($sendSMSCount > 3) {
        exit('limited');
    }
    if ($sendtouid == $userid) {
        exit('sameone');
    }
    if (MooGetScreen($userid, $sendtouid)) {
        exit('shield');
    }
    //是否有手机号码
    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');
    }
    $gender = $user_arr['gender'] == 1 ? "美女" : "帅哥";
    $sendToUser = MooMembersData($sendtouid);
    if (isset($sendToUser['gender']) && $sendToUser['gender'] == $user_arr['gender']) {
        exit('gender');
    }
    if (isset($sendToUser['showinformation']) && $sendToUser['showinformation'] != 1) {
        exit('closeInfo');
    }
    $sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='{$userid}'";
    $certification = $_MooClass['MooMySQL']->getOne($sql, true);
    if ($certification['sms'] != 1) {
        exit('nosms');
    }
    $sql = "SELECT id FROM {$dbTablePre}members_requestsms WHERE uid='{$sendtouid}' AND ruid='{$userid}'";
    if ($_MooClass['MooMySQL']->getOne($sql, true)) {
        $sql = "UPDATE {$dbTablePre}members_requestsms SET request_total=request_total+1 WHERE uid='{$sendtouid}' AND ruid='{$userid}'";
        $_MooClass['MooMySQL']->query($sql);
    } else {
        $sql = "INSERT INTO {$dbTablePre}members_requestsms SET uid='{$sendtouid}',ruid='{$userid}',dateline='{$timestamp}'";
        $_MooClass['MooMySQL']->query($sql);
    }
    $memcached->set('sendSMS' . $userid, ++$sendSMSCount, 0, 86400);
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(1, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($userid);
    }
    //***********提醒所属客服************
    $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}的{$gender}请求查看您的身份信息,登录www.zhenaiyisheng.cc收获缘分!幸福热线:4008787920", $userid);
    }
}
Example #6
0
function material_showinformation()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr;
    $user_rank_id = get_userrank($userid);
    $_MooClass['MooMySQL']->query("update {$dbTablePre}members_base set showinformation_val='0' where uid='{$userid}'");
    $_MooClass['MooMySQL']->query("update {$dbTablePre}members_search set showinformation='1' where uid='{$userid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_members = $user_members_search = array();
        $user_members_search['showinformation'] = 1;
        $user_members['showinformation_val'] = 0;
        MooFastdbUpdate('members_base', 'uid', $userid, $user_members);
        MooFastdbUpdate('members_search', 'uid', $userid, $user_members_search);
    }
    MooMessage('您的资料已开启成功', 'index.php?n=material');
}
Example #7
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;
    }
}