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'); } }
} ?> </td> <td width="58%"> <a class="<?php echo !$allmails['s_status'] ? 'fzs' : 'f30'; ?> " href="index.php?n=service&&h=message&t=detailallmessage&contentid=<?php echo $allmails['s_id']; ?> "> <?php if ($allmails['s_cid'] != '3') { ?> <?php echo htmlspecialchars(MooStrReplace($allmails['s_title'])); ?> <?php } else { ?> <?php echo $allmails['s_title']; ?> <?php } ?> </a></td> <td width="14%" align="center" class="f-aeaeae"><?php echo date("Y年m月d日", $allmails['s_time']); ?> </td>
echo Moorestr($c['introduce_check']); ?> (<font class="f-ed0a91-a" style="text-decoration:none;">正在审核中</font>) <?php } else { ?> 您还没有内心独白<font style="cursor:pointer;" color="#c10202" onclick="javascript:location.href='index.php?n=material&h=upinfo'"> 马上填写</font> <?php } ?> <?php } else { ?> <?php echo $c['introduce'] ? MooStrReplace(Moorestr($c['introduce'])) : '还没有填写内心独白内容'; ?> <?php } ?> </p> </div> <?php if ($user['gender'] == '1') { ?> <?php $TA = '她'; ?> <?php } else {
?> </dd> <dd class="f-ed0a91">< <?php echo activetime($send_user1['lastvisit'], $send_user1['usertype']); ?> ></dd> </dl> </li> <li class="fright"> <dl class="r-service-heart"> <dt>内心独白</dt> <dd class="r-service-heart-text"> <?php if ($send_user1['uid'] < 1599400) { ?> <?php echo $send_user2['introduce'] ? MooStrReplace(MooCutstr($send_user2['introduce'], 148, $dot = ' ...')) : '无内心独白内容'; ?> <?php } else { ?> <?php echo $send_user2['introduce'] ? MooCutstr($send_user2['introduce'], 148, $dot = ' ...') : '无内心独白内容'; ?> <?php } ?> </dd> </dl> </li> </ul>
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; } }
&puid2=<?php echo $user_arr['uid']; ?> " /> <a href="###" onclick="copyToClipboard(document.getElementById('one_copy').value);" class="f-ed0a91-a">复制</a> </dd> <div id="flashcopier"></div> <dt><strong>内心独白:</strong></dt> <dt> <?php if (isset($vote_mem['introduce'])) { ?> <?php if ($vote_mem['uid'] < 1599400) { ?> <?php echo MooStrReplace(Moorestr(strip_tags(MooCutstr($vote_mem['introduce'], 500)))); ?> <?php } else { ?> <?php echo Moorestr(strip_tags(MooCutstr($vote_mem['introduce'], 500))); ?> <?php } } ?> </dt> </dl> </div> <div class="vote-cnter-bottom"></div>