示例#1
0
文件: index.php 项目: noikiy/zays
function getmyleers()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $memcached;
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    //分页
    if ($userid) {
        $page_per = 10;
        $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
        $page_url = preg_replace("/(&page=\\d+)/", "", $page_url);
        $page_now = MooGetGPC('page', 'integer', 'G');
        $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_leer WHERE receiveuid  = '{$userid}' and receive_del=0");
        $item_num = $temp['num'];
        $page_num = ceil($item_num / $page_per);
        //		if( $page_now > $page_num ) $page_now = $page_num;
        //		if( $page_now < 1 ) $page_now = 1;
        //读数据
        $start = ($page_now - 1) * $page_per;
        $leer = $_MooClass['MooMySQL']->getAll("SELECT senduid,stat FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0  ORDER BY receivetime desc LIMIT {$start},{$page_per}");
        if (empty($leer)) {
            $errors = "empty";
            echo return_data($errors);
            exit;
        }
        $sendid = array();
        if (!empty($leer)) {
            foreach ($leer as $k => $v) {
                $sendid[] = $v['senduid'];
            }
        }
        $send_uid = implode(',', $sendid);
        $senduser = $_MooClass['MooMySQL']->getAll("select s.uid, s.nickname,s.birthyear,s.marriage,s.education,s.province,s.city,s.salary, b.mainimg,l.* from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}service_leer l on s.uid=l.senduid where s.uid in({$send_uid}) and l.receiveuid = '{$userid}' and l.receive_del=0  ORDER BY l.receivetime desc");
        foreach ($senduser as $k => $v) {
            $mainimg = MooGetphoto($v['uid'], $style = "com");
            $v['mainimg'] = $mainimg;
            foreach ($leer as $val) {
                if ($v['uid'] == $val['senduid']) {
                    $v['stat'] = $val['stat'];
                }
            }
            $send_users[] = $v;
        }
        foreach ($leer as $key => $val) {
            foreach ($send_users as $va) {
                if ($val['senduid'] == $va['uid']) {
                    $send_sha[] = $va;
                }
            }
        }
        echo return_data($send_sha);
        exit;
    }
}
示例#2
0
文件: index.php 项目: noikiy/zays
function space_viewpro()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr, $val_arr, $style_user_arr, $diamond, $_MooCookie, $memcached;
    //$val_arr统计资料完善度
    //	$uid = $GLOBALS ['style_uid'];
    $uid = $_GET['other_uid'];
    $is_only_show = true;
    $status = array();
    //验证是否合法成功登陆
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $userid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($userid) {
        $userid = $mem_uid = $memcached->get('uid_' . $userid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $user_oth = MooMembersData($uid);
    //note 判断被浏览的会员是否存在
    $status = array_merge(MooMembersData($uid), MooGetData('members_login', 'uid', $uid));
    $user_per_num = getUserinfo_per($user_arr);
    $error = array();
    //*****************白名单*******************
    if ($uid != $userid) {
        $is_only_show = false;
    }
    //*****************白名单*******************
    if (empty($is_only_show)) {
        //if(MOOPHP_ALLOW_FASTDB && $status['is_lock'] != 1){//is_lock默认1不封锁用户,0则封锁
        if ($status['is_lock'] != 1) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
        }
        if (!$status) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
            //note 判断被浏览的用户是否允许其他会员查看他的资料
        } elseif (!$status['showinformation'] && $status['uid'] != $userid) {
            //showinformation默认1允许其他会员查看,0则不允许
            switch ($status['showinformation_val']) {
                //showinformation_val用户关闭资料的理由
                case 1:
                    $error = "此会员已找到正在交往的对象,故资料未公开";
                    echo return_data($error, FALSE);
                    exit;
                    break;
                case 2:
                    $error = "此会员已找到真爱,即将踏上红地毯,故资料未公开,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
                case 3:
                    $error = "此会员最近很忙,无法及时回复邮件,故资料未公开,转向我的真爱一生";
                    break;
                case 4:
                    $error = "此会员资料未公开,原因可能是TA已经找到真爱了,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
            }
        }
    }
    //note 浏览资料页面时候,写入谁浏览谁表,自己浏览自己的除外
    if ($userid && $uid && $userid != $uid) {
        //note 不让屏蔽的会员查看
        if (MooGetScreen($userid, $uid)) {
            $error = "由于特殊原因对方资料未公开,转向我的真爱一生";
            echo return_data($error, false);
            exit;
        }
        if ($user_oth['gender'] != $user_arr['gender']) {
            //service_visitor 某某会员浏览某某会员记录表
            $visitor = $_MooClass['MooMySQL']->getOne("SELECT vid FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND visitorid = '{$uid}'");
            //note 再次浏览的,更新浏览时间
            if ($visitor['vid']) {
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_visitor SET visitortime = '{$timestamp}' WHERE uid='{$userid}' AND visitorid = '{$uid}' limit 1");
            } else {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_visitor SET uid = '{$userid}',visitorid='{$uid}',visitortime = '{$timestamp}'");
            }
            if (MooUserIsOnline($uid)) {
                $browser = $_MooClass['MooMySQL']->getOne("SELECT id FROM {$dbTablePre}service_browser WHERE uid = '{$userid}' AND browserid = '{$uid}'");
                //note 再次浏览的,更新浏览时间
                if ($browser['id']) {
                    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_browser SET browsertime = '{$timestamp}' WHERE uid='{$userid}' AND browserid = '{$uid}' limit 1");
                } else {
                    $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_browser SET uid = '{$userid}',browserid='{$uid}',browsertime = '{$timestamp}'");
                }
            }
        }
    }
    //note 查看会员资料信息
    $c = MooGetData('members_choice', 'uid', $uid) + MooGetData('members_introduce', 'uid', $uid);
    $user =& $status;
    /***创建浏览队列 ***/
    if ($userid && $uid && $userid != $uid) {
        if ($user_oth['gender'] != $user_arr['gender'] && $user['uid'] != $userid) {
            if ($user['usertype'] == 3 && $user_arr['usertype'] != 3 && $user['showinformation'] == 1 && $user_arr['s_cid'] >= 40) {
                $iscan = $GLOBALS['fastdb']->get($userid . '_scan_space');
                //浏览的全权会员列表
                $iscan = empty($iscan) ? array() : json_decode($iscan, true);
                $iscan = in_array($uid, $iscan) ? $iscan : array_push($iscan, $uid);
                $GLOBALS['fastdb']->set($userid . '_scan_space', json_encode($iscan));
            }
            if ($user['usertype'] != 3) {
                $scan_i = $GLOBALS['fastdb']->get('scan_space_' . $uid);
                //访问的记录列表
                $scan_i = empty($scan_i) ? array() : json_decode($scan_i, true);
                if (!empty($scan_i)) {
                    $scan_s = array();
                    foreach ($scan_i as $k => $scan) {
                        $scan_s[$k] = $scan[0];
                    }
                    if (in_array($userid, $scan_s)) {
                        $scan_i[array_search($userid, $scan_s)] = array($userid, time());
                    } else {
                        array_push($scan_i, array($userid, time()));
                    }
                } else {
                    array_push($scan_i, array($userid, time()));
                }
                $GLOBALS['fastdb']->set('scan_space_' . $uid, json_encode($scan_i));
            }
        }
    }
    //note_显示相册中的普通照片
    $user_pic = $_MooClass['MooMySQL']->getAll("SELECT imgurl,pic_date,pic_name FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$uid}'");
    $user['pic'] = $user_pic;
    $gender = $user_arr['gender'] == '0' ? '1' : '0';
    //0为男,1为女
    $agebegin = date("Y") - $user_arr['birthyear'] - 3;
    $ageend = date("Y") - $user_arr['birthyear'] + 3;
    $workprovince = $user_arr['province'];
    $workcity = $user_arr['city'];
    $search_url = MOOPHP_URL . "/index.php?n=search&h=quick&gender=" . $gender . "&age_start=" . $agebegin . "&age_end=" . $ageend . "&workprovince=" . $workprovince . "&workcity=" . $workcity . "&isphoto=1&imageField=&quick_search=搜索";
    //note 您可能喜欢的人,匹配相同地区
    $able_like = $userid ? youAbleLike(5) : array();
    //note 获取会员认证证件
    //note 当查看其他个人主页时,当前浏览的主页条件是否匹配
    $user2 = false;
    if ($uid != "" && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $c2 = MooGetData('members_choice', 'uid', $userid);
        $user2 = MooMembersData($userid);
    }
    //note 获得用户资料的完整度,以百分比显示makui
    $all_len = 0;
    if ($uid == $user_arr['uid']) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    $user['all_len'] = $all_len;
    //note 匹配指数分数得出
    $mark = 0;
    if ($uid && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $cho = MooGetData('members_choice', 'uid', $user_arr['uid']);
        $year = isset($cho['birthyear']) ? $cho['birthyear'] : $user_arr['birthyear'];
        if ($year - 5 <= $user['birthyear'] && $user['birthyear'] <= $year + 5) {
            $mark_age = 9;
            $mark += 9;
        } else {
            $mark_age = 6;
            $mark += 6;
        }
        if ($cho['height1'] <= $user['height'] && $user['height'] <= $cho['height2']) {
            $mark_height = 7;
            $mark += 7;
        } else {
            $mark_height = 5;
            $mark += 5;
        }
        if ($cho['weight1'] <= $user['weight'] && $user['weight'] <= $cho['weight2']) {
            $mark_weight = 5;
            $mark += 5;
        } else {
            $mark_weight = 3;
            $mark += 3;
        }
        if ($cho['workprovince'] == $user['province']) {
            $mark_workprovince = 8;
            $mark += 8;
        } else {
            $mark_workprovince = 6;
            $mark += 6;
        }
        if ($cho['workcity'] == $user['city']) {
            $mark_workcity = 16;
            $mark += 16;
        } else {
            $mark_workcity = 5;
            $mark += 10;
        }
        if ($cho['education'] == $user['education']) {
            $mark_education = 8;
            $mark += 8;
        } else {
            $mark_education = 5;
            $mark += 5;
        }
        if ($cho['salary'] == $user['salary']) {
            $mark_salary = 9;
            $mark += 9;
        } else {
            $mark_salary = 7;
            $mark += 7;
        }
        if ($cho['marriage'] == $user['marriage']) {
            $mark_marriage = 8;
            $mark += 8;
        } else {
            $mark_marriage = 5;
            $mark += 5;
        }
        if ($cho['children'] == $user['children']) {
            $mark_children = 8;
            $mark += 8;
        } else {
            $mark_children = 6;
            $mark += 6;
        }
        if ($cho['drinking'] == $user['drinking']) {
            $mark_drinking = 5;
            $mark += 5;
        } else {
            $mark_drinking = 3;
            $mark += 3;
        }
        if ($cho['smoking'] == $user['smoking']) {
            $mark_smoking = 5;
            $mark += 5;
        } else {
            $mark_smoking = 2;
            $mark += 2;
        }
        if ($cho['body'] == $user['body']) {
            $mark_body = 6;
            $mark += 12;
        } else {
            $mark_body = 4;
            $mark += 8;
        }
    }
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    //note 检查绑定是否过期
    if ($user['isbind'] == 1) {
        $user['isbind'] = check_bind($user['bind_id']);
    }
    $activity = $_MooClass['MooMySQL']->getOne("SELECT uid,username,regtime,channel FROM {$dbTablePre}ahtv_reguser where  uid='{$uid}' and  isattend=1");
    //鲜花发送语
    if ($user_arr['gender'] == 0) {
        //boy
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=2 and isShow=1";
    } else {
        //girl
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
    }
    $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
    $users = array();
    $mainimg = MooGetphoto($status['uid'], $style = "com");
    $status['mainimg'] = $mainimg;
    $users['material'] = $status;
    $users['mating'] = $c;
    //资料完整度
    $users['inte'] = $user_per_num * 100;
    $users['inte'] = round($users['inte']);
    $users['material']['password'] = '';
    $users['material']['regip'] = '';
    $users['material']['qq'] = '';
    $users['material']['msn'] = '';
    $users['material']['telphone'] = '';
    $users['material']['username'] = '';
    if (empty($error)) {
        echo return_data($users);
        exit;
    } else {
        echo return_data($error, false);
        exit;
    }
}
示例#3
0
文件: index.php 项目: noikiy/zays
function ableLike($num = '12')
{
    global $_MooClass, $dbTablePre, $user_arr, $memcached, $userid;
    //note 你喜欢的人,以同地区条件查询,如果城市是0,就查询省,如果省为0就查询国家
    //note 在后面注册功能完善后,有了国家,就要判断国家
    //$user1 = UserInfo();
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $limit = 12;
    $page = $_GET['page'] = empty($_GET['page']) ? 0 : $_GET['page'];
    $user_arr = MooMembersData($userid);
    $user1 = $user_arr;
    $gender = $user1['gender'] == '1' ? '0' : '1';
    if (18 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 30 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 1;
    }
    if (31 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 35 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 2;
    }
    if (36 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 40 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 3;
    }
    if (41 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 50 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 4;
    }
    if (51 <= date("Y") - $user1['birthyear'] && date("Y") - $user1['birthyear'] <= 60 && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 5;
    }
    if (61 <= date("Y") - $user1['birthyear'] && $user1['birthyear'] != '' && $user1['birthyear'] != 0) {
        $age = 6;
    }
    if ($user1['birthyear'] == '' || $user1['birthyear'] == 0) {
        $age = 1;
    }
    if ($user1["province"] == '' || $user1["province"] == 0 || $user1["province"] == -1) {
        $user1["province"] = 10103000;
    }
    $file = $age . "_" . $gender . "_" . $user1["province"] . "_" . $user1["city"];
    //     $cache_file = MOOPHP_DATA_DIR.'/cache/cache_' . $file . '.php';
    $data = $memcached->get($file);
    if (!$data) {
        updateVoteFeel("", "", $user1['province'], $user1['city'], $age, $gender);
        $data = $memcached->get($file);
    }
    if (empty($data)) {
        $error = "empty";
        echo return_data($error, false);
        exit;
    }
    $offset = ($page - 1) * 12;
    $count = count($data);
    if ($limit > $count) {
        $limit = $count;
    }
    //		shuffle($data);
    $data = array_slice($data, $offset, $limit);
    for ($j = 0; $j < 12; $j++) {
        //if(MOOPHP_ALLOW_FASTDB){
        if (isset($data[$j])) {
            $able_like[$j] = MooMembersData($data[$j]);
        }
        //MooFastdbGet('members_search','uid',$data[$j]);
        //}
    }
    foreach ($able_like as $k => $u) {
        $mainimg = MooGetphoto($u['uid'], $style = "com");
        $users[] = array('uid' => $u['uid'], 'nickname' => $u['nickname'], 'birthyear' => $u['birthyear'], 'height' => $u['height'], 'salary' => $u['salary'], 'province' => $u['province'], 'city' => $u['city'], 'mainimg' => $mainimg, 'gender' => $u['gender']);
    }
    echo return_data($users);
    exit;
}
示例#4
0
文件: main.php 项目: noikiy/zays
<?php

