Пример #1
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');
    }
}
Пример #2
0
			<div class="service-liker">
			<?php 
if ($total == 0) {
    ?>
            <div class="norequest">
              现在还没有人评价过您
              <p> 马上去 <a href="index.php?n=search" class="f-ed0a91-a">搜索意中人</a>,即刻对TA进行评价</p>
            </div>
            <?php 
} else {
    ?>
			  <?php 
    foreach ((array) $comment_list as $comment) {
        ?>
        	  <?php 
        $send_user1 = leer_send_user1($comment['cuid']);
        ?>
				<ul class="service-liker-list">
					<li><input type="checkbox" name="id[]" value="<?php 
        echo $comment['id'];
        ?>
"/></li>
					<li>
						<div class="r-service-img">
						<?php 
        if (!empty($send_user1['city_star'])) {
            ?>
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a><?php 
        }
        ?>
							<div class="r-s-img-in">
Пример #3
0
function getmyleers()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 处理回复秋波
    $repeatleer = MooGetGPC('repeatleer', 'string');
    $repeatleerid = MooGetGPC('repeatleerid', 'integer');
    if ($repeatleer && $repeatleerid) {
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '{$repeatleer}' WHERE senduid = '{$repeatleerid}' AND receiveuid = '{$userid}' ");
        header("location:index.php?n=service&h=leer");
    }
    //note 处理委婉拒绝秋波
    $refuseleer = MooGetGPC('refuseleer', 'string');
    $refuseleerid = MooGetGPC('refuseleerid', 'integer');
    if ($refuseleer && $refuseleerid) {
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '2' WHERE senduid = '{$refuseleerid}' AND receiveuid = '{$userid}' ");
        header("location:index.php?n=service&h=leer");
    }
    //note 获取删除提交的变量
    $delleer = MooGetGPC('delleer', 'string');
    $delleerid = MooGetGPC('delleerid', 'array');
    //note 删除提交的数据
    if ($delleer && count($delleerid)) {
        $time = time();
        foreach ($delleerid as $v) {
            //$_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_leer WHERE lid = '$v'");
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET receive_del=1,receive_deltime='{$time}',receivenum = '0' WHERE lid = '{$v}'");
        }
        MooMessage("秋波删除成功", 'index.php?n=service&h=leer');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delleer && !count($delleerid)) {
        MooMessage('请选择要删除的秋波', 'index.php?n=service&h=leer', '01');
        exit;
    }
    //分页
    $page_per = 4;
    $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;
    $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0  ORDER BY receivetime desc LIMIT {$start},{$page_per}");
    $leers = array();
    foreach ($results as $k => $v) {
        $send_user1 = array();
        $send_user2 = array();
        $send_user1 = leer_send_user1($v['senduid']);
        $send_user2 = leer_send_user2($v['senduid']);
        $leers[$k]['l'] = $v;
        $leers[$k]['s'] = $send_user1;
        $leers[$k]['t'] = $send_user2;
    }
    //note 已收到的总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0");
    $receive_num = empty($temp['num']) ? 0 : $temp['num'];
    //note 已发送的总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_leer WHERE senduid = '{$userid}' and send_del=0 ");
    //AND send_del = 0 AND is_server=0
    $send_num = empty($temp['num']) ? 0 : $temp['num'];
    require MooTemplate('public/service_leer_getmyleers', 'module');
}
Пример #4
0
function getlatestvisitor()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr;
    $pagesize = 4;
    //note 获取删除提交的变量
    $delvisitor = MooGetGPC('delvisitor', 'string');
    $delvisitorid = MooGetGPC('delvisitorid', 'array');
    //note 删除提交的数据
    if ($delvisitor && count($delvisitorid)) {
        for ($i = 0; $i < count($delvisitorid); $i++) {
            $result = $_MooClass['MooMySQL']->getOne("SELECT `who_del` FROM `" . $dbTablePre . "service_visitor` WHERE `vid`=" . $delvisitorid[$i], true);
            if ($result['who_del'] != 0) {
                $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_visitor WHERE vid = '{$delvisitorid[$i]}'");
            } else {
                $_MooClass['MooMySQL']->query("UPDATE `" . $dbTablePre . "service_visitor` SET `who_del`=2 WHERE `vid`=" . $delvisitorid[$i]);
            }
        }
        MooMessage("删除成功", 'index.php?n=service&h=mindme', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delvisitor && !count($delvisitorid)) {
        MooMessage('请选择要删除选项', 'index.php?n=service&h=mindme', '01');
        exit;
    }
    //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_c = $_MooClass['MooMySQL']->getOne("SELECT count(*) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2");
    $total = $ret_c['c'];
    if ($total > 200) {
        $total = 200;
    }
    //更改最近留意我的人最我显示200个
    $tomeArr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND who_del !=1");
    $tome = $tomeArr['count(*)'];
    //note 查询出谁访问过我相关信息
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_visitor WHERE  uid >0 and visitorid = '{$userid}' AND who_del !=2 order by visitortime desc LIMIT {$start},{$pagesize}");
        $visitors = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $vistor = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $vistor['l'] = $v;
            $vistor['l']['visitortime'] = $vistor['l']['visitortime'] ? $vistor['l']['visitortime'] : time();
            $vistor['s'] = $send_user1;
            $vistor['t'] = $send_user2;
            $visitors[$k] = $vistor;
        }
    }
    require MooTemplate('public/service_visitor_latestvisitor', 'module');
}
Пример #5
0
function whoaddme()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 获取删除提交的变量
    $delfriend = MooGetGPC('delfriend', 'string', 'P');
    $delfriendid = MooGetGPC('delfriendid', 'array', 'P');
    //note 删除提交的数据
    if ($delfriend) {
        $ids = implode(',', $delfriendid);
        //foreach($delfriendid as $v) {
        $_MooClass['MooMySQL']->query("DELETE FROM {$dbTablePre}service_friend WHERE fid  in  ({$ids})");
        //}
        MooMessage("删除意中人成功", 'index.php?n=service&h=liker', '05');
    }
    $pagesize = 4;
    //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_friend WHERE friendid = '{$userid}'");
    $total = $ret_count['c'];
    $total2Arr = $_MooClass['MooMySQL']->getOne("SELECT count(*) FROM {$dbTablePre}service_friend WHERE uid = '{$userid}'");
    $total2 = $total2Arr['count(*)'];
    //note
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$userid}' order by sendtime desc LIMIT {$start},{$pagesize}");
        $friends = array();
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $friend = array();
            $send_user1 = leer_send_user1($v['uid']);
            $send_user2 = leer_send_user2($v['uid']);
            $friend['l'] = $v;
            $friend['s'] = $send_user1;
            $friend['t'] = $send_user2;
            $friends[$k] = $friend;
        }
    }
    require MooTemplate('public/service_friend_whoaddmylist', 'module');
}
Пример #6
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');
}
Пример #7
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');
}
Пример #8
0
function service_request_sms()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $hzn, $serverid, $timestamp;
    $userid = $user_arr['uid'];
    if (empty($userid)) {
        header("Location:login.html");
    }
    $member_level = get_userrank($userid);
    if ($member_level != 1) {
        MooMessage('您不是钻石或高级会员,不能请求查看身份证信息,快升级为钻石或高级会员吧', 'index.php?n=payment&h=diamond');
    }
    $sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='{$userid}'";
    $certification = $_MooClass['MooMySQL']->getOne($sql, true);
    if ($certification['sms'] != 1) {
        MooMessage('您未进行身份通认证,请先进行身份通认证', 'index.php?n=myaccount&h=smsindex');
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $send_user = leer_send_user1($sendtoid);
    //$send_user_gender = $send_user['gender'] == 1 ? "女" : "男"; //发送者性别
    $send_user_gender = $user_arr['gender'] == 1 ? "女" : "男";
    //发送者性别
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    if ($sendtoid == $userid) {
        MooMessage('自己不可以请求查看自己的信息', 'javascript:history.go(-1);');
        exit;
    }
    if ($send_user['gender'] == $user_arr['gender']) {
        MooMessage('同性之间不可以请求查看', 'javascript:history.go(-1);');
        exit;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //$sql = "SELECT sms FROM {$dbTablePre}certification WHERE uid='$userid'";
    $time = time();
    $sql = "SELECT id FROM {$dbTablePre}members_requestsms WHERE uid='{$sendtoid}' AND ruid='{$userid}'";
    if ($_MooClass['MooMySQL']->getOne($sql, true)) {
        $sql = "UPDATE {$dbTablePre}members_requestsms SET request_total=request_total+1 WHERE uid='{$sendtoid}' AND ruid='{$userid}'";
        $_MooClass['MooMySQL']->query($sql);
    } else {
        $sql = "INSERT INTO {$dbTablePre}members_requestsms SET uid='{$sendtoid}',ruid='{$userid}',dateline='{$time}'";
        $_MooClass['MooMySQL']->query($sql);
    }
    //***********提醒所属客服************
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 索取身份';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $members = MooMembersData($sendtoid);
    //fanglin暂时屏蔽
    Push_message_intab($sendtoid, $members['telphone'], "索取身份", "真爱一生网www.zhenaiyisheng.cc用户ID:" . $userid . "," . $send_user_gender . ",请求查看您的身份证信息,请速回复哦!4006780405", $userid);
    require MooTemplate('public/service_requestsms', 'module');
}
Пример #9
0
function get_receive_rose()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    //note 获取删除提交的变量
    $delrose = MooGetGPC('delrose', 'string', 'POST');
    $delroseid = MooGetGPC('delroseid', 'string', 'POST');
    //note 删除提交的数据
    if ($delrose && count($delroseid)) {
        $ids = "'" . implode("','", $delroseid) . "'";
        $time = time();
        $_MooClass['MooMySQL']->query("UPDATE  {$dbTablePre}service_rose SET receive_del=1,receive_deltime='{$time}', receivenum = 0 WHERE rid  IN ( {$ids} )");
        MooMessage("鲜花删除成功", 'index.php?n=service&h=gift&t=igetrose', '05');
    }
    //note 如果提交的数据不存在,或者是提交的时候没有选中
    if ($delrose && !count($delroseid)) {
        MooMessage('请选择要删除的鲜花', 'index.php?n=service&h=gift&t=igetrose', '01');
        exit;
    }
    //分页
    $page_per = 4;
    $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_rose WHERE receiveuid  = '{$userid}' and send_del=0", true);
    $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;
    $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0 ORDER BY receivetime desc LIMIT {$start},{$page_per}");
    $roses = array();
    foreach ($results as $k => $v) {
        $send_user1 = array();
        $send_user2 = array();
        $rose = array();
        $send_user1 = leer_send_user1($v['senduid']);
        $send_user2 = leer_send_user2($v['senduid']);
        $rose['l'] = $v;
        $rose['s'] = $send_user1;
        $rose['t'] = $send_user2;
        $roses[$k] = $rose;
    }
    //note 已收到的玫瑰总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when receivenum>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE receiveuid = '{$userid}' and receive_del=0");
    $receive_num = empty($temp['num']) ? 0 : $temp['num'];
    //note 已发送的玫瑰总数
    $temp = $_MooClass['MooMySQL']->getOne("SELECT sum(case when num>=1 then 1 else 0 end) as num FROM {$dbTablePre}service_rose WHERE senduid = '{$userid}' and send_del=0");
    $send_num = empty($temp['num']) ? 0 : $temp['num'];
    require MooTemplate('public/service_rose_getreceiverose', 'module');
}
Пример #10
0
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');
}
Пример #11
0
function sendnewfl()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer', 'P');
    //
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $return = array();
    $is_first_send = true;
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        $error = "自己不可以给自己发过送鲜花";
        echo return_data($error, false);
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        //只能模拟全权会员
        $error = "对不起您不能模拟操作";
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        $error = "因特殊原因,送鲜花失败";
        echo return_data($error, false);
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        $error = "同性之间不可互发鲜花";
        echo return_data($error, false);
        exit;
        exit;
    }
    if ($user['rosenumber'] <= 0) {
        $error = '您没有鲜花了,获取更多鲜花';
        echo return_data($error, false);
        exit;
    }
    //
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    $res = MooMembersData($sendtoid);
    $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid));
    //头像路径
    $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
    //省
    $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板
    $body = ob_get_clean();
    if ($res['usertype'] != 3) {
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    //if(empty($uid)){
    //	MooMessage('您还没有登录','index.php?n=login');
    //}
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    //库中验证鲜花数
    //$rosenum_check =  $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1",true);
    //if($rosenum_check['rosenumber'] > 0) {
    if ($leer['rid']) {
        $is_first_send = false;
        $rid = $leer['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
    }
    //note 发送一朵玫瑰,自己就要减少一朵玫瑰
    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1", true);
        $value['rosenumber'] = $user_rosenum['rosenumber'];
        MooFastdbUpdate('members_base', 'uid', $userid, $value);
    }
    //}
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    $sendinfo = MooGetGPC('sendinfo', 'string', 'G');
    if (!empty($sendinfo)) {
        $sendinfo = ",对您说:" . $sendinfo;
    }
    if ($res['usertype'] != 3) {
        if ($serverid) {
            //客服模拟会员登录可以选择发送短信或彩信
            $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G');
            if ($SMStype == 'SMS' && $res['is_phone']) {
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            } elseif ($SMStype == 'CMS' && $res['is_phone']) {
                //====发送彩信   begin  ====
                //发送人有照片
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0";
                $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1";
                   $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/
                if ($sendfrom_user_info['uid']) {
                    $sendedMMSCount = $memcached->get('hznsimulate' . $serverid);
                    if (empty($sendedMMSCount)) {
                        $sendedMMSCount = 0;
                    }
                    //if($sendedMMSCount > 10){
                    //	MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose');
                    //}
                    send_mms_commission($res['telphone'], 'rose', $userid);
                    $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800);
                }
                //====发送彩信 end =====
            }
        } else {
            //真实会员登录
            if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) {
                //第一次发才短信提示
                // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo."     请及时把握您的缘分!4006780405");
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            }
        }
    }
    /*
    	$week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	//echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit;
    
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    		 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    		 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    		 if($cos[c] <= 1){
    			//fanglin暂时屏蔽
    			Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    		 }
    	}else{
    		  //echo $today_rose_count;exit;
    		  if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    			   $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    			   
               //print_r($cos);exit;
    			   if($cos[c]<5){
    				  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    				  //fanglin暂时屏蔽
    				  Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    			   }
    		}
    	}
    */
    /*
    	//发送彩信
    	$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
    	//$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'";
    	$sendout_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送人有照片
    	$sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1";
    	$sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
        
    	//echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit;
    	if($sendto_user_info['telphone']&&$sendout_user_info['uid']){
    		//echo 'ffff';exit;
    		if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){
    			$note="。";
    		}else{
    			$note="!";
    		}
    	}
    */
    /*普通会员对全权会员反馈白名单*/
    if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
        white_list($res['uid'], $user_arr['uid']);
    }
    /*客服模拟全权记录*/
    if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
        $action = '鲜花';
        fulllog($user_arr['uid'], $serverid, $action, $res);
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $return = "发送鲜花成功";
    echo return_data($return);
    exit;
    //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05");
    //require MooTemplate('public/service_rose_sendrose', 'module');
}
Пример #12
0
function getcontactdata2()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr;
    $uid = MooGetGPC('uid', 'integer');
    //note 查询目前委托真爱一生联系对方表
    $user4 = $_MooClass['MooMySQL']->getOne("SELECT * FROM `{$dbTablePre}service_contact` WHERE `other_contact_you` = '{$userid}' AND `you_contact_other` = '{$uid}' and send_del=0 and is_server=0", true);
    if (!$user4) {
        MooMessage('对不起,您查看的不属于您的委托', 'javascript:history.go(-1)', '04');
    }
    //note 查询用户主表
    $user1 = leer_send_user1($uid);
    //note 查询用户择偶表
    //$user2 = leer_send_user2($uid);
    //note 查询用户附加表
    $user3 = service_user3($uid);
    //note 择偶条件
    if (MOOPHP_ALLOW_FASTDB) {
        $c = MooFastdbGet('members_choice', 'uid', $uid);
    } else {
        $c = $_MooClass['MooMySQL']->getOne("SELECT * FROM `{$dbTablePre}members_choice` WHERE uid = {$uid}");
    }
    //note 实现查看下一个会员功能
    $user5 = $_MooClass['MooMySQL']->getAll("SELECT you_contact_other FROM `{$dbTablePre}service_contact` WHERE `other_contact_you` = '{$userid}' and send_del=0 and is_server=0");
    //note 显示相册中的普通照片
    $user_pic = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}pic WHERE syscheck=1 and  uid='{$user1['uid']}'");
    //会员已认证证件
    $MSG = certification($user1['uid']);
    $total = count($user5);
    foreach ($user5 as $k => $v) {
        if ($user5[$k]['you_contact_other'] == $uid) {
            $up = $k - 1 <= 0 ? '0' : $k - 1;
            $next = $k + 1 >= $total ? $total - 1 : $k + 1;
            $upid = $user5[$up]['you_contact_other'];
            $nextid = $user5[$next]['you_contact_other'];
        }
    }
    //note 查询普通图片
    //$user6 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}pic WHERE uid='$uid' AND syscheck = 1");
    require MooTemplate('public/service_contact_getcontactdata2', 'module');
}
			<div class="service-liker">
			<?php 
