Пример #1
0
function count_no()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $num_li = array();
    //秋波
    $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_leer WHERE receiveuid  = '{$userid}' and receive_del=0 AND stat = '0'");
    $num_li['qiubo'] = $temp['num'] ? $temp['num'] : 0;
    //邮件
    $ret_count1 = $_MooClass['MooMySQL']->getOne("SELECT count(s_uid) as c FROM {$dbTablePre}services WHERE s_uid = '{$userid}' and flag = '1' and s_uid_del='0' and s_status = '0' ", true);
    $num_li['youjian'] = $ret_count1['c'] ? $ret_count1['c'] : 0;
    //2009-11-22日修改(得到总数)
    //SELECT mid,stat,other_contact_you as uid FROM {$dbTablePre}service_contact WHERE you_contact_other = '$userid' AND stat < 4 and send_del=0 and is_server=0 order by sendtime desc LIMIT $start,$pagesize
    //委托
    $contact = $_MooClass['MooMySQL']->getOne("SELECT count(other_contact_you) as c FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = '1' and send_del=0 and is_server=0");
    $num_li['weituo'] = $contact['c'] ? $contact['c'] : 0;
    //1分钟内浏览量
    $time = time() - 61;
    $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(uid) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2 and visitortime > '{$time}' ");
    $num_li['oneminite'] = $ret_count['c'] ? $ret_count['c'] : 0;
    echo return_data($num_li, true);
    //print_r($num_li);
    exit;
}
Пример #2
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');
}
Пример #3
0
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;
}
Пример #4
0
                    if (!isset($rows[$row['STIME']])) {
                        $rows[$row['STIME']] = array();
                    }
                    $rows[$row['STIME']][$row['MEASUREMENT_CODE']] = $row['ET_MEAN'];
                    if (!isset($rows[$row['STIME']]['stime'])) {
                        $rows[$row['STIME']]['stime'] = $row['STIME'];
                    }
                    if (!isset($rows[$row['STIME']]['ftime'])) {
                        $rows[$row['STIME']]['ftime'] = $row['FTIME'];
                    }
                }
            } catch (PDOException $e) {
                bad_call("Error!: " . $e->getMessage());
            }
            $retval = array(params => $q_params, rows => array_values($rows));
            return_data($retval);
        } else {
            bad_call("Invalid resource type specified");
        }
    }
} else {
    bad_call("No resource type specified");
}
exit;
function bad_call($msg)
{
    print $msg . "<br \\>";
}
function return_data($data)
{
    print json_encode($data);
Пример #5
0
function material_photo_upload()
{
    global $_MooClass, $dbTablePre, $userid, $user, $pic_size_arr, $user_arr, $memcached;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = $user = MooMembersData($userid);
    $user_rank_id = get_userrank($userid);
    if (MOOPHP_ALLOW_FASTDB) {
        $usercer = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$userid}' LIMIT 1 ", true);
    }
    if ($_POST['isupload'] == '1') {
        //note 设定用户id
        $memberid = $userid;
        //note 设定用户上传图片大小限制 最小10240字节 = 10k 最大419430字节 = 400K
        $minfilesize = 20480;
        $maxfilesize = 1024000;
        $filesize = $_FILES['userfile']['size'];
        if ($filesize > $maxfilesize) {
            $notice = "请上传小于1000KB的照片。";
            echo return_data($notice);
            exit;
        }
        if ($filesize < $minfilesize) {
            $notice = "请上传大于20KB的照片。";
            echo return_data($notice);
            exit;
        }
        //note 判断文件类型
        $flag = '';
        $true_type = file_type($_FILES['userfile']['tmp_name']);
        $extname = strtolower(substr($_FILES['userfile']['name'], strrpos($_FILES['userfile']['name'], '.') + 1));
        $images = array('/jpg/', '/jpeg/', '/gif/', '/png/', '/JPG/', '/JPEG/', '/GIF/', '/PNG/');
        if (in_array('/' . $extname . '/', $images)) {
            foreach ($images as $v) {
                //note http://ask.wangmeng.cn/question/76
                if (preg_match($v, $_FILES['userfile']['type']) && ('image/' . $true_type == $_FILES['userfile']['type'] || 'image/p' . $true_type == $_FILES['userfile']['type'] || 'image/x-' . $true_type == $_FILES['userfile']['type'])) {
                    $file_content = file_get_contents($_FILES['userfile']['tmp_name']);
                    $low_file_content = strtolower($file_content);
                    $pos = strpos($low_file_content, '<?php');
                    if ($pos) {
                        $notice = "照片中含有不安全信息请重新上传";
                        echo return_data($notice);
                        exit;
                    } else {
                        $flag = 1;
                    }
                }
            }
        }
        //echo $true_type,'_',$flag,'_',$_FILES['userfile']['type'];exit;
        if ($flag != 1) {
            $notice = "请上传JPEG,JPG,PNG或GIF格式";
            echo return_data($notice);
            exit;
        }
        //note 设定该用户最多上传20张图片(形象照除外)
        $maxuploadnum = 20;
        //note 查询出来的总数
        $query = $_MooClass['MooMySQL']->getOne("select count(1) as num from `{$dbTablePre}pic` where `uid` = '{$memberid}' AND `isimage` = '0'", true);
        $total = $query['num'];
        //note 还可以上传多少张
        $leave_num = $maxuploadnum - $total;
        if ($leave_num <= 0) {
            $notice = '您已经有' . $maxuploadnum . '张照片了,';
            if ($user_arr['mainimg']) {
                $notice .= '不可以再上传了。';
            } else {
                $notice .= '请在相册中选一张作为形象照。';
            }
            echo return_data($notice);
            exit;
        }
        //note 设定相册名
        $album = '';
        //note 设定全局路径
        $orgin = "orgin";
        //note 原图文件夹名
        $thumb_path = PIC_PATH;
        //图片路径
        $timestat = time();
        $thumb_datedir = date("Y", $timestat) . "/" . date("m", $timestat) . "/" . date("d", $timestat);
        //原图路径
        $main_img_path = $thumb_path . "/" . $thumb_datedir . "/" . $orgin . "/";
        //note 调用文件操作类库,建立无限级目录
        $mkdirs = MooAutoLoad('MooFiles');
        !is_dir($main_img_path) && $mkdirs->fileMake($main_img_path, 0777);
        //note 上传到指定目录(原图),并且获得上传后的文件描述
        $upload = MooAutoLoad('MooUpload');
        $upload->config(array('targetDir' => $main_img_path, 'saveType' => '0'));
        $files = $upload->saveFiles('userfile');
        //note 获得图片路径和缩略图的路径
        $imgurl = $files[0]['path'] . $files[0]['name'] . "." . $files[0]['extension'];
        if ($files[0]['extension'] == 'gif') {
            $output = imagecreatefromgif($imgurl);
            imagegif($output, $imgurl, 100);
            imagedestroy($output);
        }
        $imgurl2 = $files[0]['path'] . $files[0]['name'] . "_nowater." . $files[0]['extension'];
        @copy($imgurl, $imgurl2);
        //拷贝一张无水印图片(用于形象照)
        $pic_name = $files[0]['name'] . "." . $files[0]['extension'];
        $pic_name2 = $files[0]['name'] . "_nowater." . $files[0]['extension'];
        $first = new Imagick($imgurl);
        //写入水印
        $second = new Imagick('public/system/images/logo_original.png');
        //$second->setImageOpacity (0.4);//设置透明度
        $dw = new ImagickDraw();
        $dw->setGravity(Imagick::GRAVITY_SOUTHEAST);
        //设置位置
        //$dw->setGravity(Imagick::GRAVITY_SOUTH);//设置位置
        $dw->composite($second->getImageCompose(), 0, 0, 50, 0, $second);
        $first->drawImage($dw);
        $first->writeImage($imgurl);
        //将第一张图片的大小控制成我们需要的大小
        list($width, $height) = getimagesize($imgurl);
        $d = $width / $height;
        $off_wh = off_WH($width, $height);
        $new_width = $off_wh['width'];
        $new_height = $off_wh['height'];
        unset($off_wh);
        $big_path = $files[0]['path'];
        $big_name = $files[0]['name'] . '.' . $files[0]['extension'];
        $image = MooAutoLoad('MooImage');
        $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($new_width, $new_height, $imgurl);
        $image->waterMark();
        //note 缩略无水印图片
        $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name2, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($new_width, $new_height, $imgurl2);
        $image->waterMark();
        $thumb1_width = $pic_size_arr["1"]["width"];
        $thumb1_height = $pic_size_arr["1"]["height"];
        $thumb2_width = $pic_size_arr["2"]["width"];
        $thumb2_height = $pic_size_arr["2"]["height"];
        $thumb3_width = $pic_size_arr["3"]["width"];
        $thumb3_height = $pic_size_arr["3"]["height"];
        //note 生成日期目录
        $thumb1_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb1_width . "_" . $thumb1_height . "/";
        $thumb2_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb2_width . "_" . $thumb2_height . "/";
        $thumb3_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb3_width . "_" . $thumb3_height . "/";
        !is_dir($thumb1_path) && $mkdirs->fileMake($thumb1_path, 0777);
        !is_dir($thumb2_path) && $mkdirs->fileMake($thumb2_path, 0777);
        !is_dir($thumb3_path) && $mkdirs->fileMake($thumb3_path, 0777);
        //note 缩略图文件名
        $thumb_filename = md5($files[0]['name']) . "." . $files[0]['extension'];
        $c = 41 / 57;
        if ($d > $c) {
            $thumb1_width = 41;
            $b = $width / $thumb1_width;
            $thumb1_height = $height / $b;
        } else {
            $thumb1_height = 57;
            $b = $height / $thumb1_height;
            $thumb1_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb1_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9));
        $image->thumb($thumb1_width, $thumb1_height, $imgurl);
        $image->waterMark();
        $c = 139 / 189;
        if ($d > $c) {
            $thumb2_width = 139;
            $b = $width / $thumb2_width;
            $thumb2_height = $height / $b;
        } else {
            $thumb2_height = 189;
            $b = $height / $thumb2_height;
            $thumb2_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb2_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '139', 'waterMarkMinHeight' => '189', 'waterMarkStatus' => 9));
        $image->thumb($thumb2_width, $thumb2_height, $imgurl);
        $image->waterMark();
        $c = 171 / 244;
        if ($d > $c) {
            $thumb3_width = 171;
            $b = $width / $thumb3_width;
            $thumb3_height = $height / $b;
        } else {
            $thumb3_height = 244;
            $b = $height / $thumb3_height;
            $thumb3_width = $width / $b;
        }
        $image->config(array('thumbDir' => $thumb3_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '171', 'waterMarkMinHeight' => '244', 'waterMarkStatus' => 9));
        $image->thumb($thumb3_width, $thumb3_height, $imgurl);
        $image->waterMark();
        //note 设定是否是形象照 1为形象照,0为普通照
        $isimage = (int) $_POST['isimage'];
        $updatetime = time();
        if ($isimage === 1) {
            $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_base` set `mainimg`='{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}' where `uid` = '{$memberid}'");
            $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_search` set images_ischeck='2'  where `uid` = '{$memberid}'");
            if (MOOPHP_ALLOW_FASTDB) {
                $image_arr = array();
                $image_arr['mainimg'] = $imgurl;
                $image_arr['pic_date'] = $thumb_datedir;
                $image_arr['pic_name'] = $pic_name;
                $members_search['images_ischeck'] = '2';
                MooFastdbUpdate('members_base', 'uid', $memberid, $image_arr);
                MooFastdbUpdate('members_search', 'uid', $memberid, $members_search);
            }
            searchApi("members_man members_women")->updateAttr(array('images_ischeck'), array($memberid => array(0)));
            UpdateMembersSNS($userid, '修改了形象照');
        }
        //note 写入相册表
        $isimage = 0;
        //web_members.mainimg == web_pic.imgurl 即形象照
        $_MooClass['MooMySQL']->query("insert into `{$dbTablePre}pic` set `uid` = '{$memberid}',`isimage` = '{$isimage}',`album` = '{$album}',`imgurl` = '{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}'");
        //提交会员动态makui
        UpdateMembersSNS($userid, '修改了相册');
        $notice = "成功";
        echo return_data($notice);
        exit;
    } else {
        $user1 = $user_arr;
    }
}
Пример #6
0
function story_one()
{
    global $_MooClass, $dbTablePre, $userid, $memcached;
    $sid = MooGetGPC('sid', 'integer', 'G');
    $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story where sid = {$sid} ");
    if ($love_story) {
        echo return_data($love_story, true);
        exit;
    } else {
        $error = '找不到该成功故事';
        echo return_data($error, false);
        exit;
    }
}
Пример #7
0
function act_random($method)
{
    global $db;
    // act random
    // optional vars: count (=1)
    if (isset($_GET['count'])) {
        $count = $_GET['count'];
    } else {
        $count = 1;
    }
    $count = (int) $count;
    $st = $db->query("SELECT * FROM miniqdb ORDER BY RAND() LIMIT {$count}");
    $data = array();
    $data['quote'] = array();
    foreach ($st->fetchAll() as $r) {
        $quote = array();
        $quote['@id'] = $r['id'];
        $quote['@timestamp'] = $r['epoch'];
        $quote['#text'] = implode("\n", explode("\r\n", $r['quote']));
        $quote['@lines'] = count(explode("\r\n", $r['quote']));
        $data['quote'][] = $quote;
    }
    return_data($method, $data);
}
Пример #8
0
function space_viewpro()
{
    global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr, $val_arr, $style_user_arr, $diamond, $_MooCookie, $memcached;
    //$val_arr统计资料完善度
    //	$uid = $GLOBALS ['style_uid'];
    $uid = $_GET['other_uid'];
    $is_only_show = true;
    $status = array();
    //验证是否合法成功登陆
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $userid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($userid) {
        $userid = $mem_uid = $memcached->get('uid_' . $userid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $user_oth = MooMembersData($uid);
    //note 判断被浏览的会员是否存在
    $status = array_merge(MooMembersData($uid), MooGetData('members_login', 'uid', $uid));
    $user_per_num = getUserinfo_per($user_arr);
    $error = array();
    //*****************白名单*******************
    if ($uid != $userid) {
        $is_only_show = false;
    }
    //*****************白名单*******************
    if (empty($is_only_show)) {
        //if(MOOPHP_ALLOW_FASTDB && $status['is_lock'] != 1){//is_lock默认1不封锁用户,0则封锁
        if ($status['is_lock'] != 1) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
        }
        if (!$status) {
            $error = "此会员已经找到真爱,关闭了个人资料";
            echo return_data($error, false);
            exit;
            //note 判断被浏览的用户是否允许其他会员查看他的资料
        } elseif (!$status['showinformation'] && $status['uid'] != $userid) {
            //showinformation默认1允许其他会员查看,0则不允许
            switch ($status['showinformation_val']) {
                //showinformation_val用户关闭资料的理由
                case 1:
                    $error = "此会员已找到正在交往的对象,故资料未公开";
                    echo return_data($error, FALSE);
                    exit;
                    break;
                case 2:
                    $error = "此会员已找到真爱,即将踏上红地毯,故资料未公开,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
                case 3:
                    $error = "此会员最近很忙,无法及时回复邮件,故资料未公开,转向我的真爱一生";
                    break;
                case 4:
                    $error = "此会员资料未公开,原因可能是TA已经找到真爱了,转向我的真爱一生";
                    echo return_data($error, false);
                    exit;
                    break;
            }
        }
    }
    //note 浏览资料页面时候,写入谁浏览谁表,自己浏览自己的除外
    if ($userid && $uid && $userid != $uid) {
        //note 不让屏蔽的会员查看
        if (MooGetScreen($userid, $uid)) {
            $error = "由于特殊原因对方资料未公开,转向我的真爱一生";
            echo return_data($error, false);
            exit;
        }
        if ($user_oth['gender'] != $user_arr['gender']) {
            //service_visitor 某某会员浏览某某会员记录表
            $visitor = $_MooClass['MooMySQL']->getOne("SELECT vid FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND visitorid = '{$uid}'");
            //note 再次浏览的,更新浏览时间
            if ($visitor['vid']) {
                $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_visitor SET visitortime = '{$timestamp}' WHERE uid='{$userid}' AND visitorid = '{$uid}' limit 1");
            } else {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_visitor SET uid = '{$userid}',visitorid='{$uid}',visitortime = '{$timestamp}'");
            }
            if (MooUserIsOnline($uid)) {
                $browser = $_MooClass['MooMySQL']->getOne("SELECT id FROM {$dbTablePre}service_browser WHERE uid = '{$userid}' AND browserid = '{$uid}'");
                //note 再次浏览的,更新浏览时间
                if ($browser['id']) {
                    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_browser SET browsertime = '{$timestamp}' WHERE uid='{$userid}' AND browserid = '{$uid}' limit 1");
                } else {
                    $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_browser SET uid = '{$userid}',browserid='{$uid}',browsertime = '{$timestamp}'");
                }
            }
        }
    }
    //note 查看会员资料信息
    $c = MooGetData('members_choice', 'uid', $uid) + MooGetData('members_introduce', 'uid', $uid);
    $user =& $status;
    /***创建浏览队列 ***/
    if ($userid && $uid && $userid != $uid) {
        if ($user_oth['gender'] != $user_arr['gender'] && $user['uid'] != $userid) {
            if ($user['usertype'] == 3 && $user_arr['usertype'] != 3 && $user['showinformation'] == 1 && $user_arr['s_cid'] >= 40) {
                $iscan = $GLOBALS['fastdb']->get($userid . '_scan_space');
                //浏览的全权会员列表
                $iscan = empty($iscan) ? array() : json_decode($iscan, true);
                $iscan = in_array($uid, $iscan) ? $iscan : array_push($iscan, $uid);
                $GLOBALS['fastdb']->set($userid . '_scan_space', json_encode($iscan));
            }
            if ($user['usertype'] != 3) {
                $scan_i = $GLOBALS['fastdb']->get('scan_space_' . $uid);
                //访问的记录列表
                $scan_i = empty($scan_i) ? array() : json_decode($scan_i, true);
                if (!empty($scan_i)) {
                    $scan_s = array();
                    foreach ($scan_i as $k => $scan) {
                        $scan_s[$k] = $scan[0];
                    }
                    if (in_array($userid, $scan_s)) {
                        $scan_i[array_search($userid, $scan_s)] = array($userid, time());
                    } else {
                        array_push($scan_i, array($userid, time()));
                    }
                } else {
                    array_push($scan_i, array($userid, time()));
                }
                $GLOBALS['fastdb']->set('scan_space_' . $uid, json_encode($scan_i));
            }
        }
    }
    //note_显示相册中的普通照片
    $user_pic = $_MooClass['MooMySQL']->getAll("SELECT imgurl,pic_date,pic_name FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$uid}'");
    $user['pic'] = $user_pic;
    $gender = $user_arr['gender'] == '0' ? '1' : '0';
    //0为男,1为女
    $agebegin = date("Y") - $user_arr['birthyear'] - 3;
    $ageend = date("Y") - $user_arr['birthyear'] + 3;
    $workprovince = $user_arr['province'];
    $workcity = $user_arr['city'];
    $search_url = MOOPHP_URL . "/index.php?n=search&h=quick&gender=" . $gender . "&age_start=" . $agebegin . "&age_end=" . $ageend . "&workprovince=" . $workprovince . "&workcity=" . $workcity . "&isphoto=1&imageField=&quick_search=搜索";
    //note 您可能喜欢的人,匹配相同地区
    $able_like = $userid ? youAbleLike(5) : array();
    //note 获取会员认证证件
    //note 当查看其他个人主页时,当前浏览的主页条件是否匹配
    $user2 = false;
    if ($uid != "" && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $c2 = MooGetData('members_choice', 'uid', $userid);
        $user2 = MooMembersData($userid);
    }
    //note 获得用户资料的完整度,以百分比显示makui
    $all_len = 0;
    if ($uid == $user_arr['uid']) {
        $all_len = (int) (getUserinfo_per($user_arr) * 100);
    }
    $user['all_len'] = $all_len;
    //note 匹配指数分数得出
    $mark = 0;
    if ($uid && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) {
        $cho = MooGetData('members_choice', 'uid', $user_arr['uid']);
        $year = isset($cho['birthyear']) ? $cho['birthyear'] : $user_arr['birthyear'];
        if ($year - 5 <= $user['birthyear'] && $user['birthyear'] <= $year + 5) {
            $mark_age = 9;
            $mark += 9;
        } else {
            $mark_age = 6;
            $mark += 6;
        }
        if ($cho['height1'] <= $user['height'] && $user['height'] <= $cho['height2']) {
            $mark_height = 7;
            $mark += 7;
        } else {
            $mark_height = 5;
            $mark += 5;
        }
        if ($cho['weight1'] <= $user['weight'] && $user['weight'] <= $cho['weight2']) {
            $mark_weight = 5;
            $mark += 5;
        } else {
            $mark_weight = 3;
            $mark += 3;
        }
        if ($cho['workprovince'] == $user['province']) {
            $mark_workprovince = 8;
            $mark += 8;
        } else {
            $mark_workprovince = 6;
            $mark += 6;
        }
        if ($cho['workcity'] == $user['city']) {
            $mark_workcity = 16;
            $mark += 16;
        } else {
            $mark_workcity = 5;
            $mark += 10;
        }
        if ($cho['education'] == $user['education']) {
            $mark_education = 8;
            $mark += 8;
        } else {
            $mark_education = 5;
            $mark += 5;
        }
        if ($cho['salary'] == $user['salary']) {
            $mark_salary = 9;
            $mark += 9;
        } else {
            $mark_salary = 7;
            $mark += 7;
        }
        if ($cho['marriage'] == $user['marriage']) {
            $mark_marriage = 8;
            $mark += 8;
        } else {
            $mark_marriage = 5;
            $mark += 5;
        }
        if ($cho['children'] == $user['children']) {
            $mark_children = 8;
            $mark += 8;
        } else {
            $mark_children = 6;
            $mark += 6;
        }
        if ($cho['drinking'] == $user['drinking']) {
            $mark_drinking = 5;
            $mark += 5;
        } else {
            $mark_drinking = 3;
            $mark += 3;
        }
        if ($cho['smoking'] == $user['smoking']) {
            $mark_smoking = 5;
            $mark += 5;
        } else {
            $mark_smoking = 2;
            $mark += 2;
        }
        if ($cho['body'] == $user['body']) {
            $mark_body = 6;
            $mark += 12;
        } else {
            $mark_body = 4;
            $mark += 8;
        }
    }
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    //note 检查绑定是否过期
    if ($user['isbind'] == 1) {
        $user['isbind'] = check_bind($user['bind_id']);
    }
    $activity = $_MooClass['MooMySQL']->getOne("SELECT uid,username,regtime,channel FROM {$dbTablePre}ahtv_reguser where  uid='{$uid}' and  isattend=1");
    //鲜花发送语
    if ($user_arr['gender'] == 0) {
        //boy
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=2 and isShow=1";
    } else {
        //girl
        $sql = "SELECT id,content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
    }
    $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
    $users = array();
    $mainimg = MooGetphoto($status['uid'], $style = "com");
    $status['mainimg'] = $mainimg;
    $users['material'] = $status;
    $users['mating'] = $c;
    //资料完整度
    $users['inte'] = $user_per_num * 100;
    $users['inte'] = round($users['inte']);
    $users['material']['password'] = '';
    $users['material']['regip'] = '';
    $users['material']['qq'] = '';
    $users['material']['msn'] = '';
    $users['material']['telphone'] = '';
    $users['material']['username'] = '';
    if (empty($error)) {
        echo return_data($users);
        exit;
    } else {
        echo return_data($error, false);
        exit;
    }
}
Пример #9
0
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;
}
Пример #10
0
/**
 * 客服模拟登录 没有权限修改删除 会员资料
 */
