function sendto_m() { global $_MooClass, $dbTablePre, $uid, $user_arr; if (isset($_POST['actio']) && $_POST['actio'] == '1') { $mailadd = safeFilter(MooGetGPC('mailadd', 'string', 'P')); $content = safeFilter(MooGetGPC('content', 'string', 'P')); $title = safeFilter(MooGetGPC('title', 'string', 'P')); $sendid = MooGetGPC('sendid', 'string', 'P'); if ($mailadd && $content && $title) { $mailarr = explode(',', $mailadd); $date = ''; if (!$sendid) { $date = date('YmdHis') . rand(1111, 9999); $reg = "/^([a-z0-9\\+_\\-\\.]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}\$/"; $vals = array(); foreach ($mailarr as $val) { $val = trim($val); if (preg_match($reg, $val)) { $vals[] = " ('','" . $val . "','" . $date . "')"; } } $vals = join(',', $vals); if (!empty($vals)) { $sql = "insert into {$dbTablePre}email values"; $sql .= $vals; $_MooClass['MooMySQL']->query($sql); } } $content .= "您找到心中的TA了吗?如果没有,常来真爱一生网看看(http://www.zhenaiyisheng.cc/index.php?puid={$user_arr['uid']}),付出您的真心与真情,真爱一生必定为您牵线连理,让您轻松、快捷地找到知己好友 ,祝愿天下有情人终成眷属!\n\t您恋爱了吗?您结婚了吗?如果没有,就来真爱一生网看看( http://www.zhenaiyisheng.cc/index.php?puid={$user_arr['uid']})吧!"; MooSendMail($mailadd, $title, $content, $is_template = true, $sendid); MooMessage("感谢您对真爱一生网的支持", 'index.php?n=invite&h=mail&sendid=' . $date); } else { MooMessage("信息不完整!", 'index.php?n=invite&h=mail'); } } else { $sendid = trim(MooGetGPC('sendid', 'string', 'G')); $t = $mail_str = ''; if (preg_match("/\\d{18}/", $sendid)) { $sql = "select `email` from {$dbTablePre}email where sendid='{$sendid}' limit 10"; $st = $_MooClass['MooMySQL']->getAll($sql); if ($st) { foreach ($st as $val) { $mail_str .= $t . $val['email']; $t = ','; } } } require MooTemplate('public/invite_mail', 'module'); } }
function register_steptwo() { global $_MooClass, $dbTablePre, $uid, $user_arr, $_MooCookie; $userinfo = $user_arr; $password = isset($_MooCookie['password2']) ? $_MooCookie['password2'] : ''; MooSetCookie('password2', ''); $userchoice = MooGetData('members_choice', 'uid', $uid); $telphonecheck = MooGetGPC('telphonecheck', 'string'); if (MooSubmit('register_submittwo')) { // note members表字段 $members_search['nickname'] = safeFilter(rtrim(MoogetGPC('nickname', 'string', 'P'))); $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P'); // update1_arr $members_search['height'] = MoogetGPC('height', 'integer', 'P'); $members_search['salary'] = MoogetGPC('salary', 'integer', 'P'); $members_search['education'] = MoogetGPC('education1', 'integer', 'P'); $members_search['children'] = MoogetGPC('children1', 'integer', 'P'); $members_search['house'] = MoogetGPC('house', 'integer', 'P'); $members_search['updatetime'] = time(); $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P'); $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true); if ($gender['gender'] == 0) { $members_choice['gender'] = 1; } else { $members_choice['gender'] = 0; } $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P'); // $update2_arr $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P'); $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P'); $members_choice['workCity'] = MoogetGPC('workCity', 'integer', 'P'); if (in_array($members_choice['workprovince'], array(10101201, 10101002))) { $members_choice['workcity'] = $members_choice['workprovince']; $members_choice['workprovince'] = 10101000; } $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P'); $members_choice['education'] = MoogetGPC('education2', 'integer', 'P'); $members_choice['children'] = MoogetGPC('children2', 'integer', 'P'); $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P'); $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P'); $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P'); $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P'); $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P'); $members_choice['body'] = MoogetGPC('body2', 'integer', 'P'); $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P'); $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P'); $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P'); $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P'); $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P'); $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P'); $members_choice['updatetime'] = time(); if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) { $members_choice['hometowncity'] = $members_choice['hometownprovince']; $members_choice['hometownprovince'] = 10101000; } $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P'); $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P'); $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P'); // *********内心独白处理**********// $members_introduce['introduce'] = MoogetGPC('introduce', 'string', 'P'); // $update2_arr $members_introduce['introduce_check'] = safeFilter(rtrim(MoogetGPC('introduce', 'string', 'P'))); $telcheck = MoogetGPC('telcheck', 'string'); $truetelphone = MoogetGPC('truetelphone', 'string'); $telphonemack = md5(md5(MoogetGPC('telphonemack', 'string', 'P'))); $web_rand = $_MooCookie['rand']; // wxmtest******************************************** // SQL条件 $where_arr = array('uid' => $uid); if ($members_search || $members_choice) { // 会员基本信息 //if ($members_search) { // 判断昵称 if (rtrim($members_search['nickname']) != '') { if (preg_match('/^((1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*))$/', $members_search['nickname'])) { MooMessage("昵称不符合规范!", "index.php?n=register&h=steptwo"); } // note 昵称截取 $members_search['nickname'] = MooCutstr($members_search['nickname'], 12, $dot = ''); // 更新数据 updatetable('members_search', $members_search, $where_arr); updatetable('members_base', $members_base, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_search', 'uid', $uid, $members_search); MooFastdbUpdate('members_base', 'uid', $uid, $members_base); } // searchApi("members_man // members_women")->updateAttr(array('nickname','marriage','height','salary','education','children','house'),array(9888888888=>$search)); } else { MooMessage("昵称必填!", "index.php?n=register&h=steptwo"); } //} if ($members_choice) { updatetable('members_choice', $members_choice, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice); } } if ($members_introduce) { // 内心独白必填 // if($update2_arr['introduce_check'] != ''){ $members_introduce['introduce'] = ''; $members_introduce['introduce_pass'] = '******'; updatetable('members_introduce', $members_introduce, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce); } // }else{ // MooMessage("内心独白必填!", "index.php?n=register&h=steptwo"); // } } MooMessage("进入下一步!", "index.php?n=register&h=stepthree"); } } include MooTemplate('public/register_steptwo', 'module'); }
function payment_ifyouaretheone_reg() { global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr; if ($_POST) { $name = safeFilter(MooGetGPC('name', 'string', 'P')); $profession = safeFilter(MooGetGPC('profession', 'string', 'P')); $mobile = safeFilter(MooGetGPC('mobile', 'string', 'P')); $telphone = safeFilter(MooGetGPC('telphone', 'string', 'P')); $qq = safeFilter(MooGetGPC('qq', 'string', 'P')); $msn = safeFilter(MooGetGPC('msn', 'string', 'P')); $email = safeFilter(MooGetGPC('email', 'string', 'P')); $lovede = safeFilter(MooGetGPC('lovede', 'string', 'P')); $description = safeFilter(MooGetGPC('description', 'string', 'P')); $lovede1 = safeFilter(MooGetGPC('lovede1', 'string', 'P')); $description1 = safeFilter(MooGetGPC('description1', 'string', 'P')); $ip = GetIP(); $uid = $userid; $dateline = time(); //note 如果用户没有填写爱情宣言或者自我描述 if ($lovede == $lovede1) { $lovede = ""; } if ($description == $description1) { $description = ""; } //note 限制爱情宣言和自我描述进库的字数 $lovede = MooCutstr($lovede, "1000"); $description = MooCutstr($description, "1000"); //note 表单每一项都要填写 if (!empty($name) && !empty($profession) && !empty($mobile) && !empty($lovede) && !empty($description)) { $sql = "insert into {$dbTablePre}ifyouaretheone (uid,name,profession,mobile,telphone,qq,msn,email,lovede,description,ip,dateline) \n values('{$uid}','{$name}','{$profession}','{$mobile}','{$telphone}','{$qq}','{$msn}','{$email}','{$lovede}','{$description}','{$ip}','{$dateline}')"; $_MooClass['MooMySQL']->query($sql); MooMessage("您的注册报名成功!", "index.php", '05'); } else { MooMessage("提交失败,请填写完整!", "index.php?n=payment&h=ifyouaretheone_reg", '02'); } } include MooTemplate('public/payment_ifyouaretheone_reg', 'module'); }
function service_comment() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $timestamp, $memcached; $sendtoid = MooGetGPC('sendtoid', 'integer'); $userid = $user_arr['uid']; if (empty($sendCommentCount)) { $sendCommentCount = 0; } $sendCommentCount = $memcached->get('sendComment' . $userid); if ($sendCommentCount > 10) { MooMessage('当天累计评价超过10条', 'javascript:history.go(-1);', '04'); } if ($serverid && $user_arr['usertype'] != 3) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'"); $pic_total = $query['c']; $send_user = leer_send_user1($sendtoid); $send_user_gender = $send_user['gender'] == 1 ? "女" : "男"; //发送者性别 if ($sendtoid == $userid) { MooMessage('自己不可以给自己评价', 'javascript:history.go(-1);'); exit; } if ($send_user['gender'] == $user_arr['gender']) { MooMessage('同性之间不可以评价', 'javascript:history.go(-1);'); exit; } //提交评价 if ($_POST) { $data['cuid'] = $user_arr['uid']; $data['uid'] = MooGetGPC('uid', 'integer', 'P'); $data['dateline'] = time(); $data['content'] = trim(safeFilter(MooGetGPC('content', 'string', 'P'))); if (empty($data['content'])) { MooMessage('评价内容不能为空', 'javascript:history.go(-1);'); } $members = MooMembersData($data['uid']); if (empty($members)) { MooMessage('您评价的用户不存在,请确认', 'javascript:history.go(-1);'); } inserttable('members_comment', $data); $send_user_gender = $user_arr['gender'] == 1 ? "女" : "男"; //发送者性别 $memcached->set('sendComment' . $userid, ++$sendCommentCount, 0, 28800); //************提醒所属客服************** $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); if ($members['usertype'] == 1) { //fanglin暂时屏蔽 Push_message_intab($sendtoid, $members['telphone'], "评价人", "用户ID:" . $userid . "," . $send_user_gender . ",已关注了您,请速查看!4008787920【真爱一生网】", $userid); } MooMessage('评价成功', 'index.php?n=space&h=viewpro&uid=' . $data['uid'], '05'); 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; } require MooTemplate('public/service_comment', 'module'); }
function about_clinic_add() { global $timestamp, $user_arr, $arr_clinic_type; //print_r($user_arr);exit; if ($_POST) { $date = array(); $date['type'] = MooGetGPC('clinictype', 'integer', 'P'); $date['uid'] = $user_arr['uid']; $date['title'] = safeFilter(MooGetGPC('title', 'string', 'P')); $date['question'] = safeFilter(MooGetGPC('clinic', 'string', 'P')); $date['add_time'] = $timestamp; $sql = "SELECT sort FROM {$GLOBALS['dbTablePre']}love_clinic WHERE type = {$date['type']} ORDER BY sort DESC LIMIT 0,1"; $ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $date['sort'] = ++$ret['sort']; inserttable('love_clinic', $date); MooMessage("您的情感问题已经提交成功,真爱一生情感专家会在24小时内解决您的问题。\n感谢您对真爱一生网的信任与支持。", "index.php?n=about&h=clinic", '03'); } }
function service_bind() { global $_MooClass, $dbTablePre, $userid, $user_arr, $user_pic, $serverid; $bindMsg = ''; $time = time(); $b_uid = MooGetGPC('buid', 'integer', 'P'); $sendid = MooGetGPC('sendid', 'integer', 'G'); if ($sendid == 0) { $sendid = MooGetGPC('sendtoid', 'integer', 'G'); } $sendid = $sendid ? $sendid : $b_uid; if (MOOPHP_ALLOW_FASTDB) { $user_s = MooFastdbGet('members_search', 'uid', $sendid); $user_b = MooFastdbGet('members_base', 'uid', $sendid); $user_s = array_merge($user_s, $user_b); } else { $user_s = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_search,{$dbTablePre}members_base WHERE uid = '{$sendid}' and {$dbTablePre}members_search.uid={$dbTablePre}members_base.uid"); } /*if($hzn == "hongniangwang"){ 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; } if ($user_s['gender'] == $user_arr['gender']) { MooMessage("同性之间不能绑定。", 'javascript:history.go(-1);', '02'); } if ($user_arr['bind_id'] > 0) { if ($user_arr['isbind'] != 0) { $bindMsg = '您已经在绑定状态了。'; } else { $bindMsg = '您的绑定正在申请中。'; } } else { $tmp_bind = $_MooClass['MooMySQL']->getOne("SELECT start_time,length_time FROM {$dbTablePre}members_bind WHERE (a_uid={$user_arr['uid']} OR b_uid={$user_arr['uid']}) AND bind=2 ORDER BY id DESC LIMIT 1", true); //echo $sql; if ($time - $tmp_bind['start_time'] + $tmp_bind['length_time'] < 86400) { $bindMsg = "绑定解除后的24小时内不能再次申请绑定。"; } } if ($bindMsg == '') { if ($b_uid > 0 && $user_s['isbind'] == 0) { $apply_con = safeFilter(MooGetGPC('content1', 'string', 'P')); $ltime = MooGetGPC('ltime', 'integer', 'P'); $sql = "INSERT INTO {$dbTablePre}members_bind SET a_uid={$user_arr['uid']},b_uid={$b_uid},apply_con='{$apply_con}',dateline='" . $time . "',apply_ltime=" . $ltime; $query = $_MooClass['MooMySQL']->query($sql); $bind_id = $_MooClass['MooMySQL']->insertId(); @$_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET bind_id=" . $bind_id . " WHERE uid=" . $user_arr['uid']); //预先更新申请人的bind_id, if (MOOPHP_ALLOW_FASTDB) { $value = array(); $value['bind_id'] = $bind_id; MooFastdbUpdate("members_base", 'uid', $user_arr['uid'], $value); } if ($user_s['is_phone']) { $gender = $user_arr['gender'] ? '女' : '男'; //发送短信 SendMsg($user_s['telphone'], "真爱一生网 用户ID:" . $user_arr['uid'] . "," . $gender . ",已给委托真爱一生绑定您,请及时把握您的缘分!4006780405"); //Push_message_intab($sendid,$user_s['telphone'],"绑定","真爱一生网 用户ID:".$user_arr['uid'].",".$gender.",已给委托真爱一生绑定您,请及时把握您的缘分!4006780405",$user_arr['uid']); } MooMessage("申请成功!请等待真爱一生的联系与确定。", 'javascript:history.go(-2);', '05'); } elseif ($user_s['isbind'] > 0 || $user_s['bind_id'] > 0) { $statue = 1; //得到与TA绑定的user信息 $sql = "SELECT a_uid,b_uid,length_time FROM {$dbTablePre}members_bind WHERE id=" . $user_s['bind_id']; $m_bind = $_MooClass['MooMySQL']->getOne($sql); if ($user_s['bind_id'] > 0 && $m_bind['isbind'] == 0) { //MooMessage("会员{$user_s['uid']}正在申请与其他会员绑定中...",'javascript:history.go(-2);'); } $f_uid = $m_bind['a_uid'] == $sendid ? $m_bind['b_uid'] : $m_bind['a_uid']; //echo $f_uid,'|',$m_bind['a_uid'],'|',$m_bind['b_uid']; if (MOOPHP_ALLOW_FASTDB) { $user_bind = MooFastdbGet('members_base', 'uid', $f_uid); } else { $user_bind = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_base WHERE uid = '{$f_uid}'"); } require MooTemplate('public/service_contact_binding', 'module'); exit; } } require MooTemplate('public/service_contact_bind', 'module'); }
function story_upload() { global $_MooClass, $dbTablePre, $userid, $timestamp; global $user_arr; //note 获得那几个步骤 $story1 = MooGetGPC('story1', 'string'); $story2 = MooGetGPC('story2', 'string'); $pics = MooGetGPC('pics', 'string'); //note 提交第一步的变量赋值 if ($story1) { $name1 = safeFilter(MooGetGPC('name1', 'string')); $name2 = safeFilter(MooGetGPC('name2', 'string')); $state = MooGetGPC('state', 'integer'); $year = MooGetGPC('year', 'integer'); $month = MooGetGPC('month', 'integer'); $day = MooGetGPC('day', 'integer'); } //note 提交第二步变量赋值 if ($story2 || $pics) { $title = safeFilter(MooGetGPC('subject', 'string')); $content = safeFilter(MooGetGPC('content', 'string')); $insert_id = MooGetGPC('insertId', 'integer'); $img_title = safeFilter(MooGetGPC('imgTitle', 'string')); } //note 如果已经提交故事就显示标题和内容,爱情进程,时间 $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); //note 提交故事第一步 if ($story1 && $name1 && $name2 && $state && $year && $month && $day) { //note 如果没有选择甜蜜进程就退出 $storybasic = $_COOKIE['storybasic']; $state == '-1' && exit; $story_date = mktime(0, 0, 0, $month, $day, $year); //note 已经写故事了,就更新已有的故事 //判断是否更新 $str = $name1 . $name2 . $state . $story_date; $md5str = md5($str); if ($love_story['sid']) { if ($md5str != $storybasic) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET name1 = '{$name1}',name2 = '{$name2}',state = '{$state}',story_date = '{$story_date}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$love_story['sid']}'"); } $insert_id = $love_story['sid']; } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story (uid,name1,name2,state,story_date,submit_date) values ('{$userid}','{$name1}','{$name2}','{$state}','{$story_date}','{$timestamp}')"); $insert_id = $_MooClass['MooMySQL']->insertId(); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); require MooTemplate('public/story_upload2', 'module'); //note 更新提交故事第二步 } else { if ($story2 && $insert_id) { $storycontent = isset($_COOKIE['storycontent']) ? $_COOKIE['storycontent'] : ''; $md5content = md5($title . $content); if ($md5content != $storycontent) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$insert_id}'"); $lsql = "UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}', syscheck = '0' WHERE sid = '{$insert_id}'"; } //提示消息 MooMessage("您的爱情故事已上传成功,感谢您和我们分享您的幸福。", "index.php?n=story", '05'); //note 上传相册中的照片的时候 } else { if ($pics && $insert_id) { $album = $_MooClass['MooMySQL']->getAll("SELECT count(1) as count FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); //note 如果上传照片超过30个图片,不允许上传 if ($album['count'] > '30') { MooMessage("您上传的图片已满30张!不可以在上传新的图片了", "index.php?n=story", '03'); } //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP'); $maxfilesize = 1024 * 1024; $filesize = $_FILES['pic']['size']; foreach ($images as $v) { if (eregi($v, $_FILES['pic']['type'])) { $file_content = file_get_contents($_FILES['pic']['tmp_name']); $low_file_content = strtolower($file_content); $pos = strpos($low_file_content, '<?php'); if ($pos) { $notice = "照片中含有不安全信息请重新上传"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } else { $flag = 1; } } } if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } if ($filesize > $maxfilesize) { $notice = "上传图片大小不得大于1M"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } //note 上传到指定目录,并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => STORY_IMG_PATH, 'saveType' => '0')); $files = $upload->saveFiles('pic'); $story_picname = $files[0]['name'] . "." . $files[0]['extension']; $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}' WHERE sid = '{$insert_id}'"); if ($story_picname) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story_pic (img,sid,uid,submit_date,title) values ('{$story_picname}','{$insert_id}','{$userid}','{$timestamp}','{$img_title}')"); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); $prompt = '<script>alert("上传成功,您可以继续上传")</script>'; include MooTemplate('public/story_upload2', 'module'); } else { //note 故事日期 $story_date = $love_story['story_date']; $show_year = date("Y", $story_date); $show_month = date("n", $story_date); $show_date = date("j", $story_date); $md5str = $love_story['name1'] . $love_story['name2'] . $love_story['state'] . $love_story['story_date']; $md5basic = md5($md5str); setcookie("storybasic", $md5basic); include MooTemplate('public/story_upload1', 'module'); } } } }
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'); }
function dealDetailInfo() { global $_MooClass, $dbTablePre, $userid, $user_arr; checkAuthMod('index.php?n=material'); //客服模拟登录操作没有修改权限 //note memberfield表字段 $members_base['qq'] = MoogetGPC('qq', 'string', 'P'); $members_base['msn'] = MoogetGPC('msn', 'string', 'P'); $members_search['body'] = MoogetGPC('body3', 'integer', 'P'); $members_search['hometownprovince'] = MoogetGPC('hometownProvince3', 'integer', 'P'); //籍贯所在地 $members_search['hometowncity'] = MoogetGPC('hometownCity3', 'integer', 'P'); if (in_array($members_search['hometownprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_search['hometowncity'] = $members_search['hometownProvince']; $members_search['hometownprovince'] = 10101000; } $members_base['currentprovince'] = MoogetGPC('currentprovince', 'integer', 'P'); //目前所在地 $members_base['currentcity'] = MoogetGPC('currentcity', 'integer', 'P'); if (in_array($members_base['currentprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_base['currentcity'] = $members_base['currentprovince']; $members_base['currentprovince'] = 10101000; } $members_search['nation'] = MoogetGPC('stock3', 'integer', 'P'); $members_base['nature'] = MoogetGPC('nature3', 'integer', 'P'); $members_search['truename'] = safeFilter(MoogetGPC('truename', 'string', 'P')); $members_search['weight'] = MoogetGPC('weight', 'integer', 'P'); $members_search['animalyear'] = MoogetGPC('animals', 'integer', 'P'); $members_search['constellation'] = MoogetGPC('constellation', 'integer', 'P'); $members_search['bloodtype'] = MoogetGPC('bloodtype', 'integer', 'P'); $members_search['religion'] = MoogetGPC('belief', 'integer', 'P'); $members_base['finishschool'] = MoogetGPC('finishschool', 'string', 'P'); $members_search['family'] = MoogetGPC('family', 'integer', 'P'); $members_search['language'] = ArrToStr(MoogetGPC('tonguegifts', 'array', 'P')); if (isset($members_search)) { $members_search['updatetime'] = time(); } //期望交友所在地区 foreach ($_POST['friendprovince'] as $key => $val) { if (in_array($val, array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $_POST['friendcity'][$key] = $val; $val = 10101000; } $friend_area[][$val] = $_POST['friendcity'][$key]; } $friendprovince = serialize($friend_area); $members_base['friendprovince'] = $friendprovince; //note QQ格式 if ($members_base['qq'] != '' && !preg_match('/^\\d{4,12}$/', $members_base['qq'])) { MooMessage("QQ格式不正确!", "javascript:history.go(-1)"); } $where_arr = array('uid' => $userid); //memberfield表 foreach ($members_base as $key => $val) { //if($val){ $members_base[$key] = $val; //} } foreach ($members_search as $key => $val) { $members_search[$key] = $val; } if (count($members_base) >= 1 || count($members_search) >= 1) { updatetable('members_base', $members_base, $where_arr); updatetable('members_search', $members_search, $where_arr); //note 快速常用搜索表更新 //fastsearch_update($userid,'1'); //note 快速高级搜索表更新 //fastsearch_update($userid,'2'); if (MOOPHP_ALLOW_FASTDB) { //print_r($members_base); MooFastdbUpdate('members_base', 'uid', $userid, $members_base); MooFastdbUpdate('members_search', 'uid', $userid, $members_search); } //searchApi("members_man members_women")->UpdateAttributes(array($userid=>$members_search)); } header("location:index.php?n=material&h=upinfo&actio=2"); }
function material_upinfo_submit() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached; $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = MooMembersData($userid); //checkAuthMod('index.php?n=material');//客服模拟登录操作没有修改权限 $validation = MooAutoLoad('MooValidation'); $uid = $userid; //$user_rank_id=get_userrank($userid); //var_dump($user_rank_id); //$update1_arr = $update2_arr = $update3_arr = array(); //note members表字段 $members_search = array(); $members_base = array(); $members_choice = array(); $members_introduce = array(); $birthyear = MooGetGPC('year', 'string', 'P'); $members_search['birthyear'] = $birthyear; $birthmonth = MooGetGPC('month', 'string', 'P'); $birthday = MooGetGPC('days', 'string', 'P'); $members_search['updatetime'] = time(); $members_search['nickname'] = safeFilter(MoogetGPC('nickname', 'string', 'P')); $members_search['telphone'] = MoogetGPC('telphone', 'string', 'P'); $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P'); $members_search['height'] = MoogetGPC('height', 'integer', 'P'); $members_search['salary'] = MoogetGPC('salary', 'integer', 'P'); $members_search['education'] = MoogetGPC('education1', 'integer', 'P'); $members_search['children'] = MoogetGPC('children1', 'integer', 'P'); $members_search['house'] = MoogetGPC('house', 'integer', 'P'); $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P'); $members_search['province'] = MoogetGPC('province', 'integer', 'P'); $members_search['city'] = MoogetGPC('city', 'integer', 'P'); if (in_array($members_search['province'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_search['city'] = $members_search['province']; $members_search['province'] = 10101000; } //note choice表字段 $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true); if ($gender['gender'] == 0) { $members_choice['gender'] = 1; } else { $members_choice['gender'] = 0; } //$update2_arr['sex'] = MoogetGpc('sex','integer','p'); $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P'); $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P'); $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P'); $members_choice['workcity'] = MoogetGPC('workCity', 'integer', 'P'); if (in_array($members_choice['workprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['workcity'] = $members_choice['workprovince']; $members_choice['workprovince'] = 10101000; } $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P'); $members_choice['education'] = MoogetGPC('education2', 'integer', 'P'); $members_choice['children'] = MoogetGPC('children2', 'integer', 'P'); $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P'); $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P'); $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P'); $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P'); $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P'); $members_choice['body'] = MoogetGPC('body2', 'integer', 'P'); $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P'); $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P'); $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P'); $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P'); $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P'); $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P'); if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['hometowncity'] = $members_choice['hometownProvince']; $members_choice['hometownprovince'] = 10101000; } $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P'); $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P'); $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P'); $members_introduce['introduce_check'] = safeFilter(trim(MoogetGPC('introduce', 'string', 'P'))); $rs = $user_arr; //note 验证状态 if (MOOPHP_ALLOW_FASTDB) { $sta = MooFastdbGet('certification', 'uid', $uid); } else { $sta = $_MooClass['MooMySQL']->getOne("select telphone from {$dbTablePre}certification WHERE uid='{$uid}'", true); } $where_arr = array('uid' => $uid); foreach ($members_search as $key => $val) { //无手机号吗 if ($key == 'telphone' && $val == '') { continue; } $memberssearch[$key] = $val; } // foreach ($members_base as $key=>$val){ // $membersbase[$key]=$val; // } if (count($members_base) >= 1 || count($memberssearch) >= 1) { $members_search['updatetime'] = time(); if (!rtrim($members_search['nickname'])) { $error = "昵称必填"; echo return_data($error, false); exit; } if (preg_match('/^(1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*)$/', $members_search['nickname'])) { //MooMessage("昵称不符合规范!", "javascript:history.go(-1)"); $error = "昵称不符合规范!"; echo return_data($error, false); exit; } //echo 'sss';exit; str_length($members_search['nickname']); //note 昵称截取 $members_search['nickname'] = MooCutstr($members_search['nickname'], 18, $dot = ''); if ($members_search['telphone'] && !preg_match('/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/', $members_search['telphone'])) { //MooMessage('请输入正确的手机号码','javascript:history.go(-1)'); $error = "请输入正确的手机号码"; echo return_data($error, false); exit; } //$birth=strtotime("$birthyear/$birthmonth/$birthday"); $birth = "{$birthyear}-{$birthmonth}-{$birthday}"; $members_base['birth'] = $birth; updatetable('members_base', $members_base, $where_arr); updatetable('members_search', $memberssearch, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $members_base); MooFastdbUpdate('members_search', 'uid', $uid, $memberssearch); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_search)); } //提交会员动态makui UpdateMembersSNS($uid, '修改了资料'); //内心独白必填 //if(rtrim($update2_arr['introduce_check'] != '')){ $members_introduce['introduce'] = ''; $members_introduce['introduce_pass'] = '******'; //if(isset($members_choice)){ $members_choice['updatetime'] = time(); updatetable('members_choice', $members_choice, $where_arr); //} updatetable('members_introduce', $members_introduce, $where_arr); if (MOOPHP_ALLOW_FASTDB) { $members_choice['uid'] = $uid; $members_introduce['uid'] = $uid; //print_r($update2_arr);exit; if (isset($members_choice)) { $members_choice['updatetime'] = time(); MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice); } MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_choice)); if (MOOPHP_ALLOW_FASTDB) { $userchoice = MooFastdbGet('members_choice', 'uid', $uid); $introduce = MooFastdbGet('members_introduce', 'uid', $uid); $userchoice = array_merge($userchoice, $introduce); } else { $userchoice = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_choice mc left join {$dbTablePre}members_introduce mi WHERE mc.uid=mi.uid AND uid = '{$uid}'", true); } //}else{ // MooMessage("内心独白必填!", "index.php?n=material&h=upinfo"); //} /* //低质量会员自动分配 if($user_rank_id == 0){ //以下信息都没选,都规为垃圾会员,自动分配给普通客服 if($update1_arr['height']=='-1' || $update1_arr['salary']=='-1' || $update1_arr['children']=='-1' || $update1_arr['oldsex']=='-1' || $update2_arr['age1']=='-1' || $update2_arr['age2']=='-1' || $update2_arr['marriage'] == '-1' || $update2_arr['children'] == '-1' || $update2_arr['body'] == '-1'){ invalid_user_allotserver($uid); } } */ if ($rs['telphone'] == $members_search['telphone'] || $sta['telphone'] == '' || $members_search['telphone'] == '') { $error = "修改成功"; echo return_data($error, true); exit; } else { //重新手机认证 $sql = "update {$dbTablePre}certification set telphone='' where uid='{$uid}'"; $_MooClass['MooMySQL']->query($sql); $certif_arr['telphone'] = ''; MooFastdbUpdate('certification', 'uid', $uid, $certif_arr); if (MOOPHP_ALLOW_FASTDB) { if (MOOPHP_ALLOW_FASTDB) { $certification_1 = MooFastdbGet('certification', 'uid', $userid); } else { $certification_1 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid = '{$userid}'", true); } } //Message("您的手机信息有变动请再次通过我们的验证",'index.php?n=myaccount&h=telphone'); $error = "您的手机信息有变动请再次通过我们的验证"; echo return_data($error, true); exit; } //note 快速常用搜索表更新 //fastsearch_update($userid,'1'); //note 快速高级搜索表更新 //fastsearch_update($userid,'2'); }
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 .= ' 发件人:' . $username . '<br>'; } else { $ToBody .= ' 发件人:ID号为' . $mid . '<br>'; } if ($toname['nickname']) { $ToBody .= ' 收件人:' . $toname['nickname'] . '<br>'; } else { $ToBody .= ' 收件人:ID号为' . $sid . '<br>'; } $ToBody .= ' 主题:' . $s_title . '<br>'; $ToBody .= ' 正文:<br> ' . $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; } }
function report($uid) { global $_MooClass, $dbTablePre, $userid, $user_arr, $timestamp; $serverid = Moo_is_kefu(); if ($serverid && $user_arr['usertype'] != 3) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //处理会员提交了数据 if (MooGetGPC('reportbutton', 'string', 'P')) { $u_id = safeFilter(MooGetGPC('uid', 'string', 'P')); $ruid = safeFilter(MooGetGPC('ruid', 'string', 'P')); $forwhy = MooGetGPC('forwhy', 'integer', 'P'); $umail = safeFilter(MooGetGPC('umail', 'string', 'P')); $content = safeFilter(MooGetGPC('content', 'string', 'P')); if ($forwhy == '0') { MooMessage('请选择您的举报原因', 'javascript:history.go(-1);'); exit; } if (rtrim($content) == '') { MooMessage('请选择您的举报内容', 'javascript:history.go(-1);'); exit; } //note 上传图片 if ($_FILES['pic']['size'] <= 5242880 && !empty($_FILES['pic']['size'])) { $extname = strtolower(substr($_FILES['pic']['name'], strrpos($_FILES['pic']['name'], '.') + 1)); //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP'); //foreach($images as $v) { //if(preg_match("/$v/",$_FILES['pic']['type'])) { $img_type = explode("/", $_FILES['pic']['type']); if (in_array($img_type[1], $images) && in_array($extname, $images)) { $flag = 1; } //} if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessage($notice, 'javascript:history.go(-1);'); exit; } //note 上传到指定目录,并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => REPORT_IMG_PATH, 'saveType' => '0')); $files = $upload->saveFiles('pic'); $report_picname = $files[0]['name'] . "." . $files[0]['extension']; //note 提交举报数据 $_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,pic,addtime) values ('{$u_id}','{$ruid}','{$forwhy}','{$umail}','{$content}','{$report_picname}','" . time() . "')"); //note 没有上传图片 } else { if ($_FILES['pic']['size'] > 5242880) { MooMessage('上传图片大小不能超过5M', 'javascript:history.go(-1);'); } else { MooMessage('必须上传图片作为举报证据', 'javascript:history.go(-1);'); } //note 提交举报数据 //$_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,addtime) values ('$u_id','$ruid','$forwhy','$umail','$content','".time()."')"); } //************提醒所属客服************** $sid = $user_arr['sid']; $title = '您的会员 ' . $user_arr['uid'] . ' 举报了 ' . $ruid; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); MooMessage('举报成功', 'javascript:history.go(-2);'); exit; } //note 两天内对同一位会员投诉只限一次 $reportcount1 = $_MooClass['MooMySQL']->getOne("select id from {$dbTablePre}report where uid='{$userid}' and ruid='{$uid}' and addtime>" . mktime(0, 0, 0, date('m', time() - 86400), date('d', time() - 86400), date('Y', time() - 86400))); if ($reportcount1) { MooMessage('对不起,您两天内对同一位会员投诉只限一次', 'javascript:history.go(-1);', '02'); exit; } else { //note 第天只能投诉5位会员 $reportcount = $_MooClass['MooMySQL']->getOne("select count(*) from {$dbTablePre}report where uid='{$userid}' and addtime>" . mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()))); if ($reportcount['count(*)'] >= 5) { MooMessage('对不起,您每天只能对5位不同的会员进行投诉', 'javascript:history.go(-1);', '02'); exit; } } //被投诉人不可能是自己 if ($userid == $uid) { MooMessage('不可以举报自己', 'javascript:history.go(-1);', '03'); } //被投诉人信息 if (MOOPHP_ALLOW_FASTDB) { $userinfo = MooFastdbGet('members_search', 'uid', $uid); } else { $userinfo = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid where uid='{$uid}'"); } $sql = "select count(*) as c from {$dbTablePre}pic where uid='{$uid}' and isimage=0"; $pic_num = $_MooClass['MooMySQL']->getOne($sql); if (!$userinfo) { MooMessage('无此用户', 'javascript:history.go(-1);', '03'); exit; } include MooTemplate('public/profile_index', 'module'); }
function postsInThreadByID($id, $moderated_only = true, $safeFilter = false) { $compClause = new OrWhereClause(); $compClause->add(new SimpleWhereClause(POST_ID, '=', $id, INTEGER_COMPARISON)); $compClause->add(new SimpleWhereClause(POST_PARENT, '=', $id, INTEGER_COMPARISON)); $rows = $GLOBALS['db']->selectWhere(POSTS_FILE, $compClause, -1, new OrderBy(POST_ID, ASCENDING, INTEGER_COMPARISON)); if ($safeFilter) { safeFilter($rows); } return convertPostsToSQLStyle($rows); }
function condition_in_update($gender, $age_start, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $weight1, $weight2, $body, $smoking, $drinking, $occupation, $house, $vehicle, $corptype, $children, $wantchildren, $home_townprovince, $home_towncity, $nation, $animalyear, $constellation, $bloodtype, $religion, $family, $language, $photo, $sid, $is_commend, $issavesearchname, $searchname, $currenturl) { global $_MooClass, $dbTablePre, $userid, $last_login_time; global $user_arr; // echo "搜索条件名称=".$searchname; // echo "<br>以前的搜索id=".$sid; // echo "<br>是否确定保存搜索条件=".$issavesearchname; // echo "<br>是否定期存到邮箱=".$is_commend;die; //note 搜索名称 $searchsign = safeFilter($searchname); //note 性别 if ($gender && is_array($gender)) { $searchcondition = '<gender>' . implode(',', $gender) . '</gender>'; } else { $searchcondition = '<gender>' . $gender . '</gender>'; } //note 年龄范围 if ($age_start && is_array($age_start)) { $searchcondition .= '<age_start>' . implode(',', $age_start) . '</age_start>'; } else { $searchcondition .= '<age_start>' . $age_start . '</age_start>'; } if ($age_end && is_array($age_end)) { $searchcondition .= '<age_end>' . implode(',', $age_end) . '</age_end>'; } else { $searchcondition .= '<age_end>' . $age_end . '</age_end>'; } //note 工作省、市 if ($work_province && is_array($work_province)) { $searchcondition .= '<work_province>' . implode(',', $work_province) . '</work_province>'; } else { $searchcondition .= '<work_province>' . $work_province . '</work_province>'; } if ($work_city && is_array($work_city)) { $searchcondition .= '<work_city>' . implode(',', $work_city) . '</work_city>'; } else { $searchcondition .= '<work_city>' . $work_city . '</work_city>'; } //note 婚姻 if ($marriage && is_array($marriage)) { $searchcondition .= '<marriage>' . implode(',', $marriage) . '</marriage>'; } else { $searchcondition .= '<marriage>' . $marriage . '</marriage>'; } //note 收入 if ($salary && is_array($salary)) { $searchcondition .= '<salary>' . implode(',', $salary) . '</salary>'; } else { $searchcondition .= '<salary>' . $salary . '</salary>'; } //note 教育程度 if ($education && is_array($education)) { $searchcondition .= '<education>' . implode(',', $education) . '</education>'; } else { $searchcondition .= '<education>' . $education . '</education>'; } //note 身高 if ($height1 && is_array($height1)) { $searchcondition .= '<height1>' . implode(',', $height1) . '</height1>'; } else { $searchcondition .= '<height1>' . $height1 . '</height1>'; } if ($height2 && is_array($height2)) { $searchcondition .= '<height2>' . implode(',', $height2) . '</height2>'; } else { $searchcondition .= '<height2>' . $height2 . '</height2>'; } //note 体重范围 if ($weight1 && is_array($weight1)) { $searchcondition .= '<weight1>' . implode(',', $weight1) . '</weight1>'; } else { $searchcondition .= '<weight1>' . $weight1 . '</weight1>'; } if ($weight2 && is_array($weight2)) { $searchcondition .= '<weight2>' . implode(',', $weight2) . '</weight2>'; } else { $searchcondition .= '<weight2>' . $weight2 . '</weight2>'; } //note 体型 if ($body && is_array($body)) { $searchcondition .= '<body1>' . implode(',', $body) . '</body1>'; } else { $searchcondition .= '<body1>' . $body . '</body1>'; } //note 是否吸烟 if ($smoking && is_array($smoking)) { $searchcondition .= '<smoking>' . implode(',', $smoking) . '</smoking>'; } else { $searchcondition .= '<smoking>' . $smoking . '</smoking>'; } //note 是否饮酒 if ($drinking && is_array($drinking)) { $searchcondition .= '<drinking>' . implode(',', $drinking) . '</drinking>'; } else { $searchcondition .= '<drinking>' . $drinking . '</drinking>'; } //note 从事职业 if ($occupation && is_array($occupation)) { $searchcondition .= '<occupation>' . implode(',', $occupation) . '</occupation>'; } else { $searchcondition .= '<occupation>' . $occupation . '</occupation>'; } //note 住房条件 if ($house && is_array($house)) { $searchcondition .= '<house>' . implode(',', $house) . '</house>'; } else { $searchcondition .= '<house>' . $house . '</house>'; } //note 是否购车 if ($vehicle && is_array($vehicle)) { $searchcondition .= '<vehicle>' . implode(',', $vehicle) . '</vehicle>'; } else { $searchcondition .= '<vehicle>' . $vehicle . '</vehicle>'; } //note 公司类别 if ($corptype && is_array($corptype)) { $searchcondition .= '<corptype>' . implode(',', $corptype) . '</corptype>'; } else { $searchcondition .= '<corptype>' . $corptype . '</corptype>'; } //note 是否有孩子 if ($children && is_array($children)) { $searchcondition .= '<children>' . implode(',', $children) . '</children>'; } else { $searchcondition .= '<children>' . $children . '</children>'; } //note 是否想要孩子 if ($wantchildren && is_array($wantchildren)) { $searchcondition .= '<wantchildren>' . implode(',', $wantchildren) . '</wantchildren>'; } else { $searchcondition .= '<wantchildren>' . $wantchildren . '</wantchildren>'; } //note 籍贯省、市 if ($home_townprovince && is_array($home_townprovince)) { $searchcondition .= '<home_townprovince>' . implode(',', $home_townprovince) . '</home_townprovince>'; } else { $searchcondition .= '<home_townprovince>' . $home_townprovince . '</home_townprovince>'; } if ($home_towncity && is_array($home_towncity)) { $searchcondition .= '<home_towncity>' . implode(',', $home_towncity) . '</home_towncity>'; } else { $searchcondition .= '<home_towncity>' . $home_towncity . '</home_towncity>'; } //note 名族 if ($nation && is_array($nation)) { $searchcondition .= '<nation>' . implode(',', $nation) . '</nation>'; } else { $searchcondition .= '<nation>' . $nation . '</nation>'; } //note 生肖 if ($animalyear && is_array($animalyear)) { $searchcondition .= '<animalyear>' . implode(',', $animalyear) . '</animalyear>'; } else { $searchcondition .= '<animalyear>' . $animalyear . '</animalyear>'; } //note 星座 if ($constellation && is_array($constellation)) { $searchcondition .= '<constellation>' . implode(',', $constellation) . '</constellation>'; } else { $searchcondition .= '<constellation>' . $constellation . '</constellation>'; } //note 血型 if ($bloodtype && is_array($bloodtype)) { $searchcondition .= '<bloodtype>' . implode(',', $bloodtype) . '</bloodtype>'; } else { $searchcondition .= '<bloodtype>' . $bloodtype . '</bloodtype>'; } //note 信仰 if ($religion && is_array($religion)) { $searchcondition .= '<religion>' . implode(',', $religion) . '</religion>'; } else { $searchcondition .= '<religion>' . $religion . '</religion>'; } //note 兄弟姐妹 if ($family && is_array($family)) { $searchcondition .= '<family>' . implode(',', $family) . '</family>'; } else { $searchcondition .= '<family>' . $family . '</family>'; } //note 几种语言 if ($language && is_array($language)) { $searchcondition .= '<language1>' . implode(',', $language) . '</language1>'; } else { $searchcondition .= '<language1>' . $language . '</language1>'; } //note 显示有照片的会员 if ($photo && is_array($photo)) { $searchcondition .= '<photo>' . implode(',', $photo) . '</photo>'; } else { $searchcondition .= '<photo>' . $photo . '</photo>'; } //note 搜索条件标签 if ($searchname && is_array($searchname)) { $searchcondition .= '<searchname>' . implode(',', $searchname) . '</searchname>'; } else { $searchcondition .= '<searchname>' . $searchname . '</searchname>'; } //note 是否保存 if ($issavesearchname && is_array($issavesearchname)) { $searchcondition .= '<issavesearchname>' . implode(',', $issavesearchname) . '</issavesearchname>'; } else { $searchcondition .= '<issavesearchname>' . $issavesearchname . '</issavesearchname>'; } // echo $searchcondition;die; //note 编辑搜索条件保存,update表 if ($sid) { $_MooClass['MooMySQL']->query("update `{$dbTablePre}searchbak` set `searchsign`='{$searchsign}',`searchcondition`='{$searchcondition}',`is_commend`='" . $is_commend . "' where `scid` = '{$sid}'"); //note 高级搜索时候,保存一次搜索条件 } else { $_MooClass['MooMySQL']->query("insert into `{$dbTablePre}searchbak` set `uid`='{$userid}',`searchsign`='{$searchsign}',`searchcondition`='{$searchcondition}',`is_commend`='" . $is_commend . "'"); } }
function service_comment() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid; $sendtoid = MooGetGPC('sendtoid', 'integer'); $userid = $user_arr['uid']; $send_user = leer_send_user1($sendtoid); $send_user_gender = $send_user['gender'] == 1 ? "女" : "男"; //发送者性别 //提交评价 if ($_POST) { $data['cuid'] = $user_arr['uid']; $data['uid'] = MooGetGPC('uid', 'integer', 'P'); $data['dateline'] = time(); $data['content'] = trim(safeFilter(MooGetGPC('content', 'string', 'P'))); if (empty($data['content'])) { MooMessage('评价内容不能为空', 'javascript:history.go(-1);'); } if (MOOPHP_ALLOW_FASTDB) { $members = MooFastdbGet('members', 'uid', $data['uid']); } else { $members = $_MooClass['MooMySQL']->getOne("select uid,gender,usertype,telphone,is_phone,username from {$dbTablePre}members where uid='{$data['uid']}'"); } if (empty($members)) { MooMessage('您评价的用户不存在,请确认', 'javascript:history.go(-1);'); } inserttable('members_comment', $data); $send_user_gender = $user_arr['gender'] == 1 ? "女" : "男"; //发送者性别 if ($members['usertype'] == 1) { //fanglin暂时屏蔽 Push_message_intab($sendtoid, $members['telphone'], "评价", "真爱一生网 用户ID:" . $userid . "," . $send_user_gender . ",已给对您进行了评价,请速查看!4006780405", $userid); } MooMessage('评价成功', 'index.php?n=space&h=viewpro&uid=' . $data['uid'], '05'); exit; } $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; } $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; } require MooTemplate('public/service_comment', 'module'); }
function sendEmail() { global $_MooClass, $dbTablePre, $timestamp, $user_arr, $timestamp, $memcached; $sendtouid = MooGetGPC('uid', 'integer', 'P'); $userid = $user_arr['uid']; $title = MooGetGPC('title', 'string', 'P'); $content = MooGetGPC('content', 'string', 'P'); $serverid = Moo_is_kefu(); if ($serverid && $user_arr['usertype'] != 3) { exit('simulate'); } if (empty($sendEmailCount)) { $sendEmailCount = 0; } $sendEmailCount = $memcached->get('sendEmail' . $userid); if ($sendEmailCount > 3) { exit('limited'); } if ($sendtouid == $userid) { exit('sameone'); } if (MooGetScreen($userid, $sendtouid)) { exit('shield'); } if (!in_array($user_arr['s_cid'], array(10, 20, 30))) { exit('upgrade'); } $sendToUser = MooMembersData($sendtouid); if (isset($sendToUser['gender']) && $sendToUser['gender'] == $user_arr['gender']) { exit('gender'); } if (isset($sendToUser['showinformation']) && $sendToUser['showinformation'] != 1) { exit('closeInfo'); } //是否有手机号码 if (MOOPHP_ALLOW_FASTDB) { $_R_ = MooFastdbGet('certification', 'uid', $userid); } else { $sql = "SELECT telphone FROM {$dbTablePre}certification WHERE uid='{$userid}'"; $_R_ = $_MooClass['MooMySQL']->getOne($sql, true); } if (empty($_R_['telphone']) && empty($serverid)) { exit('telNo'); } $sql = "select count(s_id) as cnt from web_members_search where s_fromid='{$userid}' and s_uid='{$sendtouid}' and s_type=1"; $_S_ = $_MooClass['MooMySQL']->getOne($sql, true); if (isset($_S_['cnt']) && $_S_['cnt'] > 3) { exit('已经超出了发送邮件的数量!'); } $gender = $user_arr['gender'] == 1 ? "美女" : "帅哥"; $data['s_content'] = trim(safeFilter($content)); $data['s_title'] = $title; $data['s_fromid'] = $userid; $data['s_uid'] = $sendtouid; $data['s_time'] = time(); $data['sid'] = $user_arr['sid']; if ($user_arr['usertype'] != 3) { $data['flag'] = 0; } else { $data['flag'] = 1; } inserttable('services', $data); $memcached->set('sendEmail' . $userid, ++$sendEmailCount, 0, 86400); //************提醒所属客服************** $sid = $user_arr['sid']; $title = '您的会员 ' . $userid . ' 发送邮件到' . $sendtouid; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='发邮件',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); $pattern = '/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/'; if (isset($sendToUser['usertype']) && $sendToUser['usertype'] == 1 && preg_match($pattern, $sendToUser['telphone'])) { Push_message_intab($sendtouid, $sendToUser['telphone'], "站内信", "尊敬的会员您好!ID:{$userid}给您发送了邮件!幸福热线:4008787920", $userid); } }
function to_send_message() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $timestamp, $serverid; //print_r($_POST); //note s_cid 发送者的权限(回复时才有) $s_cid = MooGetGPC('s_cid', 'integer', 'P'); //echo $s_cid;exit; //收件人id $sid = MooGetGPC('s_id', 'integer', 'P'); //发件人id $mid = MooGetGPC('m_id', 'integer', 'P'); ///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)) { MooMessage('因特殊原因,消息发送失败', "index.php?n=service&h=rose&t=getmorerose", '01'); 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 . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc查看!4008787920【真爱一生网】", $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 . ",已给您发送电子邮件,请登录www.zhenaiyisheng.cc!4008787920【真爱一生网】", $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 .= ' 发件人:' . $username . '<br>'; } else { $ToBody .= ' 发件人:ID号为' . $mid . '<br>'; } if ($toname['nickname']) { $ToBody .= ' 收件人:' . $toname['nickname'] . '<br>'; } else { $ToBody .= ' 收件人:ID号为' . $sid . '<br>'; } $ToBody .= ' 主题:' . $s_title . '<br>'; $ToBody .= ' 正文:<br> ' . $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) { //男方发的 MooMessage('发送成功,真爱一生审核后对方即可以收到。', 'index.php?n=service&h=message&t=sendmessage', '05'); } else { MooMessage('发送成功', 'index.php?n=service&h=message&t=sendmessage', '05'); } } else { MooMessage('发送失败', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '03'); } } else { MooMessage('数据填写不完整', 'index.php?n=service&h=message&t=send&sendtoid=' . $sid, '02'); } }
global $_MooClass, $user_arr, $memcached, $_MooCookie; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $error = array(); $istueiguang = MooGetGPC('istueiguang', 'string'); $friendprovince = ''; if (empty($istueiguang)) { } $username = MooGetGPC('username', 'string'); $password = MooGetGPC('password', 'string'); $password2 = MooGetGPC('password2', 'string'); $gender = MooGetGPC('gender', 'integer'); $telphone = MooGetGPC('telphone', 'string'); $birthyear = MooGetGPC('year', 'integer'); $birthmonth = MooGetGPC('month', 'integer'); $birthday = MooGetGPC('day', 'integer'); $nickname = safeFilter(rtrim(MoogetGPC('nickname', 'string', 'P'))); $marriage = MoogetGPC('marriage1', 'integer', 'P'); $workprovince = MooGetGPC('workprovincereg', 'integer'); $workcity = MooGetGPC('workcity', 'integer'); if ($_POST['yanzheng']) { $shadow_yan = $_POST['yanzheng']; } else { $return = "未填写验证码"; echo return_data($return, false); exit; } $tele = $telphone % 1000000000; $sql = "select content from {$dbTablePre}smslog_sys where uid = '{$tele}' "; $r = $_MooClass['MooMySQL']->getOne($sql, true); if ($r['content'] != $shadow_yan) { $return = "验证码错误";