if ($total2 == 0) {
    ?>
              <div class="norequest">
              您现在还没有发送任何查看身份证请求
              <p>立即 <a href="?n=search">搜索TA</a>,发送自己的查看请求吧</p>
              </div>
           <?php 
} else {
    ?>
		   <?php 
    foreach ((array) $request_list as $request) {
        ?>
      	   <?php 
        $send_user1 = leer_send_user1($request['uid']);
        $send_user2 = leer_send_user2($request['uid']);
        ?>
				<ul class="service-liker-list">
					<li><input type="checkbox" name="delsms[]" value="<?php 
        echo $request['id'];
        ?>
"/></li>
					<li>
						<div class="r-service-img">
						<?php 
        if (!empty($send_user1['city_star'])) {
            ?>
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a>
			  		<?php 
        }
Пример #14
0
						</dl>
					</li>
					<?php 
}
?>
					<p class="r-like-bottom"><a href="<?php 
echo $search_url;
?>
" class="f-ed0a91">查看更多&gt;&gt;</a></p>
				</ul>
				<ul class="fleft" id="con_two_2" style="display:none">
				<?php 
foreach ((array) $visitor as $visitors) {
    ?>
                  <?php 
    $send_user1 = leer_send_user1($visitors['visitorid']);
    ?>
					<li>
						<dl class="r-like-c-data">
							<dt><div><a style="display:block;" href="space_<?php 
    echo $visitors['visitorid'];
    ?>
.html" target="_blank">
							 <?php 
    if ($send_user1['mainimg'] && $send_user1['images_ischeck'] == '1') {
        ?>
							  <img class="_photo_ fixphoto" src=" <?php 
        if (MooGetphoto($send_user1['uid'], 'mid')) {
            echo IMG_SITE . MooGetphoto($send_user1['uid'], 'mid');
        } elseif ($send_user1['gender'] == '1') {
            echo 'public/system/images/woman_100.gif';
Пример #15
0
function getcontactme()
{
    global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr;
    $pagesize = 4;
    //note 获得当前url
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    $currenturl2 = preg_replace("/(&page2=\\d+)/", "", $currenturl2);
    $currenturl2 = preg_replace("/(&page3=\\d+)/", "", $currenturl2);
    //note ---------------------等待回应的请求
    //note 获得第几页
    $page = empty($_GET['page']) ? 1 : $_GET['page'];
    //note limit查询开始位置
    $start = ($page - 1) * $pagesize;
    $ret = $_MooClass['MooMySQL']->getAll("SELECT stat,count(*) as c FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}'  and receive_del=0 and send_del=0 group by stat");
    $total = 0;
    $total2 = 0;
    $total3 = 0;
    foreach ($ret as $v) {
        switch ($v['stat']) {
            case 1:
                $total = $v['c'];
                break;
            case 2:
                $total2 = $v['c'];
                break;
            case 3:
                $total3 = $v['c'];
                break;
        }
    }
    //note 查询等待回应的请求
    if ($total) {
        $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 1 and receive_del=0 and send_del=0  order by sendtime desc LIMIT {$start},{$pagesize}");
        foreach ($results as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts[$k] = $contact;
        }
    }
    $page2 = empty($_GET['page2']) ? 1 : $_GET['page2'];
    $start2 = ($page2 - 1) * $pagesize;
    if ($total2) {
        $results2 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}'  AND stat = 2 and receive_del=0 and send_del=0 order by sendtime desc  LIMIT {$start2},{$pagesize}");
        foreach ($results2 as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts2[$k] = $contact;
        }
    }
    $page3 = empty($_GET['page3']) ? 1 : $_GET['page3'];
    $start3 = ($page3 - 1) * $pagesize;
    if ($total3) {
        $results3 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 3 and receive_del=0 and send_del=0 order by sendtime desc LIMIT {$start3},{$pagesize}");
        foreach ($results3 as $k => $v) {
            $send_user1 = array();
            $send_user2 = array();
            $contact = array();
            $send_user1 = leer_send_user1($v['other_contact_you']);
            $send_user2 = leer_send_user2($v['other_contact_you']);
            $contact['l'] = $v;
            $contact['s'] = $send_user1;
            $contact['t'] = $send_user2;
            $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容';
            $contacts3[$k] = $contact;
        }
    }
    require MooTemplate('public/service_contact_getcontactme', 'module');
}