Exemplo n.º 1
0
function userbasicadd($users = array())
{
    global $_MooClass, $dbTablePre;
    if (!$users) {
        return;
    }
    $allowarr = array();
    foreach ($users as $val) {
        $allowarr[] = $val['uid'];
    }
    $users1 = array();
    if (MOOPHP_ALLOW_FASTDB) {
        foreach ($allowarr as $uid) {
            $users1[] = MooFastdbGet('members_search', 'uid', $uid);
        }
    } else {
        $allowstr = implode(',', $allowarr);
        $users1 = $_MooClass['MooMySQL']->getAll("select gender, nickname from {$dbTablePre}members_search where uid in(" . $allowstr . ")");
    }
    $count = count($users);
    for ($i = 0; $i < $count; $i++) {
        $users[$i] = array_merge($users[$i], $users1[$i]);
    }
    return $users;
}
Exemplo n.º 2
0
function active_email()
{
    global $_MooClass;
    $uid = $u['uid'] = MooGetGPC('uid', 'string');
    $verifycode = MooGetGPC('verifycode', 'string');
    $username = $u['username'] = MooGetGPC('p', 'string');
    if ($verifycode == strtoupper(md5('hongniangwang' . $u['uid'] . $u['username']))) {
        $online_ip = GetIP();
        $t = time();
        $pass = md5('123456');
        $r = $_MooClass['MooMySQL']->getOne("select * from web_activelog where uid={$uid}  limit 1", true);
        if ($r['username'] == $username) {
            MooMessage("您已经激活过了", "index.php", "05");
        } else {
            //$_MooClass['MooMySQL']->query("update web_members_search,web_members_login set password='******',usertype=1,regdate='$t',last_login_time = '$t',login_meb = login_meb+1,lastip='$online_ip',lastvisit='$t'  where uid='$uid'");
            $_MooClass['MooMySQL']->query("update web_members_search as s,web_members_login as l set s.password='******',s.usertype=1,s.regdate='{$t}',l.last_login_time = '{$t}',l.lastip='{$online_ip}',l.lastvisit='{$t}'  where s.uid='{$uid}' and l.uid='{$uid}'");
            searchApi('members_man members_women')->updateAttr(array('usertype', 'regdate'), array($uid => array(1, $t)));
            $_MooClass['MooMySQL']->query("insert into web_activelog(uid,username,activetime) values('{$uid}','{$username}','{$t}')");
        }
        MooSetCookie('auth', MooAuthCode("{$uid}\t{$pass}", 'ENCODE'), 86400);
        MooSetCookie('username', $u['username'], time() + 3600);
        if (MOOPHP_ALLOW_FASTDB) {
            $user11 = MooFastdbGet('members_search', 'uid', $uid);
            $meb = $user11['login_meb'];
            $val_s = $val_l = array();
            $val_s['password'] = $pass;
            $val_s['usertype'] = 1;
            $val_s['regdate'] = $t;
            $val_l['last_login_time'] = $t;
            $val_l['login_meb'] = $meb + 1;
            $val_l['lMooFastdbUpdateastip'] = $online_ip;
            $val_l['lastvisit'] = $t;
            MooFastdbUpdate('members_search', 'uid', $uid, $val_s);
            //!!
            MooFastdbUpdate('members_login', 'uid', $uid, $val_l);
        }
        //$_MooClass['MooMySQL']->query("INSERT INTO `web_membersession` SET `username`= '$u[username]',`password`='$pass',`ip` = '$online_ip',`lastactive` = '$t',`uid` = '$uid'");
        MooMessage("验证激活成功", "index.php", "05");
    } else {
        MooMessage("参数有误!请注册", "index.php", "02");
    }
}
Exemplo n.º 3
0
function index_index()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $uid = MooGetGPC('uid', 'integer');
    $puid = MooGetGPC('puid', 'integer');
    if (!$uid) {
        if (!$userid) {
            MooMessage('没有找到此会员', 'register.html');
        } else {
            MooMessage('没有找到此会员', 'index.php?n=search');
        }
    }
    if (MOOPHP_ALLOW_FASTDB) {
        $user = MooFastdbGet('members', 'uid', $uid);
        $user = array_merge($user, MooFastdbGet('memberfield', 'uid', $uid));
        $c = MooFastdbGet('choice', 'uid', $uid);
    } else {
        $user = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members where uid='{$uid}'");
        $user2 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}memberfield where uid='{$uid}'");
        $user = array_merge($user, $user2);
        unset($user2);
        $c = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}choice as mf WHERE uid='{$uid}'");
    }
    //$tuijian=$_MooClass['MooMySQL']->getAll("select * from {$dbTablePre}members where gender='$user[gender]' and is_vote='1' order by uid limit 7");
    $en_year = $user['birthyear'];
    $st_year = $en_year - 2;
    $en_year += 2;
    $sql_new = "SELECT uid,nickname,gender,birthyear,mainimg,images_ischeck FROM {$dbTablePre}members where birthyear between {$st_year} and {$en_year} and gender='{$user['gender']}' and images_ischeck=1 and is_lock=1 order by regdate desc limit 6";
    $tuijian = $_MooClass['MooMySQL']->getAll($sql_new);
    if (!$user) {
        if (!$userid) {
            MooMessage('没有您查看的会员', 'register.html');
        } else {
            MooMessage('没有您查看的会员', 'index.php?n=search');
        }
    } else {
        MooSetCookie('puid', $puid, time() + 3600, '');
        include MooTemplate('public/recommend_index', 'module');
    }
}
Exemplo n.º 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;
    }
}
Exemplo n.º 5
0
function getSex($id)
{
    global $_MooClass, $dbTablePre;
    if (MOOPHP_ALLOW_FASTDB) {
        $sex = MooFastdbGet('members_search', 'uid', $id);
    } else {
        $sex = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search where uid='{$id}'");
    }
    return $sex['gender'];
}
Exemplo n.º 6
0
/**
 * 从表的表里获取内容
 * @Author:
 * param $table string 表名 不带前缀
 * param $fieldname string 字段名
 * param $fieldvalue string 字段值
 * param $getfield string 你要获取的字段值 字段间用半角逗号分开, 仅对未开启memcahe缓存时可用
 * return $arr  array()
 */