function checkAuthMod($url)
{
    global $dbTablePre, $_MooClass;
    $serverid = Moo_is_kefu();
    $sql = "select groupid from {$dbTablePre}admin_user where uid='{$serverid}'";
    $result = $_MooClass['MooMySQL']->getOne($sql);
    if (!in_array($result['groupid'], array('60', '61', '76', '75', '65', '66', '68', '69', '82', '81')) && !empty($serverid)) {
        //MooMessage ( "sorry,您没有操作权限", $url );
        $error = "sorry,您没有操作权限";
        echo return_data($error, true);
        exit;
        return;
    }
}
Пример #11
0
function to_send_message()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $uuid = $memcached->get('uuid_' . $userid);
    //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid);
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $contentid = MooGetGPC('s_id', 'integer', 'P');
    //不可给同性别发送消息
    $receive_info = MooMembersData($contentid);
    $receive_gender = $receive_info['gender'];
    if ($user_arr['gender'] == $receive_gender) {
        $err = "不可给同性别发送消息";
        echo return_data($err, false);
        exit;
    }
    //系统管理员权限
    /*$result=$_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
      $groupid=$result['groupid'];
      
      //$GLOBALS['system_admin'] = array(60);
      if(in_array($groupid,$GLOBALS['system_admin'])){
          $serverid=null;
      }*/
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    if ($serverid && $user_arr['usertype'] != 3) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    //如果是本站注册会员
    if ($user_arr['usertype'] == 1) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level != 1) {
            //不是高级会员
            if (!checkIsMobileCertical($userid)) {
                //没有通过了手机验证
                $err = "您还没有进行手机验证,请先认证";
                echo return_data($err, false);
                exit;
            } else {
                //if(!checkIsOver($userid)){ //过了试用期
                $err = "只有钻石或高级会员才可以发送电子邮件给对方";
                echo return_data($err, false);
                exit;
                //}
            }
        }
    }
    //print_r($_POST);
    //note s_cid 发送者的权限(回复时才有)
    $s_cid = MooGetGPC('s_cid', 'integer', 'P');
    //echo $s_cid;exit;
    //收件人id
    $sid = $contentid;
    //发件人id
    $mid = $userid;
    ///echo $sid;exit;
    $s_title = MooGetGPC('s_title', 'string', 'P');
    $s_title = rtrim($s_title);
    //对主题字数限制
    $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = ''));
    $s_content = MooGetGPC('s_content', 'string', 'P');
    //note 特殊字符
    $s_content = rtrim(MooStrReplace(safeFilter($s_content)));
    $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P');
    $message_back = MooGetGPC('message_back', 'integer', 'P');
    //note 双方屏蔽不给操作
    if (MooGetScreen($mid, $sid)) {
        $err = "因特殊原因,消息发送失败";
        echo return_data($err, false);
        exit;
    }
    if ($mid && $sid && $s_title && $s_content) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level == 2 && $user_arr['usertype'] != 3) {
            //普通会员需要审核(除采集会员之外)
            //if($user_arr['gender'] == 0){	//如果是男方发的,需要审核,0表示
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')");
        } else {
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')");
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        $res = MooMembersData($sid);
        //	   $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '$userid'");
        $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid));
        //	   $send_user_info = $send_user_info[0];
        //头像路径
        $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
        //省
        $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
        //市
        $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
        //身高
        ob_start();
        require_once MooTemplate('public/mail_space_messagetpl', 'module');
        //模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid);
        $week_time = 24 * 3600 * 7;
        //一周时间秒数
        $interval_time = $timestamp - $user_arr['last_login_time'];
        //当前时间-最后登录时间
        $date1 = date("Y-m-d", strtotime("last Monday"));
        $date2 = date("Y-m-d", strtotime("Sunday"));
        if ($interval_time > $week_time) {
            //不活跃用户每周发一条短信
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true);
            if ($cos['c'] <= 1) {
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        } else {
            //活跃用户每天一条
            //每天该用户超过5条信息不发送短信
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true);
            if ($cos['c'] < 5) {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        }
        //note 发送资料给接收方
        if ($send_mymessage) {
        }
        //note 备份邮件操作
        if ($message_back) {
            //note 发送MAIL时所需信息
            $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'");
            //note 发送MAIL时收信人的邮箱
            $ToAddress = $user['username'];
            //note 发送MAIL时主题
            $ToSubject = '提示:您在真爱一生网所发的消息备份';
            //note 发送MAIL时Body内容所需信息
            $username = $user['nickname'];
            //note 发送MAIL时Body内容所需信息
            $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'");
            if ($username) {
                $ToBody = $username;
            } else {
                $ToBody = 'ID号为' . $mid . '的会员<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>';
            } else {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>';
            }
            if ($username) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                $suc = "发送成功,真爱一生审核后对方即可以收到。";
                echo return_data($suc, true);
                exit;
            } else {
                $suc = "发送成功";
                echo return_data($suc, true);
                exit;
            }
        } else {
            $err = "发送失败";
            echo return_data($err, false);
            exit;
        }
    } else {
        $err = "数据填写不完整";
        echo return_data($err, false);
        exit;
    }
}
Пример #12
0
<?php