include "module/andriod/function.php";
global $_MooClass, $dbTablePre, $userid, $memcached, $user_arr;
$status = array();
$uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
if ($uid) {
    $userid = $mem_uid = $memcached->get('uid_' . $uid);
}
$user_arr = MooMembersData($userid);
$and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
$checkuuid = check_uuid($and_uuid, $userid);
if (!$checkuuid) {
    $error = "uuid_error";
    echo return_data($error, false);
    exit;
}
//登录会员信息
if ($userid) {
    $sql = "select s.uid, s.birthyear, s.height, s.marriage, s.education, s.city, s.salary, s.certification, b.mainimg from {$dbTablePre}members_search s\n     left join {$dbTablePre}members_base b on b.uid = s.uid where s.uid = {$userid}";
    $user = $_MooClass['MooMySQL']->getOne($sql);
    $all_len = 0;
    if ($userid) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    echo $all_len;
    exit;
    $user['all_len'] = $all_len;
    $user['cer'] = get_integrity($user['certification']);
    echo return_data($user);
    exit;
示例#5
0
文件: leer.php 项目: noikiy/zays
function sendnewfl()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer', 'P');
    //
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $return = array();
    $is_first_send = true;
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        $error = "自己不可以给自己发过送鲜花";
        echo return_data($error, false);
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        //只能模拟全权会员
        $error = "对不起您不能模拟操作";
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        $error = "因特殊原因,送鲜花失败";
        echo return_data($error, false);
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        $error = "同性之间不可互发鲜花";
        echo return_data($error, false);
        exit;
        exit;
    }
    if ($user['rosenumber'] <= 0) {
        $error = '您没有鲜花了,获取更多鲜花';
        echo return_data($error, false);
        exit;
    }
    //
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    $res = MooMembersData($sendtoid);
    $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid));
    //头像路径
    $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
    //省
    $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板
    $body = ob_get_clean();
    if ($res['usertype'] != 3) {
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    //if(empty($uid)){
    //	MooMessage('您还没有登录','index.php?n=login');
    //}
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    //库中验证鲜花数
    //$rosenum_check =  $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1",true);
    //if($rosenum_check['rosenumber'] > 0) {
    if ($leer['rid']) {
        $is_first_send = false;
        $rid = $leer['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
    }
    //note 发送一朵玫瑰,自己就要减少一朵玫瑰
    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1", true);
        $value['rosenumber'] = $user_rosenum['rosenumber'];
        MooFastdbUpdate('members_base', 'uid', $userid, $value);
    }
    //}
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    $sendinfo = MooGetGPC('sendinfo', 'string', 'G');
    if (!empty($sendinfo)) {
        $sendinfo = ",对您说:" . $sendinfo;
    }
    if ($res['usertype'] != 3) {
        if ($serverid) {
            //客服模拟会员登录可以选择发送短信或彩信
            $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G');
            if ($SMStype == 'SMS' && $res['is_phone']) {
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            } elseif ($SMStype == 'CMS' && $res['is_phone']) {
                //====发送彩信   begin  ====
                //发送人有照片
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0";
                $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1";
                   $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/
                if ($sendfrom_user_info['uid']) {
                    $sendedMMSCount = $memcached->get('hznsimulate' . $serverid);
                    if (empty($sendedMMSCount)) {
                        $sendedMMSCount = 0;
                    }
                    //if($sendedMMSCount > 10){
                    //	MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose');
                    //}
                    send_mms_commission($res['telphone'], 'rose', $userid);
                    $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800);
                }
                //====发送彩信 end =====
            }
        } else {
            //真实会员登录
            if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) {
                //第一次发才短信提示
                // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo."     请及时把握您的缘分!4006780405");
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            }
        }
    }
    /*
    	$week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	//echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit;
    
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    		 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    		 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    		 if($cos[c] <= 1){
    			//fanglin暂时屏蔽
    			Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    		 }
    	}else{
    		  //echo $today_rose_count;exit;
    		  if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    			   $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    			   
               //print_r($cos);exit;
    			   if($cos[c]<5){
    				  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    				  //fanglin暂时屏蔽
    				  Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    			   }
    		}
    	}
    */
    /*
    	//发送彩信
    	$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
    	//$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'";
    	$sendout_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送人有照片
    	$sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1";
    	$sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
        
    	//echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit;
    	if($sendto_user_info['telphone']&&$sendout_user_info['uid']){
    		//echo 'ffff';exit;
    		if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){
    			$note="。";
    		}else{
    			$note="!";
    		}
    	}
    */
    /*普通会员对全权会员反馈白名单*/
    if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
        white_list($res['uid'], $user_arr['uid']);
    }
    /*客服模拟全权记录*/
    if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
        $action = '鲜花';
        fulllog($user_arr['uid'], $serverid, $action, $res);
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $return = "发送鲜花成功";
    echo return_data($return);
    exit;
    //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05");
    //require MooTemplate('public/service_rose_sendrose', 'module');
}
示例#6
0
文件: index.php 项目: noikiy/zays
function login_logout()
{
    global $_MooClass, $user_arr, $uuid, $memcached;
    //note 清空cookie,同时清空session表记录
    //clearcookie();
    //	MooClearCookie();
    $return = array();
    $and_uuid = $_GET['uuid'];
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $mem_uid);
    $uuid = $memcached->get('uuid_' . $mem_uid);
    if ($checkuuid) {
        $logout_uuid = $memcached->delete('uuid_' . $mem_uid);
        $logout_uid = $memcached->delete('uid_' . $mem_uid);
    }
    if ($logout_uuid && $logout_uid) {
        $return = "成功退出";
        echo return_data($return, true);
        exit;
    } else {
        $return = "uuid_error";
        echo return_data($return, false);
        exit;
    }
}
示例#7
0
文件: album.php 项目: noikiy/zays
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;
    }
}
示例#8
0
文件: liker.php 项目: noikiy/zays
function whovime()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $memcached;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $uuid = $memcached->get('uuid_' . $userid);
    //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid);
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $pagesize = 12;
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    //note 查出谁加我为意中人的总数
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2");
    $total = $ret_count['c'];
    if ($total > 200) {
        $total = 200;
    }
    //$total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE uid = '$userid'");
    //$total2 = $total2Arr['count(*)'];
    //note
    if ($total) {
        $friend = $_MooClass['MooMySQL']->getAll("SELECT uid,visitortime FROM {$dbTablePre}service_visitor WHERE  uid >0 and visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
    }
    $friendid = array();
    foreach ($friend as $k => $f) {
        $friendid[] = $f['uid'];
    }
    $frienduid = implode(',', $friendid);
    $frienduser = $_MooClass['MooMySQL']->getAll("select s.uid,s.nickname,s.birthyear,s.height,s.salary,s.province,s.city,b.mainimg,s.gender from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where s.uid=b.uid and s.uid in({$frienduid})");
    foreach ($friend as $key => $val) {
        foreach ($frienduser as $value) {
            if ($value['uid'] == $val['uid']) {
                $friend[$key]['visitortime'] = date("Y-m-d", $val['visitortime']);
                $friend[$key]['nickname'] = $value['nickname'];
                $friend[$key]['birthyear'] = $value['birthyear'];
                $friend[$key]['height'] = $value['height'];
                $friend[$key]['salary'] = $value['salary'];
                $friend[$key]['province'] = $value['province'];
                $friend[$key]['city'] = $value['city'];
                $friend[$key]['mainimg'] = $value['mainimg'];
                $friend[$key]['gender'] = $value['gender'];
            }
        }
    }
    echo return_data($friend);
    exit;
}
示例#9
0
文件: material.php 项目: noikiy/zays
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');
}
示例#10
0
文件: message.php 项目: noikiy/zays
function to_send_message()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $uuid = $memcached->get('uuid_' . $userid);
    //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid);
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $contentid = MooGetGPC('s_id', 'integer', 'P');
    //不可给同性别发送消息
    $receive_info = MooMembersData($contentid);
    $receive_gender = $receive_info['gender'];
    if ($user_arr['gender'] == $receive_gender) {
        $err = "不可给同性别发送消息";
        echo return_data($err, false);
        exit;
    }
    //系统管理员权限
    /*$result=$_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
      $groupid=$result['groupid'];
      
      //$GLOBALS['system_admin'] = array(60);
      if(in_array($groupid,$GLOBALS['system_admin'])){
          $serverid=null;
      }*/
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    if ($serverid && $user_arr['usertype'] != 3) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    //如果是本站注册会员
    if ($user_arr['usertype'] == 1) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level != 1) {
            //不是高级会员
            if (!checkIsMobileCertical($userid)) {
                //没有通过了手机验证
                $err = "您还没有进行手机验证,请先认证";
                echo return_data($err, false);
                exit;
            } else {
                //if(!checkIsOver($userid)){ //过了试用期
                $err = "只有钻石或高级会员才可以发送电子邮件给对方";
                echo return_data($err, false);
                exit;
                //}
            }
        }
    }
    //print_r($_POST);
    //note s_cid 发送者的权限(回复时才有)
    $s_cid = MooGetGPC('s_cid', 'integer', 'P');
    //echo $s_cid;exit;
    //收件人id
    $sid = $contentid;
    //发件人id
    $mid = $userid;
    ///echo $sid;exit;
    $s_title = MooGetGPC('s_title', 'string', 'P');
    $s_title = rtrim($s_title);
    //对主题字数限制
    $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = ''));
    $s_content = MooGetGPC('s_content', 'string', 'P');
    //note 特殊字符
    $s_content = rtrim(MooStrReplace(safeFilter($s_content)));
    $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P');
    $message_back = MooGetGPC('message_back', 'integer', 'P');
    //note 双方屏蔽不给操作
    if (MooGetScreen($mid, $sid)) {
        $err = "因特殊原因,消息发送失败";
        echo return_data($err, false);
        exit;
    }
    if ($mid && $sid && $s_title && $s_content) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level == 2 && $user_arr['usertype'] != 3) {
            //普通会员需要审核(除采集会员之外)
            //if($user_arr['gender'] == 0){	//如果是男方发的,需要审核,0表示
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')");
        } else {
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')");
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        $res = MooMembersData($sid);
        //	   $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '$userid'");
        $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid));
        //	   $send_user_info = $send_user_info[0];
        //头像路径
        $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
        //省
        $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
        //市
        $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
        //身高
        ob_start();
        require_once MooTemplate('public/mail_space_messagetpl', 'module');
        //模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid);
        $week_time = 24 * 3600 * 7;
        //一周时间秒数
        $interval_time = $timestamp - $user_arr['last_login_time'];
        //当前时间-最后登录时间
        $date1 = date("Y-m-d", strtotime("last Monday"));
        $date2 = date("Y-m-d", strtotime("Sunday"));
        if ($interval_time > $week_time) {
            //不活跃用户每周发一条短信
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true);
            if ($cos['c'] <= 1) {
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        } else {
            //活跃用户每天一条
            //每天该用户超过5条信息不发送短信
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true);
            if ($cos['c'] < 5) {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        }
        //note 发送资料给接收方
        if ($send_mymessage) {
        }
        //note 备份邮件操作
        if ($message_back) {
            //note 发送MAIL时所需信息
            $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'");
            //note 发送MAIL时收信人的邮箱
            $ToAddress = $user['username'];
            //note 发送MAIL时主题
            $ToSubject = '提示:您在真爱一生网所发的消息备份';
            //note 发送MAIL时Body内容所需信息
            $username = $user['nickname'];
            //note 发送MAIL时Body内容所需信息
            $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'");
            if ($username) {
                $ToBody = $username;
            } else {
                $ToBody = 'ID号为' . $mid . '的会员<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>';
            } else {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>';
            }
            if ($username) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                $suc = "发送成功,真爱一生审核后对方即可以收到。";
                echo return_data($suc, true);
                exit;
            } else {
                $suc = "发送成功";
                echo return_data($suc, true);
                exit;
            }
        } else {
            $err = "发送失败";
            echo return_data($err, false);
            exit;
        }
    } else {
        $err = "数据填写不完整";
        echo return_data($err, false);
        exit;
    }
}
示例#11
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');
}
示例#12
0
文件: index.php 项目: noikiy/zays
function shadow_master()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $uuid;
    $womenList = array('30407189', '21186208', '21199933', '20686096', '20223069', '20520991', '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'];
    }
    if ($gender == 0) {
        $rand_keys = array_rand($manList, 12);
        for ($i = 0; $i < 12; $i++) {
            $returnarr[] = $manList[$rand_keys[$i]];
        }
    } elseif ($gender == 1) {
        $rand_keys = array_rand($womenList, 12);
        for ($i = 0; $i < 12; $i++) {
            $returnarr[] = $womenList[$rand_keys[$i]];
        }
    } else {
        $rand_keys = array_rand($womenList, 6);
        for ($i = 0; $i < 6; $i++) {
            $returnarr[] = $womenList[$rand_keys[$i]];
        }
        $rand_keys = array_rand($manList, 6);
        for ($i = 0; $i < 6; $i++) {
            $returnarr[] = $manList[$rand_keys[$i]];
        }
        //shuffle($returnarr);
    }
    foreach ($returnarr as $value) {
        $mainimg = MooGetphoto($value, $style = "com");
        $users[] = array('uid' => $value, 'mainimg' => $mainimg);
    }
    echo return_data($users);
    exit;
}