function MooGetData($table, $fieldname, $fieldvalue, $getfield = '')
{
    global $_MooClass, $dbTablePre;
    $data = array();
    if (MOOPHP_ALLOW_FASTDB) {
        $data = MooFastdbGet($table, $fieldname, $fieldvalue);
    } else {
        $getfield = $getfield ? $getfield : '*';
        $data = $_MooClass['MooMySQL']->getOne("SELECT {$getfield} FROM {$dbTablePre}{$table} WHERE {$fieldname}='{$fieldvalue}'");
    }
    return $data;
}
Exemplo n.º 7
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');
}
Exemplo n.º 8
0
Arquivo: ajax.php Projeto: noikiy/zays
function recommendMember()
{
    global $_MooClass, $dbTablePre, $timestamp, $memcached, $_MooCookie;
    $gender = !MooGetGPC('gender', 'integer', 'G') ? 0 : 1;
    //note 性别
    include_once "./module/crontab/crontab_config.php";
    $cur_ip = GetIP();
    //		$cur_ip = "202.120.2.200";//上海ip
    //		$cur_ip = "218.202.206.102";//新疆ip
    //$cur_ip = "218.70.178.197"; //重庆
    //		$cur_ip="221.130.166.242";
    MooPlugins('ipdata');
    $ip_arr = convertIp($cur_ip);
    //得到省份对应的数值,查库
    $province = $city = "";
    foreach ($provice_list as $key => $val) {
        if (strstr($ip_arr, $val)) {
            $province = $key;
            $currentdistrict = $val;
            break;
        }
    }
    if (isset($_GET['province'])) {
        foreach ($provice_list as $key => $val) {
            if ($_GET['province'] == $key) {
                $currentdistrict = $val;
                break;
            }
        }
    }
    //得到市对应的城市代号
    foreach ($city_list as $city_key => $city_val) {
        if (strstr($ip_arr, $city_val)) {
            $city = $city_key;
            break;
        }
    }
    if (isset($_GET['province'])) {
        $province = MooGetGPC('province', 'integer', 'G');
        //note 修正广东省深圳和广州的区域查询
        if (in_array($province, array(10101201, 10101002))) {
            $city = $province;
            $province = 10101000;
        }
        //修正直辖市查询
        if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) {
            $city = '0';
        }
        $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'";
        $cachefile_list = $_MooClass['MooMySQL']->getAll($sql);
        foreach ($cachefile_list as $cachefile) {
            $cachefile['provincestarfile'] = rtrim($cachefile['provincestarfile'], '.data');
            if ($memcached->get($cachefile['provincestarfile'])) {
                $memcached->delete($cachefile['provincestarfile']);
            }
            $cachefile['citystarfile'] = rtrim($cachefile['citystarfile'], '.data');
            if ($memcached->get($cachefile['citystarfile'])) {
                $memcached->delete($cachefile['citystarfile']);
            }
            $cachefile['provinceotherfile'] = rtrim($cachefile['provinceotherfile'], '.data');
            if ($memcached->get($cachefile['provinceotherfile'])) {
                $memcached->delete($cachefile['provinceotherfile']);
            }
        }
    }
    $userList = array();
    //查市城市之星
    //note 修正广东省深圳和广州的区域查询
    if (in_array($province, array(10101201, 10101002))) {
        $city = $province;
        $province = 10101000;
    }
    $sql_city = "s.city='{$city}'";
    //修正直辖市查询
    if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) {
        $city = '0';
    }
    if ($city == 0) {
        $sql_city = "s.province='{$province}'";
    }
    if (!empty($city) || !empty($province)) {
        //默认没有进入  选择省后进入
        $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid  left join {$dbTablePre}members_introduce i on s.uid=i.uid WHERE s.images_ischeck=1 and s.s_cid='20' and s.gender='{$gender}' and ({$sql_city} AND s.is_lock=1 AND  s.nickname!='' AND i.introduce!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1)  order by s.s_cid limit 6";
        //$userList = $_MooClass['MooMySQL']->getAll($sql);
        $param = "type=query/name=userlist_{$city}_citystar/sql={$sql}/cachetime=86400";
        $_MooClass['MooCache']->getBlock($param);
        //
        $userList = $GLOBALS['_MooBlock']["userlist_{$city}_citystar"];
        //市缓存文件
        //$city_cachefile = "userlist_{$city}_citystar".'_'.md5($param).'.data';
    }
    //市无城市之星,从省取城市之星
    if (empty($userList)) {
        $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from  {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.province='{$province}'\n\t\t\t          AND s.is_lock=1   and  s.gender='{$gender}' \n\t\t\t          AND s.images_ischeck = 1 AND s.showinformation=1 \n\t\t\t          and s.city_star>=1 and s.usertype=1 and i.introduce!='' ans s.nickname!='' LIMIT 6";
        //			$userList = $_MooClass['MooMySQL']->getAll($sql);
        $param = "type=query/name=userlist_{$province}_provincestar/sql={$sql}/cachetime=86400";
        $_MooClass['MooCache']->getBlock($param);
        $userList = $GLOBALS['_MooBlock']["userlist_{$province}_provincestar"];
        //省缓存文件
        //$province_cachefile = "userlist_{$province}_provincestar".'_'.md5($param).'.data';
    }
    //城市之星不够取钻石会员(市->省->全国)
    $count = count($userList);
    if ($count < 6) {
        //默认进入
        $addarr = array('cityadd', 'provinceadd', 'countryadd');
        $user_in = '1747188|2154375|1600591|2159633|20782701|20785837|20561126|20305660|20910184';
        //城市之星uid
        $user_list = array();
        if (!is_array($userList)) {
            $userList = array();
        }
        //enky add
        foreach ($userList as $user) {
            $user_list[] = $user['uid'];
        }
        if (!empty($user_list)) {
            $user_in .= ',' . implode('|', $user_list);
        }
        //从(市->省->全国)取钻石会员
        $cityadd = array();
        $provinceadd = array();
        $countryadd = array();
        foreach ($addarr as $add) {
            if ($count < 6) {
                $id = '';
                //从市取
                if ($add == 'cityadd') {
                    if (!$city || $city == 0) {
                        continue;
                    }
                    $sql_add = "s.city='{$city}' and";
                    $id .= $city;
                }
                //从省取
                if ($add == 'provinceadd') {
                    if (!$province || $province == 0) {
                        continue;
                    }
                    $sql_add = "s.province='{$province}' and";
                    $id .= $province;
                }
                //全国取
                if ($add == 'countryadd') {
                    $sql_add = '';
                    $id .= 'country';
                }
                //取几个钻石会员
                $add_query_sum = 6 - $count;
                //enky need change
                $cl = searchApi('members_women members_man');
                $cond[] = array('is_lock', '1', false);
                $cond[] = array('images_ischeck', '1', false);
                $cond[] = array('gender', $gender, false);
                $cond[] = array('usertype', '1', false);
                //$cond[] = array('@id','20752315|'.$user_in,true);//uid
                $cond[] = array('s_cid', '20', false);
                $cond[] = array('city_star', '0', false);
                $cond[] = array('showinformation', '1', false);
                $cond[] = array('pic_num', array(1, 20), false);
                if ($province) {
                    array('province', $province, false);
                }
                if ($city) {
                    array('city', $city, false);
                }
                $limit = array($add_query_sum);
                $res_matches = $cl->getResult($cond, $limit);
                if ($res_matches) {
                    $count_res = count($res_matches);
                    $array_merge = array();
                    for ($i = 0; $i < $count_res; $i++) {
                        if (!empty($res_matches['matches'][$i])) {
                            $ids[] = $res_matches['matches'][$i]['id'];
                        }
                    }
                    $sql_str = implode(',', $ids);
                    $nickname_res = $_MooClass['MooMySQL']->getAll("select nickname,uid from web_members_search where uid in " . "({$sql_str})");
                    $mainimg_res = $_MooClass['MooMySQL']->getAll("select mainimg from web_members_base where uid in " . "({$sql_str})");
                    $introduce_res = $_MooClass['MooMySQL']->getAll("select introduce from web_members_introduce where uid in " . "({$sql_str})");
                    //合并到sphinx查询出的整理后的数组
                    for ($i = 0; $i < $count_res; $i++) {
                        if (!empty($res_matches['matches'][$i]['attrs'])) {
                            $res_matches['matches'][$i]['attrs']['nickname'] = $nickname_res[$i]['nickname'];
                            $res_matches['matches'][$i]['attrs']['uid'] = $nickname_res[$i]['uid'];
                            $res_matches['matches'][$i]['attrs']['mainimg'] = $mainimg_res[$i]['mainimg'];
                            $res_matches['matches'][$i]['attrs']['introduce'] = $introduce_res[$i]['introduce'];
                            $bigarr[] = $res_matches['matches'][$i]['attrs'];
                        }
                    }
                    ${$add} = $bigarr;
                } else {
                    $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid  left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.uid not in({$user_in})\n\t\t\t\t\t\t\t\t  AND {$sql_add} s.city_star=0 AND s.s_cid = 20  and s.gender=" . $gender . " \n\t\t\t\t\t\t\t\t  AND s.images_ischeck  = 1 AND s.is_lock = 1 AND s.showinformation = 1\n\t\t\t\t\t\t\t\t  AND s.pic_num >=1 AND s.usertype=1 AND i.introduce!='' AND s.nickname!=''  LIMIT {$add_query_sum}";
                    $param = "type=query/name=userlist_{$id}_other/sql={$sql}/cachetime=86400";
                    $_MooClass['MooCache']->getBlock($param);
                    ${$add} = $GLOBALS['_MooBlock']["userlist_{$id}_other"];
                }
                //已获取的首页会员uid
                $user_list = array();
                if (!is_array(${$add})) {
                    ${$add} = array();
                }
                //enky add
                foreach (${$add} as $user) {
                    $user_list[] = $user['uid'];
                }
                if (!empty($user_list)) {
                    $user_in .= ',' . implode(',', $user_list);
                }
                //echo $user_in;exit;
                //已有总数
                $count += count(${$add});
            }
        }
        //$countryadd  have data
        $userList = array_merge($userList, $cityadd, $provinceadd, $countryadd);
        //省其它类型会员缓存文件
        //$province_othercachefile = "userlist_{$id}_other".'_'.md5($param).'.data';
    }
    //生成的block缓存文件存库
    /* $city = $city ? $city : 0;
    		$sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE  province='{$province}' AND city='{$city}'";
    		$cache_arr = $_MooClass['MooMySQL']->getAll($sql);
    		
    		if(empty($cache_arr)){
    			$province_cachefile = isset($province_cachefile)?$province_cachefile:'';
    			$sql = "INSERT INTO {$dbTablePre}index_cachefile SET province='{$province}',city='{$city}',provincestarfile='{$province_cachefile}',citystarfile='{$city_cachefile}',provinceotherfile='{$province_othercachefile}'";
    			$_MooClass['MooMySQL']->query($sql);
    		}  */
    //推荐列表中如果存在,则以推荐列表中的指定的sort替换
    $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE  province='{$province}' AND city='{$city}' order by sort asc";
    $recommend_list = $_MooClass['MooMySQL']->getAll($sql);
    if (!empty($recommend_list)) {
        foreach ($recommend_list as $list) {
            $sort = $list['sort'] < 1 ? 0 : $list['sort'] - 1;
            if (MOOPHP_ALLOW_FASTDB) {
                $u = MooFastdbGet('members_search', 'uid', $list['uid']);
                $u2 = MooFastdbGet('members_base', 'uid', $list['uid']);
                if (is_array($u) && is_array($u2)) {
                    $u = array_merge($u, $u2);
                }
            } else {
                $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce  as i on s.uid=i.uid WHERE s.uid='{$list['uid']}'";
                $u = $_MooClass['MooMySQL']->getOne($sql);
            }
            if ($u) {
                foreach ($userList as $key => $val) {
                    if ($list['uid'] == $val['uid']) {
                        $user_key = $key;
                        break;
                    }
                }
                if (isset($user_key)) {
                    if (isset($userList[$sort])) {
                        $userList[$key] = $userList[$sort];
                    }
                    $userList[$sort] = $u;
                } else {
                    $userList[$sort] = $u;
                }
            }
        }
    }
    //删除数组中多余的部分
    array_splice($userList, 6);
    $result = array();
    $imgSrcSmall = $imgSrcMid = $imgSrcUrl = '';
    foreach ($userList as $v) {
        $introduce = '';
        if (isset($v['introduce'])) {
            $introduce = MooCutstr($v['introduce'], 50, '...');
        }
        $imgSrcSmall = MooGetphoto($v['uid'], 'small');
        $imgSrcMid = MooGetphoto($v['uid'], 'mid');
        if ($imgSrcSmall) {
            $imgSrc = $imgSrcMid;
        } elseif ($v['gender'] == '1') {
            $imgSrc = "module/index/templates/default/images/se_woman.gif";
        } else {
            $imgSrc = "module/index/templates/default/images/se_man.gif";
        }
        if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) {
            $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>";
        } else {
            if (isset($v['gender']) && $v['gender']) {
                $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> ";
            } else {
                $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> ";
            }
        }
        if ($v['birthyear']) {
            $birthyear = date('Y') - $v['birthyear'] . '岁';
        } else {
            $birthyear = '年龄保密';
        }
        $result[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $v['nickname'], "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']);
    }
    echo json_encode($result);
}
Exemplo n.º 9
0
function addmyfriend()
{
    global $_MooClass, $dbTablePre, $pagesize, $user_arr, $timestamp, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    if ($sendtoid == $userid) {
        MooMessage('自己不可加自己为意中人', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,加意中人失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        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 分配客服
    //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 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可加同性为意中人', 'javascript:history.go(-1);', '04');
        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', '04');
    }
    $friend = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$sendtoid}' AND uid = '{$uid}'", true);
    if ($friend['fid']) {
        $content = '对不起,对方已经在您的意中人列表中';
        $url = 'index.php?n=space&h=viewpro&uid=' . $sendtoid;
        MooMessage($content, $url, '02');
    } else {
        //note 加为意中人,新插入一行记录,谁加谁
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_friend SET friendid  = '{$sendtoid}',uid = '{$uid}',sendtime='" . time() . "'");
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($uid);
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("select c.*,b.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base b on a.uid=b.uid  left join  {$dbTablePre}choice c  on a.uid=c.uid  where a.uid = '{$uid}'");
    $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_friendtpl', 'module');
    //模板
    $body = ob_get_clean();
    //	   MooSendMailSpace2($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员将您添加为意中人了!请尽快查收!您的帐号是:".$res['username'],$type="1",$body);
    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);
    $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 {
        //每天该用户超过5条信息不发送短信
        $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);
        }
    }
    require MooTemplate('public/service_friend_addmyfriend', 'module');
}
Exemplo n.º 10
0
function get4members($uid_list){
	global $_MooClass,$dbTablePre;
   
	if(MOOPHP_ALLOW_FASTDB){
		$uid_list = explode(',',$uid_list);
		//$user = array();
		foreach($uid_list as $v){
			$res_search_arr = MooFastdbGet('members_search','uid',$v);
			$res_base_arr = MooFastdbGet('members_base','uid',$v);
			if(!is_array($res_search_arr)) $res_search_arr=array();
			if(!is_array($res_base_arr)) $res_base_arr=array();
			$res_all = array_merge($res_search_arr,$res_base_arr);
			$user[] = $res_all;
		}
		return $user;
	}else{
		$sql="select s.uid,b.mainimg,s.images_ischeck,s.gender 
		      	from {$dbTablePre}members_search s 
		      	left join {$dbTablePre}members_base b on s.uid=b.uid
		      	where s.uid in (" . $uid_list . ") limit 4";
		return $_MooClass['MooMySQL']->getAll($sql,false,true,3600);
	}
}
Exemplo n.º 11
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');
}
Exemplo n.º 12
0
$uid = $userid = $MooUid;
//模块判断
if (!in_array($name, $names)) {
    MooMessage('没有这个页面', 'index.php', '01');
}
//时间相关
if ($uid) {
    //更新COOKIE 成活时间
    MooUpateCookie($uid);
    $new_email_num = header_show_total($uid);
}
//获取皮肤名称
$style_uid = MooGetGPC('uid', 'integer', 'G');
$skiname = MooGetGPC('skiname', 'string', 'G');
//新邮件数
if (!empty($style_uid) && $style_uid != $uid) {
    //采用他人的样式
    if (MOOPHP_ALLOW_FASTDB) {
        $style_user_arr = MooFastdbGet('members', 'uid', $style_uid);
    } else {
        $style_user_arr = $_MooClass['MooMySQL']->getOne("select * from " . $dbTablePre . "members where uid='" . $style_uid . "' and is_lock = '1'");
    }
} 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();
Exemplo n.º 13
0
Arquivo: ajax.php Projeto: noikiy/zays
function make($uid, $usertype)
{
    global $_MooClass, $dbTablePre, $timestamp, $memcached;
    $time = time();
    $randdo = rand(1, 10);
    if ($randdo > 8) {
        return 0;
    } elseif ($randdo > 5) {
        //省内
        $address = "province";
    } else {
        //本市
        $address = "ctiy";
    }
    $lastmake = $memcached->get('lastmake' . $GLOBALS['MooUid']);
    if (empty($lastmake)) {
        $memcached->set('lastmake' . $GLOBALS['MooUid'], $time);
    } else {
        if ($lastmake + rand(100, 180) > $time) {
            return 0;
        } else {
            $memcached->replace('lastmake' . $GLOBALS['MooUid'], $time);
        }
    }
    //note 当前会员工作地
    if (MOOPHP_ALLOW_FASTDB) {
        $current_user = MooFastdbGet('members_search', 'uid', $uid);
    } else {
        $current_user = $_MooClass['MooMySQL']->getOne("select province,city,gender,birthyear from {$dbTablePre}members_search where uid='{$uid}'");
    }
    //note 与当前会员在同一工作地或同一省的会员
    $fgender = $current_user['gender'] == '0' ? '1' : '0';
    //取当前用户相反性别
    //note 与会员年龄上下相差5岁左右的
    if ($fgender == 1) {
        $age1 = $current_user['birthyear'] - 1;
        $age2 = $current_user['birthyear'] + 9;
    } else {
        $age1 = $current_user['birthyear'] - 9;
        $age2 = $current_user['birthyear'] + 1;
    }
    MooPlugins('ipdata');
    $ip = GetIP();
    $user_address = convertIp($ip);
    //$user_address="安徽省合肥市 电信";
    include "ework/include/crontab_config.php";
    foreach ($provice_list as $key => $provice_arr) {
        if (strpos($user_address, $provice_arr) !== false) {
            $province = $key;
            break;
        }
    }
    if (!$province) {
        $province = $current_user['province'];
    }
    $age_between = " AND mes1.birthyear>='{$age1}' AND mes1.birthyear<='{$age2}'";
    if ($fgender == '0') {
        //if($usertype=='1'){
        //$sql = "SELECT count(1) AS num FROM {$dbTablePre}membersfastsort_man WHERE  province='{$province}'  AND birthyear>='$age1' AND birthyear<='$age2' and images_ischeck=1";
        //}else{
        $sql = "SELECT count(1) AS num FROM {$dbTablePre}members_search WHERE  province='{$province}'  AND birthyear>='{$age1}' AND birthyear<='{$age2}' and images_ischeck=1 and usertype=1";
        //}
    }
    if ($fgender == '1') {
        //if($usertype=='1'){//普通会员
        //$sql = "SELECT count(1) AS num FROM {$dbTablePre}membersfastsort_women WHERE  province='{$province}'  AND birthyear>='$age1' AND birthyear<='$age2' and images_ischeck=1";
        //}else{//高级会员产生的浏览为本站的
        $sql = "SELECT count(1) AS num FROM {$dbTablePre}members_search WHERE  province='{$province}'  AND birthyear>='{$age1}' AND birthyear<='{$age2}' and images_ischeck=1 and usertype=1";
        //}
    }
    if (MOOPHP_ALLOW_FASTDB) {
        global $fastdb;
        $md5_sql1 = md5($sql);
        $inprovince = unserialize($fastdb->get($md5_sql1));
        if (!$inprovince || $inprovince['last_time'] < time()) {
            $inprovince = $_MooClass['MooMySQL']->getOne($sql);
            $inprovince['last_time'] = time() + 3600 * 24 * 7;
            $fastdb->set($md5_sql1, serialize($inprovince));
        }
    } else {
        $inprovince = $_MooClass['MooMySQL']->getOne($sql);
    }
    $rand = $inprovince['num'] > 60 ? $inprovince['num'] : 30000;
    $rand = mt_rand(1, $rand);
    $arrUser = array();
    /*if($inprovince['num']>60){	
    		if($fgender == '0'){
    			//if($usertype=='1'){
    				//$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}membersfastsort_man AS mes1 WHERE   (mes1.province='{$province}') and mes1.is_lock=1  $age_between and images_ischeck=1  LIMIT {$rand},1";
    			//}else{
    				$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}members_search AS mes1 WHERE   (mes1.province='{$province}') and mes1.is_lock=1  $age_between and images_ischeck=1 and usertype=1 LIMIT {$rand},1";
    			//}
    		}
    		
    		if($fgender == '1'){
    			//if($usertype=='1'){
    				//$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}membersfastsort_women AS mes1 WHERE   (mes1.province='{$province}') and mes1.is_lock=1  $age_between and images_ischeck=1 LIMIT {$rand},1";
    			//}else{				
    				$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}members_search AS mes1 WHERE   (mes1.province='{$province}') and mes1.is_lock=1  $age_between and images_ischeck=1 and usertype=1 LIMIT {$rand},1";
    			//}
    		}
    
    		$arrUser = $_MooClass['MooMySQL']->getOne($sql);//mes1.uid >= mes2.uid		
        }else{
    		if($fgender == '0'){
    			//if($usertype=='1'){
    				//$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}membersfastsort_man AS mes1 WHERE   mes1.is_lock=1  $age_between and images_ischeck=1 LIMIT {$rand},1";
    			//}else{				
    				$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}members_search AS mes1 WHERE   mes1.is_lock=1  $age_between and images_ischeck=1 and usertype=1 LIMIT {$rand},1";
    			//}
    		}
    		
    		if($fgender == '1'){
    			//if($usertype=='1'){
    				//$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}membersfastsort_women AS mes1 WHERE   mes1.is_lock=1  $age_between and images_ischeck=1 LIMIT {$rand},1";
    			//}else{				
    				$sql = "SELECT mes1.uid as uid FROM {$dbTablePre}members_search AS mes1 WHERE   mes1.is_lock=1  $age_between and images_ischeck=1 and usertype=1 LIMIT {$rand},1";
    			//}
    		}		
    		$arrUser = $_MooClass['MooMySQL']->getOne($sql);//mes1.uid >= mes2.uid
    		
    	}*/
    $cl = searchApi('members_man members_women');
    if ($user['num'] > 60) {
        if ($fgender == '0' || $fgender == '1') {
            $cond[] = array('gender', $fgender, false);
            $cond[] = array('is_lock', '1', false);
            $cond[] = array('province', $province, false);
            $cond[] = array('birthyear', array($age1, $age2), false);
            $cond[] = array('images_ischeck', '1', false);
            $cond[] = array('showinformation', '1', false);
            if (!empty($current_user) && $current_user['s_cid'] < 40) {
                $cond[] = array('usertype', '1', false);
            } else {
                $cond[] = array('usertype', '3', false);
            }
            $sort = 'city desc';
            $rs_total = $cl->getResult($cond, array(), $sort);
            if ($rs_total['total_found'] >= 1) {
                $rand = mt_rand(1, $rs_total['total_found']);
            }
            $limit = array($rand, 1);
            $rs = $cl->getResult($cond, $limit, $sort);
        }
    } else {
        if ($fgender == '0' || $fgender == '1') {
            $cond[] = array('gender', $fgender, false);
            $cond[] = array('is_lock', '1', false);
            //$cond[] = array('province',$province,false);
            $cond[] = array('birthyear', array($age1, $age2), false);
            $cond[] = array('images_ischeck', '1', false);
            $cond[] = array('showinformation', '1', false);
            if (!empty($current_user) && $current_user['s_cid'] < 40) {
                $cond[] = array('usertype', '1', false);
            } else {
                $cond[] = array('usertype', '3', false);
            }
            $sort = 'province desc,city desc';
            $rs_total = $cl->getResult($cond, array(), $sort);
            if ($rs_total['total_found'] >= 1) {
                $rand = mt_rand(1, $rs_total['total_found']);
            }
            $limit = array($rand, 1);
            $rs = $cl->getResult($cond, $limit, $sort);
        }
    }
    if (is_array($rs) && isset($rs['matches']) && !empty($rs['matches'])) {
        $ids = $cl->getIds();
        //print_r($ids);
        if (!empty($ids)) {
            $arrUser['uid'] = $ids[0];
        }
        //$arrUser = $_MooClass ['MooMySQL']->getOne($sql,true);
    }
    if ($arrUser && !MooGetScreen($arrUser['uid'], $uid)) {
        $nowtime = time();
        if (MOOPHP_ALLOW_FASTDB) {
            $user = MooFastdbGet('members_search', 'uid', $arrUser['uid']);
            $time = time() - 600;
            if ($user['lastvisit'] < $time) {
                $_MooClass['MooMySQL']->query("UPDATE `{$dbTablePre}members_login` SET `lastvisit`=" . $nowtime . " WHERE `uid`=" . $arrUser['uid']);
            }
            $val = array();
            $val['lastvisit'] = $nowtime;
            MooFastdbUpdate('members_login', 'uid', $arrUser['uid'], $val);
            //!!
        } else {
            $_MooClass['MooMySQL']->query("UPDATE `{$dbTablePre}members_login` SET `lastvisit`=" . $nowtime . " WHERE `uid`=" . $arrUser['uid']);
        }
        $result = $_MooClass['MooMySQL']->getOne("SELECT `vid` FROM `{$dbTablePre}service_visitor` WHERE uid='{$arrUser['uid']}' AND visitorid='{$uid}' AND `who_del`!=2");
        if ($result['vid']) {
            $_MooClass['MooMySQL']->query("UPDATE `{$dbTablePre}service_visitor` SET `visitortime`='{$nowtime}' WHERE `vid`={$result['vid']}");
        } else {
            $_MooClass['MooMySQL']->query("INSERT INTO `{$dbTablePre}service_visitor` SET `uid`='{$arrUser['uid']}',`visitorid`='{$GLOBALS['MooUid']}',`visitortime`='{$nowtime}',`who_del`=1");
        }
    }
    /*	return 	$arrUser?$arrUser:0;*/
}
Exemplo n.º 14
0
function report($uid)
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $timestamp;
    $serverid = Moo_is_kefu();
    if ($serverid && $user_arr['usertype'] != 3) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //处理会员提交了数据
    if (MooGetGPC('reportbutton', 'string', 'P')) {
        $u_id = safeFilter(MooGetGPC('uid', 'string', 'P'));
        $ruid = safeFilter(MooGetGPC('ruid', 'string', 'P'));
        $forwhy = MooGetGPC('forwhy', 'integer', 'P');
        $umail = safeFilter(MooGetGPC('umail', 'string', 'P'));
        $content = safeFilter(MooGetGPC('content', 'string', 'P'));
        if ($forwhy == '0') {
            MooMessage('请选择您的举报原因', 'javascript:history.go(-1);');
            exit;
        }
        if (rtrim($content) == '') {
            MooMessage('请选择您的举报内容', 'javascript:history.go(-1);');
            exit;
        }
        //note 上传图片
        if ($_FILES['pic']['size'] <= 5242880 && !empty($_FILES['pic']['size'])) {
            $extname = strtolower(substr($_FILES['pic']['name'], strrpos($_FILES['pic']['name'], '.') + 1));
            //note 判断上传的文件类型
            $flag = '';
            $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP');
            //foreach($images as $v) {
            //if(preg_match("/$v/",$_FILES['pic']['type'])) {
            $img_type = explode("/", $_FILES['pic']['type']);
            if (in_array($img_type[1], $images) && in_array($extname, $images)) {
                $flag = 1;
            }
            //}
            if ($flag != 1) {
                $notice = "照片必须为BMP,JPG,PNG或GIF格式";
                MooMessage($notice, 'javascript:history.go(-1);');
                exit;
            }
            //note 上传到指定目录,并且获得上传后的文件描述
            $upload = MooAutoLoad('MooUpload');
            $upload->config(array('targetDir' => REPORT_IMG_PATH, 'saveType' => '0'));
            $files = $upload->saveFiles('pic');
            $report_picname = $files[0]['name'] . "." . $files[0]['extension'];
            //note 提交举报数据
            $_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,pic,addtime) values ('{$u_id}','{$ruid}','{$forwhy}','{$umail}','{$content}','{$report_picname}','" . time() . "')");
            //note 没有上传图片
        } else {
            if ($_FILES['pic']['size'] > 5242880) {
                MooMessage('上传图片大小不能超过5M', 'javascript:history.go(-1);');
            } else {
                MooMessage('必须上传图片作为举报证据', 'javascript:history.go(-1);');
            }
            //note 提交举报数据
            //$_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,addtime) values ('$u_id','$ruid','$forwhy','$umail','$content','".time()."')");
        }
        //************提醒所属客服**************
        $sid = $user_arr['sid'];
        $title = '您的会员 ' . $user_arr['uid'] . ' 举报了 ' . $ruid;
        $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);
        MooMessage('举报成功', 'javascript:history.go(-2);');
        exit;
    }
    //note 两天内对同一位会员投诉只限一次
    $reportcount1 = $_MooClass['MooMySQL']->getOne("select id from {$dbTablePre}report where uid='{$userid}' and ruid='{$uid}' and addtime>" . mktime(0, 0, 0, date('m', time() - 86400), date('d', time() - 86400), date('Y', time() - 86400)));
    if ($reportcount1) {
        MooMessage('对不起,您两天内对同一位会员投诉只限一次', 'javascript:history.go(-1);', '02');
        exit;
    } else {
        //note 第天只能投诉5位会员
        $reportcount = $_MooClass['MooMySQL']->getOne("select count(*) from {$dbTablePre}report where uid='{$userid}' and addtime>" . mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time())));
        if ($reportcount['count(*)'] >= 5) {
            MooMessage('对不起,您每天只能对5位不同的会员进行投诉', 'javascript:history.go(-1);', '02');
            exit;
        }
    }
    //被投诉人不可能是自己
    if ($userid == $uid) {
        MooMessage('不可以举报自己', 'javascript:history.go(-1);', '03');
    }
    //被投诉人信息
    if (MOOPHP_ALLOW_FASTDB) {
        $userinfo = MooFastdbGet('members_search', 'uid', $uid);
    } else {
        $userinfo = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid  where uid='{$uid}'");
    }
    $sql = "select count(*) as c from {$dbTablePre}pic where uid='{$uid}' and isimage=0";
    $pic_num = $_MooClass['MooMySQL']->getOne($sql);
    if (!$userinfo) {
        MooMessage('无此用户', 'javascript:history.go(-1);', '03');
        exit;
    }
    include MooTemplate('public/profile_index', 'module');
}
Exemplo n.º 15
0
function getUserinfo($member_inf)
{
    global $dbTablePre, $_MooClass;
    //print_r($member_inf);
    if (MOOPHP_ALLOW_FASTDB) {
        $mem_field = MooFastdbGet('members_base', 'uid', $member_inf['uid']);
    } else {
        $mem_field = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_base as mf WHERE uid='{$member_inf['uid']}'", true);
    }
    $member_info_all = array_merge($member_inf, $mem_field);
    //$user_info_num=getUserinfo($member_info);
    $info_array = array('nickname', 'telphone', 'gender', 'brithyear', 'brithmonth', 'brithday', 'province', 'city', 'marriage', 'education', 'salary', 'house', 'children', 'height', 'oldsex', 'mainimg', 'truename', 'nature', 'weight', 'body', 'naimalyear', 'constellation', 'bloodtype', 'hometownprovince', 'hometowncity', 'nation', 'religion', 'finishschool', 'family', 'language', 'smoking', 'drinking', 'occupation', 'vehicle', 'corptype', 'wantchildren', 'fondfood', 'fondplace', 'fondactivity', 'fondsports', 'fondmusic', 'fondprogram', 'blacklist', 'qq', 'msn', 'currentprovince', 'currentcity', 'friendprovince');
    foreach ($info_array as $v) {
        if ($member_info_all[$v]) {
            $i++;
        }
    }
    return (int) ($i / 48 * 100);
    //echo count($info_array);
}
Exemplo n.º 16
0
function check_introduce()
{
    $uidlist = MooGetGPC('uidlist', 'string', 'G');
    if (empty($uidlist)) {
        salert('请选择审核的会员ID', 'index.php?action=check&h=monolog');
    }
    $uid_arr = explode(',', $uidlist);
    foreach ($uid_arr as $v) {
        $sql = "UPDATE {$GLOBALS['dbTablePre']}choice SET `introduce`=`introduce_check`,`introduce_check`='',`introduce_pass`='1' WHERE `uid`='{$v}'";
        $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        if (MOOPHP_ALLOW_FASTDB) {
            $old_introduce = MooFastdbGet("choice", 'uid', $v);
            $value['introduce'] = $old_introduce['introduce_check'];
            $value['introduce_chack'] = '';
            $value['introduce_pass'] = 1;
            MooFastdbUpdate("choice", 'uid', $uid, $value);
        }
        sendusermessage($uid, "尊敬的红娘会员,您的内心独白已经过红娘的审核", "内心独白审核");
        $alert = '内心独白审核通过';
        serverlog(3, $dbTablePre . "choice", $GLOBALS['username'] . "批量审核会员" . $uid . "的内心独白", $GLOBALS['adminid'], $v['uid']);
    }
    salert('审核成功', 'index.php?action=check&h=monolog');
}
Exemplo n.º 17
0
Arquivo: ajax.php Projeto: noikiy/zays
function ajax_check_introduce()
{
    global $dbTablePre;
    $ajax = MooGetGPC('ajax', 'integer', 'P');
    $pass = MooGetGPC('pass', 'integer', 'P');
    $introduce = MooGetGPC('introduce', 'string', 'P');
    $uid = MooGetGPC('uid', 'integer', 'P');
    $sid = MooGetGPC('sid', 'integer', 'P');
    if (in_array($GLOBALS['groupid'], array('67', '70')) && $sid == 1) {
        echo -1;
        exit;
    }
    //审核内心独白
    if ($ajax == 1) {
        if ($pass == 1) {
            //审核通过
            $sql = "SELECT uid FROM {$GLOBALS['dbTablePre']}members_introduce where uid='{$uid}' and introduce_pass=1 and introduce!=''";
            $pass_have = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
            if (isset($pass_have['uid'])) {
                echo $pass;
                exit;
            }
            //已经审核通过的直接退出
            $sql = "UPDATE {$GLOBALS['dbTablePre']}members_introduce SET `introduce`=`introduce_check`,`introduce_check`='',`introduce_pass`='1' WHERE `uid`='{$uid}'";
            $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            serverlog(3, $dbTablePre . "members_introduce", $GLOBALS['username'] . "审核会员" . $uid . "的内心独白为通过", $GLOBALS['adminid'], $uid);
            if (MOOPHP_ALLOW_FASTDB) {
                $old_introduce = MooFastdbGet("members_introduce", 'uid', $uid);
                $value['introduce'] = $old_introduce['introduce_check'];
                $value['introduce_check'] = '';
                $value['introduce_pass'] = 1;
                MooFastdbUpdate("members_introduce", 'uid', $uid, $value);
            }
        } else {
            //审核不通过
            $sql = "UPDATE {$GLOBALS['dbTablePre']}members_introduce SET `introduce_check`=`introduce`,`introduce`='',`introduce_pass`='0' WHERE `uid`='{$uid}'";
            $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            serverlog(3, $dbTablePre . "members_introduce", $GLOBALS['username'] . "审核会员" . $uid . "的内心独白为不通过", $GLOBALS['adminid'], $uid);
            if (MOOPHP_ALLOW_FASTDB) {
                $value['introduce'] = '';
                $value['introduce_check'] = '';
                $value['introduce_pass'] = 0;
                MooFastdbUpdate("members_introduce", 'uid', $uid, $value);
            }
        }
        echo $pass;
        exit;
    }
    //修改内心独白
    if ($ajax == 2) {
        /* $updatecarr = array();
        			$updatecarr['introduce_check'] = $introduce;
        						
        			$where_arr=array('uid'=>$uid);
        			updatetable('members_introduce',$updatecarr,$where_arr);
        			
        			//更新缓存
        			if(MOOPHP_ALLOW_FASTDB){
        				$value['introduce_check'] = $introduce;
        				MooFastdbUpdate("members_introduce",'uid',$uid,$value);
        			}
        			echo 'ok';exit; */
        //修改内心独白并提交
        $updatecarr = array();
        $updatecarr['introduce'] = $introduce;
        $updatecarr['introduce_check'] = '';
        $updatecarr['introduce_pass'] = '******';
        $where_arr = array('uid' => $uid);
        updatetable('members_introduce', $updatecarr, $where_arr);
        //更新缓存
        if (MOOPHP_ALLOW_FASTDB) {
            $value['introduce'] = $introduce;
            $value['introduce_check'] = '';
            $value['introduce_pass'] = '******';
            MooFastdbUpdate("members_introduce", 'uid', $uid, $value);
        }
        echo 1;
        exit;
    }
    //提醒
    if ($introduce != '' || $pass == 1) {
        sendusermessage($uid, "尊敬的红娘会员,您的内心独白已经过红娘的审核", "内心独白审核");
    } else {
        sendusermessage($uid, "尊敬的红娘会员,您的内心独白不符合要求,请按要求填写", "内心独白审核");
    }
    serverlog(3, $dbTablePre . "members_introduce", $GLOBALS['username'] . "审核会员" . $uid . "的内心独白", $GLOBALS['adminid'], $uid);
}
Exemplo n.º 18
0
/**
@param 给会员加鲜花
@param $uid 会员ID
@param $num 默认加一朵鲜花
@param return null
*/
function MooAddRose($uid, $num = 1)
{
    global $_MooClass, $dbTablePre;
    if ($uid) {
        $_MooClass['MooMySQL']->query("update {$dbTablePre}members_base set rosenumber = rosenumber+{$num} where uid = {$uid} and is_lock = 1");
        if (MOOPHP_ALLOW_FASTDB) {
            $user_inf = MooFastdbGet('members_base', 'uid', $uid);
            $value['rosenumber'] = $user_inf['rosenumber'] + $num;
            MooFastdbUpdate('members_base', 'uid', $uid, $value);
        }
    }
}
Exemplo n.º 19
0
function material_password_two($password)
{
    global $_MooClass, $dbTablePre, $user_arr;
    $uid = $user_arr['uid'];
    $userinfo = $user_arr;
    $date = explode('-', $userinfo['birth']);
    $userinfo['birthmonth'] = $date['1'];
    $userinfo['birthday'] = $date['2'];
    $callno = explode("-", $userinfo['callno']);
    if (MOOPHP_ALLOW_FASTDB) {
        $sta = MooFastdbGet('certification', 'uid', $uid);
    } else {
        $sta = $_MooClass['MooMySQL']->getOne("select email,telphone from {$dbTablePre}certification WHERE uid='{$uid}'", true);
    }
    include MooTemplate('public/material_password_two', 'module');
    exit;
}
Exemplo n.º 20
0
Arquivo: rose.php Projeto: noikiy/zays
function send_rose()
{
    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);
    //note 自己不能给自己发送玫瑰,直接转到玫瑰列表页面
    if ($userid == $sendtoid) {
        MooMessage('自己不可以给自己送鲜花', "index.php?n=service&h=rose&t=getmorerose");
        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");
        exit;
    }
    //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可给同性发送鲜花', 'javascript:history.go(-1);');
        exit;
    }
    //note 如果自己没有玫瑰花了,就提示没有玫瑰花了
    if ($user['rosenumber'] <= 0) {
        MooMessage('您没有鲜花了,获取更多鲜花', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid  where s.uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("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 = '{$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_rosetpl', 'module');
    //模板
    $body = ob_get_clean();
    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");
    if ($user['rosenumber'] > 0) {
        if ($leer['rid']) {
            $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 发送一朵玫瑰,自己就要减少一朵玫瑰
        //enkytest
        //enkytestend
        $_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");
            $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;
    }
    if ($res['is_phone']) {
        SendMsg($res['telphone'], "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花,请及时把握您的缘分!4006780405");
    }
    //提醒所属客服
    $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);
    MooMessage('发送鲜花成功' . $note, "index.php?n=service&h=rose&t=isendrose", "05");
    require MooTemplate('public/service_rose_sendrose', 'module');
}
Exemplo n.º 21
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');
}
Exemplo n.º 22
0
function service_dating()
{
    global $_MooClass, $dbTablePre, $user, $userid, $user_arr;
    if (MOOPHP_ALLOW_FASTDB) {
        $userchoice = MooFastdbGet('members_choice', 'uid', $userid);
    } else {
        $userchoice = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_choice WHERE uid = '{$userid}'");
    }
    if ($_POST) {
        $choice['age1'] = MooGetGPC('dating_age1', 'integer', 'P');
        $choice['age2'] = MooGetGPC('dating_age2', 'integer', 'P');
        $choice['workprovince'] = MooGetGPC('workProvince', 'integer', 'P');
        $choice['workcity'] = MooGetGPC('workCity', 'integer', 'P');
        $choice['salary'] = MooGetGPC('salary', 'integer', 'P');
        $choice['marriage'] = MooGetGPC('marriage2', 'integer', 'P');
        updatetable('members_choice', $choice, array('uid' => $userid));
        $param['uid'] = $userid;
        $param['nickname'] = $user_arr['nickname'];
        $param['subject'] = MooGetGPC('subject', 'string', 'P');
        $param['content'] = MooGetGPC('content', 'string', 'P');
        $param['dating_province'] = MooGetGPC('dating_province', 'string', 'P');
        $param['dating_city'] = MooGetGPC('dating_city', 'integer', 'P');
        $param['how_to_go'] = MooGetGPC('how_to_go', 'integer', 'P');
        $param['how_to_return'] = MooGetGPC('how_to_return', 'integer', 'P');
        $param['fee_assign'] = MooGetGPC('fee_assign', 'integer', 'P');
        $param['expire_time'] = MooGetGPC('expire_time', 'string', 'P');
        $param['dateline'] = $GLOBALS['timestamp'];
        inserttable('dating', $param);
        MooMessage('您的约会申请已提交!您的资料页面正在被其他会员浏览,请尽快完善资料,获得更多的约会机会。 ', 'index.php?n=service&h=mydating');
    }
    require MooTemplate('public/service_dating', 'module');
}
Exemplo n.º 23
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;
    }
    //测试用的 by hwt
    if ($_POST['sendleer']) {
        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}' ");
        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}'");
        }
        $send_user_info = $_MooClass['MooMySQL']->getOne("select * from `{$dbTablePre}members` a  left join  {$dbTablePre}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 = $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_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;
        }
        /*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;
        MooMessage('发送秋波成功', 'index.php?n=service&h=leertest&t=sendnewleer');
    } else {
        $sql = "SELECT content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
        $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
        require MooTemplate('public/service_leer_sendnewleer', 'module');
    }
}
Exemplo n.º 24
0
Arquivo: ajax.php Projeto: noikiy/zays
<?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 ($server['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() . "')");
    }
}
Exemplo n.º 25
0
/**
 * 登录首页
 * 描述:
 * 
 */