include "../function.php";
$fp = fopen("download/ver.txt", "r");
$str = fread($fp, filesize("download/ver.txt"));
fclose($fp);
echo return_data($str, true);
exit;
Пример #13
0
<?php

// 課題5:戻り値としてある人物のid(数値),名前,生年月日、住所を返却し、
//受け取った後はid以外の値を表示する
function return_data()
{
    return array(3, "kano", 517, "神奈川");
}
$data = return_data();
//リターンが使えるように変数を指定する
echo $data[1] . $data[2] . $data[3];
Пример #14
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');
}
Пример #15
0
 function return_error($err, $title = '')
 {
     global $rarr;
     $rarr['notify'][] = array($err, $title, 'error');
     return_data();
 }
Пример #16
0
    $config = str_replace('%%pass%%', $_REQUEST['sqlpass'], $config);
    $config = str_replace('%%database%%', $_REQUEST['sqlbase'], $config);
    $config = str_replace('%%SQL_PREFIX_%%', $_REQUEST['sqlprefix'], $config);
    $config = str_replace('%%ROOT_URL%%', $_REQUEST['sqlrooturl'], $config);
    if (@file_put_contents('./Entete.php', $config) === false) {
        return_data('Écriture du fichier de configuration impossible');
    }
    @chmod('./Entete.php', '0777');
    return_data('Fichier de configuration temporaire créer', '1');
}
if ($_REQUEST['act'] == 'endinstall') {
    if (DEBUG_PLAIN) {
        @unlink('./Entete.php');
        @unlink('./install.lock');
        return_data('Test terminé. raz également');
    } else {
        $file = @file_get_contents('./Entete.php');
        if (@file_put_contents('../Script/Entete.php', $file) === false) {
            return_data('Écriture du fichier de configuration final impossible');
        }
        return_data('Terminé.', '1');
    }
}
return_data('Unknown action');
function return_data($value, $nextstep = '0')
{
    global $xml;
    $xml = str_replace('%msg%', $value, $xml);
    $xml = str_replace('%nextstep%', $nextstep, $xml);
    die($xml);
}
Пример #17
0
function sendmes()
{
    global $_MooClass, $dbTablePre, $memcached;
    //$telphone = MoogetGPC ( 'tel', 'string', 'G' );
    if ($_GET['tel']) {
        $telphone = $_GET['tel'];
        $tele = $telphone % 1000000000;
    } else {
        $return = "未填写手机号码";
        echo return_data($return, false);
        exit;
    }
    $sql = "select sendtime from {$dbTablePre}smslog_sys where uid = '{$tele}' ";
    $r = $_MooClass['MooMySQL']->getOne($sql, true);
    $time = time();
    if ($r['sendtime']) {
        if ($time < $r['sendtime'] + 60) {
            $return = "1分钟内只能发送1次验证码,请稍后再试!";
            exit(return_data($return, false));
        }
    }
    $rand = rand(362144, 965421);
    if (SendMsg($telphone, "欢迎您注册真爱一生网!您本次注册的手机认证码为:" . $rand . ",本认证码1小时内有效。")) {
        $sql = "select count(*) as a from {$dbTablePre}smslog_sys where uid = '{$tele}' ";
        $r1 = $_MooClass['MooMySQL']->getOne($sql, true);
        if ($r1[a] == 0) {
            $sql = "INSERT INTO {$dbTablePre}smslog_sys (id,sid,uid,content,sendtime,type) values('','','{$tele}','{$rand}','{$time}','注册验证码')";
        } else {
            $sql = "UPDATE {$dbTablePre}smslog_sys set content='{$rand}' , sendtime = '{$time}' where uid='{$tele}' ";
        }
        //$sql = "REPLACE INTO {$dbTablePre}smslog_sys set content='$rand' where uid='$telphone' ";
        //$sql = "REPLACE INTO {$dbTablePre}smslog_sys (id,sid,uid,content,sendtime,type) values('','','$tele','$rand','$time','注册验证码')";
        $_MooClass['MooMySQL']->query($sql);
        $sql = "select content,sendtime from {$dbTablePre}smslog_sys where uid = '{$tele}' ";
        $r2 = $_MooClass['MooMySQL']->getOne($sql, true);
        $return = "验证码已发送";
        //echo $r2['content'].' '.$r2['sendtime'];
        echo return_data($return, true);
        exit;
    } else {
        $return = "发送短信验证码失败";
        echo return_data($return, false);
        exit;
    }
}
Пример #18
0
function quick_search_page($gender, $age_start, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $photo)
{
    global $_MooClass, $dbTablePre;
    global $user_arr, $userid, $last_login_time, $isdelcond, $isselectarea, $isdispmore, $isresult;
    $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
    $pagesize = 16;
    $page = 1;
    if (isset($_GET['page']) && $_GET['page']) {
        $page = $_GET['page'];
    }
    $offset = ($page - 1) * $pagesize;
    $blacklist = BlackList();
    $index = 'members_women';
    if ($gender == 0) {
        $index = 'members_man';
    }
    if ($age_start || $age_end) {
        if ($age_start == 0) {
            $age_start = 18;
        }
        if ($age_end == 0) {
            $age_end = 99;
        }
    }
    //	$sort_str = 'city_star desc,s_cid asc,@weight desc,city desc,province asc';
    //	$sortway = '1';
    //	if(isset($_GET['sortway']) && $_GET['sortway'] == '2'){
    //		//note 最新注册
    //		$sortway = '2';
    //		$sort_str = 'regdate desc,city_star desc,s_cid asc,@weight desc,city desc';
    //	}elseif(isset($_GET['sortway']) && $_GET['sortway'] == '3'){
    //		//note 诚信等级
    //		$sortway = '3';
    //		$sort_str = 'certification desc,city_star desc,s_cid asc,@weight desc,city desc';
    //	}
    //
    $cond[] = array('is_lock', '1', false);
    if ($photo) {
        $cond[] = array('images_ischeck', '1', false);
    }
    $cond[] = array('usertype', '1', false);
    if (is_array($blacklist) && !empty($blacklist)) {
        $cond[] = array('@id', implode('|', $blacklist), true);
    }
    if ($age_start && $age_end) {
        $year = date('Y', time());
        $cond[] = array('birthyear', array($year - $age_end, $year - $age_start), false);
    }
    if ($work_province) {
        $cond[] = array('province', $work_province, false);
    } elseif (isset($user_arr['province']) && $user_arr['province'] && !$work_city) {
        $cond[] = array('province', $user_arr['province'], false);
    }
    if ($work_city) {
        $cond[] = array('city', $work_city, false);
    } elseif (isset($user_arr['city']) && $user_arr['city'] && !$work_province) {
        $cond[] = array('city', $user_arr['city'], false);
    }
    $dispmore = false;
    if ($work_province || $work_city) {
        $isselectarea = true;
        $isdispmore = false;
        $dispmore = MooGetGPC('dm');
        if ($dispmore) {
            $isdispmore = true;
        }
    }
    if ($marriage) {
        $cond[] = array('marriage', $marriage, false);
    }
    if ($salary) {
        $cond[] = array('salary', $salary, false);
    }
    if ($education) {
        $cond[] = array('education', $education, false);
    }
    if ($height1 || $height2) {
        if ($height1 == 0) {
            $cond_height1 = 154;
        } else {
            $cond_height1 = $height1;
        }
        if ($height2 == 0) {
            $cond_height2 = 201;
        } else {
            $cond_height2 = $height2;
        }
        $cond[] = array('height', array($cond_height1, $cond_height2), false);
    }
    $sortway = MooGetGPC('sortway');
    $sort_str = getSortsStr($sortway, $cond);
    $rs = sphinx_search($index, $cond, $sort_str, $page, $pagesize);
    if (!$rs || is_array($rs) && empty($rs)) {
        //没有结果
        //MooMessage("您指定的搜索不存在或已过期", "index.php?n=search", '03');
        $error = "找不到匹配的结果";
        echo return_data($error, false);
        exit;
    } else {
        $data = $rs['user'];
        $total = $rs['total'];
        if ($total > 600) {
            $total = 600;
        }
        $user_list = implode(',', $data);
        if (empty($data)) {
            //MooMessage("您指定的搜索不存在或已过期", "index.php?n=search", '03');
            $error = "找不到匹配的结果";
            echo return_data($error, false);
            exit;
        } else {
            $user = array();
            $sortway = isset($_GET['sortway']) ? $_GET['sortway'] : '1';
            $sql = "select s.*,b.mainimg,b.showinformation_val from `{$dbTablePre}members_search` s left join `{$dbTablePre}members_base` b on s.uid=b.uid where s.uid in ({$user_list})";
            $user = $_MooClass['MooMySQL']->getAll($sql);
            $sql = "select lastvisit from web_members_login where uid in ({$user_list})";
            $user_lastvisit = $_MooClass['MooMySQL']->getAll($sql);
            foreach ($user_lastvisit as $key => $val) {
                $user[$key]['lastvisit'] = $val['lastvisit'];
            }
        }
        //会员基本信息补充
        if ($user) {
            $user = userbasicadd($user);
            //排序
            $tmp_user = array();
            foreach ($data as $k => $v) {
                foreach ($user as $key => $val) {
                    if ($v == $val['uid']) {
                        $tmp_user[] = $user[$key];
                        break;
                    }
                }
            }
            $user = $tmp_user;
            foreach ($user 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;
            /*
            			foreach($user as $va){
            				echo $va['nickname'].'<br />';
            			}
            			exit;*/
            //$error = "找不到匹配的结果";
            /*	
            $str = 'gender:'.$gender.'age_start:'.$age_start.'age_end:'.$age_end.'work_province:'.$work_province.'work_city:'.$work_city.'marriage:'.$marriage.'salary'
            .$salary.'education:'.$education.'height1:'.$height1.'height2:'.$height2;
            
            $return[] = $str;
            $return[] = $user;
            */
            //echo return_data($user,true);exit;
        }
        //note 找不到匹配的结果返回单独提示页面
        if (empty($user) && empty($user1)) {
            $error = "找不到匹配的结果";
            echo return_data($error, false);
            exit;
        }
    }
}
Пример #19
0
$serverid = Moo_is_kefu();
if (isset($_MooCookie['kefu'])) {
    $kefu = MooAuthCode($_MooCookie['kefu'], 'DECODE');
    if ($kefu) {
        list($hzn, $adminid) = $arr = explode("\t", $kefu);
    }
}
$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;
} else {
    $user_arr = MooMembersData($userid);
}
$h = empty($_GET['s']) ? '' : $_GET['s'];
switch ($h) {
    case 'newcon':
        require 'newcon.php';
        break;
    default:
        require 'newcon.php';
        break;
}
Пример #20
0
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;
    }
}
Пример #21
0
            register_stepone();
        }
        if (empty($error) && $uid) {
            global $uuid;
            certification("telphone", $telphone, $uid);
            $uuid = user_md5_id($uid);
            $memcached->set('uuid_' . $uid, $uuid, 0, 0);
            $memcached->set('uid_' . $uid, $uid, 0, 0);
            $user['uuid'] = $uuid;
            $return = array();
            $return = array('uuid' => $uuid, 'uid' => $uid);
            echo return_data($return);
            exit;
        } else {
            $error = "注册失败,请重新注册";
            echo return_data($error, FALSE);
            exit;
        }
        break;
        //	     default :
        //		register_stepone ();
        //		break;
}
function certification($key, $val, $uid)
{
    global $_MooClass, $dbTablePre;
    $sql = "select count(*) as a from {$dbTablePre}certification where uid='{$uid}' ";
    $r = $_MooClass['MooMySQL']->getone($sql, true);
    if ($r[a] == 0) {
        $sql = " insert into {$dbTablePre}certification (uid,{$key}) values('{$uid}','{$val}')";
    } else {