function index_index()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $uuid;
    $womenList = array('30407189', '21186208', '21199933', '20686096', '20223069', '20069562', '21156987', '21023025', '21206132', '21201459', '21161703', '20619161', '20301718', '20719091', '21740236', '20681292', '21424242', '20554506', '20111310', '20660269', '30632759', '30631960', '30630519', '30608962', '30387074', '30378615', '30360483', '30300309', '30252809', '30214641');
    $manList = array('30391348', '21793878', '30129941', '21514524', '30087732', '30621435', '30071838', '30610492', '30619608', '30080561', '30403838', '30211025', '30069490', '30359171', '30368726', '30405061', '30192000', '30069742', '30141451', '30052221', '30253012', '30016533', '30286293', '30247063', '30403530', '30365362', '21767568', '30341955', '21359517', '21708383', '30041513');
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
        $user_arr = MooMembersData($userid);
    }
    if ($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) {
        $gender = $user_arr['gender'] == 1 ? 0 : 1;
    } else {
        $gender = $_GET['gender'];
    }
    $sql_condition_province = $sql_condition_city = $province = '';
    $currentdistrict = '0';
    $arr_diamond_female = $arr_diamond_male = null;
    $provice_list = $city_list = $province_othercachefile = null;
    $s_cid = 40;
    //note 先初始化用户信息
    //MooUserInfo();
    //-------会员推荐------//
    $sex = !MooGetGPC('h', 'integer', 'G') ? 0 : 1;
    //note 性别
    $workprovince = MooGetGPC('workprovince', 'integer', 'G');
    //工作省份
    $workcity = MooGetGPC('workcity', 'integer', 'G');
    //工作城市
    if (in_array($workprovince, array(10101201, 10101002))) {
        //note 修正广东省深圳和广州的区域查询 2010-09-04
        $workcity = $workprovince;
        $workprovince = 10101000;
    }
    $age1 = MooGetGPC('age1', 'integer', 'G');
    //最小年龄
    $age2 = MooGetGPC('age2', 'integer', 'G');
    //最大年龄
    $gendersha = MooGetGPC('gender', 'integer', 'G');
    $userList = $userList2 = array();
    $index_total_user = 24;
    //首页总用户数
    //note 当前年份
    $year = date('Y');
    //登录用户查找性别
    $sql_gender = '';
    //$between = ' birthyear between ' . ($year-28).' and '.($year-22);
    //性别取反
    if ($GLOBALS['MooUid']) {
        $gender1 = $user_arr['gender'] == 1 ? 0 : 1;
        $sql_gender = " and s.gender='{$gender1}'";
        $sql_condition_province .= $sql_gender;
        $sql_condition_city .= " and s.gender='{$gender1}'";
    }
    $date_time = date('d');
    $month_time = date('m');
    $reguser_num = 30000 + $month_time * 1100 + $date_time * 191;
    //新加滚动文字
    /*$time_list = time();
    	$sql = "select content from {$dbTablePre}text_show where start_time<'$time_list' and end_time>'$time_list' order by reg_time desc limit 0,15";
    	$text_list = $_MooClass['MooMySQL']->getAll($sql);*/
    //显示男姓or显示女生搜索
    if (isset($workprovince) && isset($workcity) && isset($age1) && $age2) {
        //$sql = "select * from {$dbTablePre}members where gender=$sex and images_ischeck=1 ";
        include_once "./module/crontab/crontab_config.php";
        //note 从快速搜索表中查询
        if ($sex == '0') {
            $sql = "select uid from {$dbTablePre}members_search where  images_ischeck=1 and gender='0'";
        }
        if ($sex == '1') {
            $sql = "select uid from {$dbTablePre}members_search where images_ischeck=1 and gender='1'";
        }
        if ($workprovince != 0 && $workcity == 0) {
            //仅选择了省
            $sql .= " and province={$workprovince}";
        } elseif ($workprovince != 0 && $workcity != 0) {
            //选择了省市
            $sql .= " and province={$workprovince} and city={$workcity}";
        }
        if ($age1 != '0' && $age2 != '0') {
            if ($age1 < $age2) {
                //查找数据的年龄条件
                $between = $year - $age2 . ' and ' . ($year - $age1);
                $sql .= " and birthyear between {$between}";
            } else {
                //查找数据的年龄条件
                $between = $year - $age1 . ' and ' . ($year - $age2);
                $sql .= " and birthyear between {$between}";
            }
        }
        $sql .= " and is_lock = 1";
        //$sql .= " and is_lock = 1 limit 12";
        $sql .= " order by city_star desc,s_cid asc,bgtime desc ,pic_num desc limit 20";
        //var_dump($sql);exit;
        //note 查询出来的用户id写入缓存
        $md5 = md5($sql);
        $index_search = "type=query/name=userid_{$md5}/sql={$sql}/cachetime=86400";
        $_MooClass['MooCache']->getBlock($index_search);
        $userid = $GLOBALS['_MooBlock']["userid_{$md5}"];
        //查询为空则跳转到首页
        if (empty($userid)) {
            MooMessage("非常抱歉!没有您所找的会员!", 'index.php', '01');
            exit;
        }
        //note uid数组转换成字符串
        $index_img_num = 6;
        $index_img = index_img($currentdistrict, $index_img_num);
        $small_img_num = 3;
        $small_img = small_img($currentdistrict, $small_img_num, $workprovince);
        $user_arr1 = array();
        foreach ($userid as $v1) {
            $user_arr1[] = $v1['uid'];
        }
        //note 获得用户id
        $userid_list = implode(",", $user_arr1);
        $sql = "select s.uid,s.gender,s.images_ischeck,s.nickname,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid in ({$userid_list}) order by s.city_star desc, s.s_cid asc";
        //note 查询出来的用户信息写入缓存
        $md5 = md5($sql);
        $index_search = "type=query/name=userList_{$md5}/sql={$sql}/cachetime=86400";
        $_MooClass['MooCache']->getBlock($index_search);
        $userList = $GLOBALS['_MooBlock']["userList_{$md5}"];
    } else {
        //默认进入
        //包含配置文件
        include_once "./module/crontab/crontab_config.php";
        $cur_ip = GetIP();
        //		$cur_ip = "61.190.44.98";
        //		$cur_ip = "202.120.2.200";//上海ip
        //		$cur_ip = "218.202.206.102";//新疆ip
        //$cur_ip = "218.70.178.197"; //重庆
        //		$cur_ip="221.130.166.242";
        //$cur_ip="113.89.70.73"; //S深圳
        MooPlugins('ipdata');
        $ip_arr = convertIp($cur_ip);
        //得到省份对应的数值,查库
        $province = $city = "";
        foreach ($provice_list as $key => $val) {
            if (strstr($ip_arr, $val)) {
                $province = $key;
                $currentdistrict = $val;
                break;
            }
        }
        if (isset($_GET['province'])) {
            foreach ($provice_list as $key => $val) {
                if ($_GET['province'] == $key) {
                    $currentdistrict = $val;
                    $province = $key;
                    break;
                }
            }
        }
        $test = array();
        if (isset($currentdistrict)) {
            $index_img_num = 6;
            $index_img = index_img($currentdistrict, $index_img_num);
            $small_img_num = 3;
            $small_img = small_img($currentdistrict, $small_img_num, $province);
            $test = test($currentdistrict);
        }
        //得到市对应的城市代号
        foreach ($city_list as $city_key => $city_val) {
            if (strstr($ip_arr, $city_val)) {
                $city = $city_key;
                break;
            }
        }
        if (isset($_GET['province'])) {
            //默认快速查询没有进入
            if (isset($_GET['city2']) ? $_GET['city2'] : '') {
                $city = MooGetGPC('city2', 'integer', 'G');
            } else {
                $city = '0';
            }
            $province = MooGetGPC('province', 'integer', 'G');
            //note 修正广东省深圳和广州的区域查询
            if (in_array($province, array(10101201, 10101002))) {
                $city = $province;
                $province = 10101000;
            }
            //修正直辖市查询
            if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) {
                $city = '0';
            }
            $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'";
            $cachefile_list = $_MooClass['MooMySQL']->getAll($sql);
            foreach ($cachefile_list as $cachefile) {
                $cachefile['provincestarfile'] = rtrim($cachefile['provincestarfile'], '.data');
                if ($memcached->get($cachefile['provincestarfile'])) {
                    $memcached->delete($cachefile['provincestarfile']);
                }
                $cachefile['citystarfile'] = rtrim($cachefile['citystarfile'], '.data');
                if ($memcached->get($cachefile['citystarfile'])) {
                    $memcached->delete($cachefile['citystarfile']);
                }
                $cachefile['provinceotherfile'] = rtrim($cachefile['provinceotherfile'], '.data');
                if ($memcached->get($cachefile['provinceotherfile'])) {
                    $memcached->delete($cachefile['provinceotherfile']);
                }
            }
        }
        $userList = array();
        //查市城市之星
        //note 修正广东省深圳和广州的区域查询
        if (in_array($province, array(10101201, 10101002))) {
            $city = $province;
            $province = 10101000;
        }
        $sql_city = "s.city='{$city}'";
        //修正直辖市查询
        if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) {
            $city = '0';
        }
        if ($city == 0) {
            $sql_city = "s.province='{$province}'";
        }
        if (!empty($city) || !empty($province)) {
            //默认没有进入  选择省后进入
            $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid WHERE s.images_ischeck=1 and s.s_cid='20' or ({$sql_city} AND s.is_lock=1 AND s.images_ischeck=1 and s.nickname!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1) AND s.uid!=20752315 order by s.s_cid limit 32";
            //$sql = "SELECT s.uid,s.nickname,s.gender,s.s_cid,b.mainimg,s.images_ischeck,s.province,s.city,s.birthyear,s.city_star FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid WHERE  s.uid=21335105 or ({$sql_city} and s.is_lock=1 AND s.images_ischeck=1 and s.nickname!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1)   order by (case when  s.uid=21335105 then 1 ELSE 4 END) limit 20";
            //$userList = $_MooClass['MooMySQL']->getAll($sql);
            $param = "type=query/name=userlist_{$city}_citystar/sql={$sql}/cachetime=86400";
            $_MooClass['MooCache']->getBlock($param);
            //
            $userList = $GLOBALS['_MooBlock']["userlist_{$city}_citystar"];
            //市缓存文件
            $city_cachefile = "userlist_{$city}_citystar" . '_' . md5($param) . '.data';
        }
        //市无城市之星,从省取城市之星
        if (empty($userList)) {
            //默认进入
            //enky note
            /*$sql="select * from {$dbTablePre}members_base as b left join {$dbTablePre}members_search as s on b.uid=s.uid WHERE s.province='$province'
            		          AND s.is_lock=1  
            		          AND s.images_ischeck = 1 AND s.showinformation=1 
            		          and s.city_star>=1 and s.usertype=1 AND s.uid!=20752315 LIMIT 20";
            		*/
            $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg from  {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid WHERE s.province='{$province}'\n\t\t\t          AND s.is_lock=1  \n\t\t\t          AND s.images_ischeck = 1 AND s.showinformation=1 \n\t\t\t          and s.city_star>=1 and s.usertype=1 AND s.uid!=20752315 LIMIT 32";
            //			$userList = $_MooClass['MooMySQL']->getAll($sql);
            $param = "type=query/name=userlist_{$province}_provincestar/sql={$sql}/cachetime=86400";
            $_MooClass['MooCache']->getBlock($param);
            $userList = $GLOBALS['_MooBlock']["userlist_{$province}_provincestar"];
            //省缓存文件
            $province_cachefile = "userlist_{$province}_provincestar" . '_' . md5($param) . '.data';
        }
        //城市之星不够取钻石会员(市->省->全国)
        $count = count($userList);
        if ($count < 32) {
            //默认进入
            $addarr = array('cityadd', 'provinceadd', 'countryadd');
            $user_in = '1747188|2154375|1600591|2159633|20782701|20785837|20561126|20305660|20910184';
            //城市之星uid
            $user_list = array();
            if (!is_array($userList)) {
                $userList = array();
            }
            //enky add
            foreach ($userList as $user) {
                $user_list[] = $user['uid'];
            }
            if (!empty($user_list)) {
                $user_in .= ',' . implode('|', $user_list);
            }
            //从(市->省->全国)取钻石会员
            $cityadd = array();
            $provinceadd = array();
            $countryadd = array();
            foreach ($addarr as $add) {
                if ($count < 32) {
                    $id = '';
                    //从市取
                    if ($add == 'cityadd') {
                        if (!$city || $city == 0) {
                            continue;
                        }
                        $sql_add = "s.city='{$city}' and";
                        $id .= $city;
                    }
                    //从省取
                    if ($add == 'provinceadd') {
                        if (!$province || $province == 0) {
                            continue;
                        }
                        $sql_add = "s.province='{$province}' and";
                        $id .= $province;
                    }
                    //全国取
                    if ($add == 'countryadd') {
                        $sql_add = '';
                        $id .= 'country';
                    }
                    //取几个钻石会员
                    $add_query_sum = 32 - $count;
                    //enky need change
                    $cl = searchApi('members_women members_man');
                    $cond[] = array('is_lock', '1', false);
                    $cond[] = array('images_ischeck', '1', false);
                    $cond[] = array('usertype', '1', false);
                    $cond[] = array('@id', '20752315|' . $user_in, true);
                    //uid
                    $cond[] = array('s_cid', '20', false);
                    $cond[] = array('city_star', '0', false);
                    $cond[] = array('showinformation', '1', false);
                    $cond[] = array('pic_num', array(1, 20), false);
                    if ($province) {
                        array('province', $province, false);
                    }
                    if ($city) {
                        array('city', $city, false);
                    }
                    $limit = array($add_query_sum);
                    $res_matches = $cl->getResult($cond, $limit);
                    if ($res_matches) {
                        $count_res = count($res_matches);
                        $array_merge = array();
                        for ($i = 0; $i < $count_res; $i++) {
                            if (!empty($res_matches['matches'][$i])) {
                                $ids[] = $res_matches['matches'][$i]['id'];
                            }
                        }
                        $sql_str = implode(',', $ids);
                        $nickname_res = $_MooClass['MooMySQL']->getAll("select nickname,uid from web_members_search where uid in " . "({$sql_str})");
                        $mainimg_res = $_MooClass['MooMySQL']->getAll("select mainimg from web_members_base where uid in " . "({$sql_str})");
                        //合并到sphinx查询出的整理后的数组
                        for ($i = 0; $i < $count_res; $i++) {
                            if (!empty($res_matches['matches'][$i]['attrs'])) {
                                $res_matches['matches'][$i]['attrs']['nickname'] = $nickname_res[$i]['nickname'];
                                $res_matches['matches'][$i]['attrs']['uid'] = $nickname_res[$i]['uid'];
                                $res_matches['matches'][$i]['attrs']['mainimg'] = $mainimg_res[$i]['mainimg'];
                                $bigarr[] = $res_matches['matches'][$i]['attrs'];
                            }
                        }
                        ${$add} = $bigarr;
                    } else {
                        $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid  where s.uid not in({$user_in})\n\t\t\t\t\t          AND {$sql_add} s.city_star=0 AND s.s_cid = 20 \n\t\t\t\t\t          AND s.images_ischeck  = 1 AND s.is_lock = 1 AND s.showinformation = 1\n\t\t\t\t\t          AND s.pic_num >=1 AND s.usertype=1 AND s.uid!=20752315 \n\t\t\t\t\t          LIMIT {$add_query_sum}";
                        $param = "type=query/name=userlist_{$id}_other/sql={$sql}/cachetime=86400";
                        $_MooClass['MooCache']->getBlock($param);
                        ${$add} = $GLOBALS['_MooBlock']["userlist_{$id}_other"];
                    }
                    //已获取的首页会员uid
                    $user_list = array();
                    if (!is_array(${$add})) {
                        ${$add} = array();
                    }
                    //enky add
                    foreach (${$add} as $user) {
                        $user_list[] = $user['uid'];
                    }
                    if (!empty($user_list)) {
                        $user_in .= ',' . implode(',', $user_list);
                    }
                    //echo $user_in;exit;
                    //已有总数
                    $count += count(${$add});
                }
            }
            //$countryadd  have data
            $userList = array_merge($userList, $cityadd, $provinceadd, $countryadd);
            //省其它类型会员缓存文件
            $province_othercachefile = "userlist_{$id}_other" . '_' . md5($param) . '.data';
        }
        //生成的block缓存文件存库
        $city = $city ? $city : 0;
        $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'";
        $cache_arr = $_MooClass['MooMySQL']->getAll($sql);
        if (empty($cache_arr)) {
            $province_cachefile = isset($province_cachefile) ? $province_cachefile : '';
            $sql = "INSERT INTO {$dbTablePre}index_cachefile SET province='{$province}',city='{$city}',provincestarfile='{$province_cachefile}',citystarfile='{$city_cachefile}',provinceotherfile='{$province_othercachefile}'";
            $_MooClass['MooMySQL']->query($sql);
        }
        //推荐列表中如果存在,则以推荐列表中的指定的sort替换
        $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE province='{$province}' AND city='{$city}' order by sort asc";
        $recommend_list = $_MooClass['MooMySQL']->getAll($sql);
        if (!empty($recommend_list)) {
            foreach ($recommend_list as $list) {
                $sort = $list['sort'] < 1 ? 0 : $list['sort'] - 1;
                if (MOOPHP_ALLOW_FASTDB) {
                    $u = MooFastdbGet('members_search', 'uid', $list['uid']);
                    $u2 = MooFastdbGet('members_base', 'uid', $list['uid']);
                    if (is_array($u) && is_array($u2)) {
                        $u = array_merge($u, $u2);
                    }
                } else {
                    $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid WHERE s.uid='{$list['uid']}'";
                    $u = $_MooClass['MooMySQL']->getOne($sql, true);
                }
                if ($u) {
                    foreach ($userList as $key => $val) {
                        if ($list['uid'] == $val['uid']) {
                            $user_key = $key;
                            break;
                        }
                    }
                    if (isset($user_key)) {
                        if (isset($userList[$sort])) {
                            $userList[$key] = $userList[$sort];
                        }
                        $userList[$sort] = $u;
                    } else {
                        $userList[$sort] = $u;
                    }
                }
            }
        }
    }
    //删除数组中多余的部分
    //array_splice($userList, 24);
    foreach ($userList as $va) {
        if ($va['gender'] == $gender) {
            $newuser[] = $va['uid'];
        }
    }
    if (count($newuser) >= 12) {
        array_splice($newuser, 12);
    } else {
        $needn = 12 - count($newuser);
        if ($needn == 1) {
            $needn == 2;
        }
        if ($gender == 0) {
            $rand_keys = array_rand($manList, $needn);
            for ($i = 0; $i < $needn; $i++) {
                $newuser[] = $manList[$rand_keys[$i]];
            }
        } else {
            $rand_keys = array_rand($womenList, $needn);
            for ($i = 0; $i < $needn; $i++) {
                $newuser[] = $womenList[$rand_keys[$i]];
            }
        }
    }
    foreach ($newuser as $value) {
        $mainimg = MooGetphoto($value, $style = "com");
        $users[] = array('uid' => $value, 'mainimg' => $mainimg);
    }
    echo return_data($users);
    exit;
    /*
    foreach($users as $val){
        	$sha[] = $val['uid'];
        }
        $sha_in = implode(',', $sha);
        $sha_ar = $_MooClass['MooMySQL']->getAll("select nickname from web_members_search where uid in "."($sha_in)");
        foreach($sha_ar as $va){
        	echo $va['nickname'].'<br />';
        }
    exit; 
    */
    /*
    //最新注册会员,按照片数排序
    
    $param = ("type=query/name=new_members/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid   where  s.pic_num>4 and s.images_ischeck=1 and s.is_lock=1 order by s.uid desc limit 4/cachetime=10800");
    $_MooClass['MooCache']->getBlock($param);
    $new_reguser = $GLOBALS['_MooBlock']['new_members'];
    
    //note 钻石会员介绍    地区切换时真爱一生推荐会员涉及的
    $sql="select count(d.uid) as num from web_diamond_recommend d left join web_members_search s on d.uid=s.uid  where  d.isindex=1 and d.gender='1' and s.images_ischeck=1 and d.province='{$province}'";
    $result_female=$_MooClass['MooMySQL']->getOne($sql,true);
    $num_female=$result_female['num'];
    
    $sql="select count(d.uid) as num from web_diamond_recommend  d left join web_members_search s on d.uid=s.uid  where  d.isindex=1 and d.gender='0' and s.images_ischeck=1 and d.province='{$province}'";
        $result_male=$_MooClass['MooMySQL']->getOne($sql,true);
        $num_male=$result_male['num'];
        if ($num_female>=5 && $num_male>=5){
        	
       //女钻石会员
           $sql_female = "select d.uid,d.birthyear,d.province,d.city,d.nickname from {$dbTablePre}diamond_recommend  d left join web_members_search s on d.uid=s.uid  where d.isindex=1 and d.gender='1' and s.images_ischeck=1 and d.province='{$province}' order by d.city<>'{$city}' ,d.city desc,d.sort desc  limit 10"; //FEMAIL
           $param = ("type=query/name=web_star_recommend/sql=$sql_female/cachetime=86400");
           $_MooClass['MooCache']->getBlock($param);
           $arr_diamond_female = $GLOBALS['_MooBlock']['web_star_recommend'];
       
      
           
           //男钻石会员
           $sql_male = "select d.uid,d.birthyear,d.province,d.city,d.nickname from {$dbTablePre}diamond_recommend  d left join web_members_search s on d.uid=s.uid  where d.isindex=1 and d.gender='0' and s.images_ischeck=1 and d.province='{$province}' order by d.city<>'{$city}' ,d.city desc,d.sort desc limit 10"; //MAIL
           $param = ("type=query/name=web_star_recommend/sql=$sql_male/cachetime=86400");
           $_MooClass['MooCache']->getBlock($param);
           $arr_diamond_male = $GLOBALS['_MooBlock']['web_star_recommend'];
      
    }else{
    	$diamond_filename = "data/cache/diamond_intro.php";
        if(!file_exists($diamond_filename)){
            //女钻石会员
            $sql_female = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1' and m.gender='1'";
            $sql = $sql_female . " order by m.pic_num desc,m.bgtime desc limit 10";
            $arr_diamond_female = $_MooClass['MooMySQL']->getAll($sql);
            foreach($arr_diamond_female as $k=>$v){
                $diamond_str_female .= $v['uid'].','; 
            }
            
            //男钻石会员
            $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join  {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1' and m.gender='0'";
            $sql = $sql_male . " order by m.pic_num desc,m.bgtime desc limit 10";
            $arr_diamond_male = $_MooClass['MooMySQL']->getAll($sql);
            foreach($arr_diamond_male as $k=>$v){
                $diamond_str_male .= $v['uid'].','; 
            }
            
            $diamond_str=$diamond_str_female.$diamond_str_male;
           
            file_put_contents($diamond_filename,$diamond_str);
        }else{
        
            $arr_diamond = file($diamond_filename);
            
            if($arr_diamond){
            	
                $star_user = trim($arr_diamond[0],',');
                
                $star_user=explode(',',$star_user);
            
                if(count($star_user)==20){
                    $star_female=$star_user[0].','.$star_user[1].','.$star_user[2].','.$star_user[3].','.$star_user[4].','.$star_user[5].','.$star_user[6].','.$star_user[7].','.$star_user[8].','.$star_user[9];
                    //女钻石会员 enky need change
                    $sql_female = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid  left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in($star_female)  limit 10"; //FEMAIL
                    $param = ("type=query/name=web_star_recommend/sql=$sql_female/cachetime=86400");
                    $_MooClass['MooCache']->getBlock($param);
                    
                    $arr_diamond_female = $GLOBALS['_MooBlock']['web_star_recommend'];
                    
                    $star_male=$star_user[10].','.$star_user[11].','.$star_user[12].','.$star_user[13].','.$star_user[14].','.$star_user[15].','.$star_user[16].','.$star_user[17].','.$star_user[18].','.$star_user[19];
                    //男钻石会员 enky need change
                    $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid  left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in($star_male) limit 10"; //MAIL
                    $param = ("type=query/name=web_star_recommend/sql=$sql_male/cachetime=86400");
                    $_MooClass['MooCache']->getBlock($param);
                    $arr_diamond_male = $GLOBALS['_MooBlock']['web_star_recommend'];
                    
                }
            }
        }
    
    }
        
    
    //note 优秀真爱一生介绍
    //	include_once 'module/index/excellent.php';
    //	echo "<pre>";
    //	print_r($arrexcellent);
    //	echo "</pre>";
    //成功案例
    $param = ("type=query/name=story/sql=select s.sid,s.uid,s.title,s.content,s.name1,s.name2,s.story_date,sp.img from `{$dbTablePre}story` as s left join  `{$dbTablePre}story_pic` as sp on s.is_index=sp.mid where sp.syscheck=1 and s.syscheck=1 and s.recommand= '1' order by s.story_date desc,sp.img desc limit 0, 4/cachetime=600");
    $_MooClass['MooCache']->getBlock($param);
    $story = $GLOBALS['_MooBlock']['story'];
    MooPlugins('ipdata');	
    $ip = GetIP();
    //$ip = '119.145.41.181';
    $finally_ip = convertIp($ip);
    //$news_ip =iconv('gbk','utf-8',file_get_contents('http://fw.qq.com/ipaddress'));
    //$finally_ip = $news_ip;
    //echo $finally_ip; 
    if(preg_match('/(广东|广州|深圳|佛山|珠海|东莞|汕头|韶关|江门|湛江|茂名|肇庆|惠州|梅州|汕尾|河源|清远|阳江|潮州|揭阳|云浮)/',$finally_ip)){
    	$finally_address = 1;
    }
    $time = time();
    //活动时间
    $activitytime1 = "2011-02-01 00:30:00";
    $activitytime2 = "2011-02-08";
    
    if($time>=strtotime($activitytime1)&&$time<strtotime($activitytime2)) $appear = "1";
    // note 与相亲网首页错开会员
        $api = MooGetGPC('api','string', "G");  
        if($api == '0019'){ 
            $d = '';
            foreach($userList as $v){
                if($v['uid'] < 30000000){ 
                    $apistr .= $d.$v['uid'];
                    $d = ',';
                }
            }
            exit($apistr);
        }
    
    
    require MooTemplate('public/index', 'module');
    */
}
Exemplo n.º 26
0
Arquivo: ajax.php Projeto: noikiy/zays
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);
    }
}
Exemplo n.º 27
0
function certification($uid)
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    //note 查询会员诚信认证表
    if (MOOPHP_ALLOW_FASTDB) {
        $certificationMsg = MooFastdbGet('certification', 'uid', $uid);
    } else {
        $certificationMsg = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}certification where uid='{$uid}'");
    }
    return $certificationMsg;
}
Exemplo n.º 28
0
function getUserInfo($userid)
{
    global $_MooClass, $dbTablePre, $user_arr;
    if (MOOPHP_ALLOW_FASTDB) {
        $userInfo = MooFastdbGet('members_search', 'uid', $userid);
    } else {
        $sql = "select gender from " . $dbTablePre . "members_search where uid = " . $userid;
        $userInfo = $_MooClass['MooMySQL']->getOne($sql);
    }
    return $userInfo;
}
Exemplo n.º 29
0
function myaccount_speak()
{
    global $uid, $user_arr, $user, $last_login_time;
    //note 获得用户资料的完整度,以百分比显示makui
    if ($uid == $user_arr['uid']) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
        //echo $all_len;exit;
    }
    //note 获取验证信息
    if (MOOPHP_ALLOW_FASTDB) {
        $usercer = MooFastdbGet('certification', 'uid', $uid);
    } else {
        $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$uid}'");
    }
    //$cs_path = videoPathEncrypt();
    include MooTemplate('public/myaccount_speak', 'module');
}