Exemple #1
0
function send_mms_commission($tel, $type, $uid)
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr;
    include "ework/include/crontab_config.php";
    $pic_path = "./data/upload/userimg/";
    $file_path = "data/mmstmp/";
    if ($type == 'rose') {
        $mes = "真爱一生网 ID为" . $uid . "的会员给您发送了鲜花,赶快访问www.zhenaiyisheng.cc 登录您的账户了解ta的详细信息吧,同时可以搜索您的意中人,给TA送出自己的鲜花,希望您在茫茫人海中早日找寻到属于自己的幸福。";
        $title = "真爱一生网鲜花提醒";
    } else {
        $mes = "真爱一生网 ID为" . $uid . "的会员给您发送了委托,赶快访问www.zhenaiyisheng.cc 登录您的账户了解ta的详细信息吧,同时可以搜索您的意中人,给TA送出自己的委托,希望您在茫茫人海中早日找寻到属于自己的幸福。";
        $title = "真爱一生网委托提醒";
    }
    $mes_gb = iconv("UTF-8", "gb2312", "{$mes}");
    //$tel=$sendto_user_info['telphone'];
    $mkdirs = MooAutoLoad('MooFiles');
    $image = MooAutoLoad('MooImage');
    $sql = "SELECT pic_date,pic_name FROM {$GLOBALS['dbTablePre']}pic where uid='{$uid}' and isimage=0 and syscheck=1 limit 5";
    $user_image_arr = $_MooClass['MooMySQL']->getAll($sql);
    $sql = "SELECT m.uid,m.nickname,m.province,m.city,m.gender,b.pic_name,m.birthyear,c.age1,c.age2,c.workprovince,c.workcity \n                   FROM {$GLOBALS['dbTablePre']}members_search m\n                   left join {$GLOBALS['dbTablePre']}members_base b on m.uid=b.uid \n                   left join {$GLOBALS['dbTablePre']}members_choice c on m.uid=c.uid WHERE m.uid='{$uid}'";
    $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
    $file_name_smil = 'temp' . time() . rand(10000, 99999);
    $file_array = $file_path . $file_name_smil . ".smil," . $file_path . $file_name_smil . ".txt";
    $file_name = 'temp' . time() . rand(10000, 99999);
    $nickname1 = "昵称:" . $userinfo['nickname'];
    $nickname = iconv("UTF-8", "gb2312", "{$nickname1}");
    $txt = " ID:" . $userinfo['uid'] . "(" . (gmdate('Y', time()) - $userinfo['birthyear']) . "岁),居住在" . ($provice_list[$userinfo['province']] || $city_list[$userinfo['city']] ? $provice_list[$userinfo['province']] . $city_list[$userinfo['city']] : "未填") . "的" . ($userinfo['gender'] ? '女士' : '男士') . "寻找一位年龄在" . $userinfo['age1'] . "-" . $userinfo['age2'] . "岁,居住" . ($provice_list[$userinfo['workprovince']] || $city_list[$userinfo['workcity']] ? $provice_list[$userinfo['workprovince']] . $city_list[$userinfo['workcity']] : "未填") . "的" . ($userinfo['gender'] ? '男士' : '女士');
    $txt1 = iconv("UTF-8", "gb2312", "{$txt}");
    $txt = $nickname . $txt1;
    $mkdirs->fileWrite($file_path . $file_name . ".txt", $txt);
    $pic_name_old = MooGetphoto($userinfo['uid'], 'medium');
    $pic_only_name = $userinfo['uid'] * 3 . "_medium.gif";
    $pic_name_file = $file_path . '/' . $pic_only_name;
    $pic = 'http://www.zhenaiyisheng.cc/' . $pic_name_old;
    $pic = file_get_contents($pic);
    file_put_contents($pic_name_file, $pic);
    $image->config(array('thumbDir' => $file_path . '/', 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_only_name, 'waterMarkMinWidth' => '100', 'waterMarkMinHeight' => '125', 'waterMarkStatus' => 9));
    $image->thumb('100', '125', $pic_name_old);
    //$pic_name_file=$file_path.'/'.$pic_only_name;
    //$pic_name="5226417_mid.jpg";
    $par = '<par dur="50000ms"><img src="' . $pic_only_name . '" region="Image" /><text src="' . $file_name . '.txt" region="Text" /></par>';
    $file_array = $file_array . "," . $file_path . $file_name . ".txt," . $pic_name_file;
    foreach ($user_image_arr as $key => $user_image_name) {
        $user_image = thumbImgPath("2", $user_image_name['pic_date'], $user_image_name['pic_name']);
        $image_name_arr = explode('.', $user_image_name['pic_name']);
        if (file_exists("." . $user_image) && $image_name_arr[1] != 'bmp') {
            $image_only_name = $file_name . $key . ".gif";
            list($width, $height) = getimagesize('.' . $user_image);
            $d = $width / $height;
            $c = 85 / 100;
            if ($d < $c) {
                $thumb1_width = 85;
                $b = $width / $thumb1_width;
                $thumb1_height = $height / $b;
            } else {
                $thumb1_height = 100;
                $b = $height / $thumb1_height;
                $thumb1_width = $width / $b;
            }
            $image->config(array('thumbDir' => $file_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $image_only_name, 'waterMarkMinWidth' => '82', 'waterMarkMinHeight' => '114', 'waterMarkStatus' => 9));
            $image->thumb($thumb1_height, $thumb1_width, '.' . $user_image);
            $need_product_img[] = $file_path . $image_only_name;
            $file_array = $file_array . "," . $file_path . $image_only_name;
            $par = $par . '<par dur="50000ms"><img src="' . $image_only_name . '" region="Image" /></par>';
        }
    }
    $mkdirs->fileWrite($file_path . $file_name_smil . ".txt", $mes_gb);
    $smil = '<smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language"><head><layout><root-layout width="208" height="176" /><region id="Image" left="0" top="0" width="128" height="128" fit="hidden" /><region id="Text" left="0" top="50" width="128" height="128" fit="hidden" /></layout></head><body><par dur="50000ms"><text src="' . $file_name_smil . '.txt" region="Text" /></par>' . $par . '</body></smil>';
    $mkdirs->fileWrite($file_path . $file_name_smil . ".smil", $smil);
    require 'ework/include/pclzip_new.lib.php';
    $archive = new PclZip($file_path . $file_name_smil . '.zip');
    $v_list = $archive->create($file_array, PCLZIP_OPT_REMOVE_ALL_PATH);
    if ($v_list == 0) {
        die("Error : " . $archive->errorInfo(true));
    }
    $ret = send_mms_yimei_up($title, $tel, $file_name_smil . '.zip');
    $ret_ok = substr($ret, 0, 2);
    if ($ret_ok == "OK") {
        $dateline = time();
        $sql = "INSERT INTO {$GLOBALS['dbTablePre']}mmslog(sid,uid,title,content,sendtime,id_list) VALUES('000','{$uid}','{$title}','system','{$dateline}','{$uid}')";
        $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
        $result = "OK";
    } else {
        $result = false;
    }
    $mkdirs->fileDelete($file_path . $file_name_smil . '.zip');
    $mkdirs->fileDelete($file_path . $file_name_smil . '.txt');
    $mkdirs->fileDelete($file_path . $file_name_smil . '.smil');
    $mkdirs->fileDelete($file_path . $file_name . '.txt');
    $mkdirs->fileDelete($pic_name_file);
    if ($need_product_img) {
        foreach ($need_product_img as $del_img) {
            $mkdirs->fileDelete($del_img);
        }
    }
    return $result;
}
Exemple #2
0
<span class="r-title">相册</span></div>
					<div class="rightbox-in">
						<div id="liquid" class="liquid">
							<span class="previous"></span>
							<div class="wrapper">
								
								<ul>
									<?php 
foreach ((array) $user_pic as $k => $v) {
    ?>
 
									<li><a  class="fancybox-buttons" data-fancybox-group="button" href="<?php 
    echo IMG_SITE . $v['imgurl'];
    ?>
" ><img src="<?php 
    echo thumbImgPath('2', $v['pic_date'], $v['pic_name']);
    ?>
"   /></a></li>
									<?php 
}
?>
								</ul>
							</div>
							<span class="next"></span>
						</div>
					</div>
				</div>
                <?php 
if ($user['gender'] == '1') {
    ?>
            		<?php 
Exemple #3
0
function sendnewleer()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'");
    //$pic_total = $_MooClass['MooMySQL']->numRows($query);
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        MooMessage('自己不可以给自己发过送秋波', 'javascript:history.go(-1);', '04');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,送秋波失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('同性之间不可互发秋波', 'javascript:history.go(-1);', '02');
        exit;
    }
    //测试用的 by hwt
    if ($_POST['sendleer']) {
        if (empty($GLOBALS['MooUid'])) {
            list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
            $uid = intval($uid);
        } else {
            $uid = $GLOBALS['MooUid'];
        }
        if (empty($uid)) {
            MooMessage('您还没有登录', 'index.php?n=login');
        }
        $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_leer WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ");
        if ($leer['lid']) {
            $lid = $leer['lid'];
            //note 如果已经发送过秋波,就增加发送秋波的次数
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET num = num + 1,receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime = '{$timestamp}',receive_del = '0' WHERE lid = '{$lid}'");
            //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_leer SET stat = '0' WHERE senduid = '{$sendtoid}' AND receiveuid = '{$uid}' AND stat = '2'");
        } else {
            //note 发送新的秋波,写入数据库 发送者,接受者,发送时间
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_leer SET sendtime = '{$timestamp}',receivetime = '{$timestamp}',receivenum = '1', num = '1', senduid  = '{$uid}',receiveuid = '{$sendtoid}'");
        }
        //将新注册的会员更新为优质会员
        if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
            update_iswell_user($user_arr['uid']);
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        if (MOOPHP_ALLOW_FASTDB) {
            $res = MooFastdbGet('members', 'uid', $sendtoid);
        } else {
            $res = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members where uid='{$sendtoid}'");
        }
        $send_user_info = $_MooClass['MooMySQL']->getOne("select * from `{$dbTablePre}members` a  left join  {$dbTablePre}choice b  on a.uid=b.uid  where a.uid = '{$uid}' LIMIT 1");
        //头像路径
        $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name]);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $provice_list[$send_user_info[province]];
        //省
        $city = $city_list[$send_user_info[city]];
        //市
        $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知";
        //身高
        ob_start();
        //require_once MooTemplate('public/mail_space_leertpl', 'module'); //秋波模板
        require_once MooTemplate('public/mail_space_leertpl', 'module');
        //秋波模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
        // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce);
        //每天向同一用户发送多次,短信记录数表只记一次
        $send_leer_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
        //
        $today_leer_count = isset($leer['lid']) ? $leer['num'] + 1 : 1;
        if (date("Y-m-d") > $send_leer_date) {
            $today_leer_count = 1;
        }
        /*if($res['is_phone']){
            SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405");
          }*/
        //SendMsg($res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
        /*
                    $week_time = 24*3600*7;//一周时间秒数
                    $interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
                    $date1 = date("Y-m-d",strtotime("last Monday"));
                    $date2 = date("Y-m-d",strtotime("Sunday"));
                    
                    if($interval_time > $week_time){//不活跃用户每周发一条短信
                            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
                            if($cos['c']<=1){
                                //fanglin暂时屏蔽
                              Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
                           }
                    }else{ //活跃用户每天一条
                         if($send_leer_date==date("Y-m-d") && $today_leer_count == 1){  //每天同一个用户发送多次秋波,短信只记一次
                           $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
                           if($cos[c]<5){
                              $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
                              //fanglin暂时屏蔽
                              Push_message_intab($sendtoid,$res['telphone'],"秋波","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送秋波,请及时把握您的缘分!4006780405",$userid);
                           }
                       }    
                    }*/
        //提醒所属客服
        $sid = $user_arr['sid'];
        $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了秋波';
        $awoketime = $timestamp + 3600;
        $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
        $res = $_MooClass['MooMySQL']->query($sql_remark);
        $users =& $res;
        MooMessage('发送秋波成功', 'index.php?n=service&h=leertest&t=sendnewleer');
    } else {
        $sql = "SELECT content  FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1";
        $sendinfo = $_MooClass['MooMySQL']->getAll($sql);
        require MooTemplate('public/service_leer_sendnewleer', 'module');
    }
}
                        <!--放照片flash的开始-->
                        <iframe src="index.php?n=myaccount&h=picflash" scrolling="no" frameborder="0" width="600" height="467"></iframe>
                        <!--放照片flash的结束-->
                    </div>
                    <div class="video">
                            <ul id="pic_flash">
                                <?php 
if ($flash_pic) {
    ?>
                                    <?php 
    foreach ((array) $flash_pic as $r_pic) {
        ?>
                                         <li>
										 
                                           <img src="<?php 
        echo thumbImgPath(2, $r_pic['pic_date'], $r_pic['pic_name']);
        ?>
" />
                                           <?php 
        if ($acc_pic == $r_pic['pic_url']) {
            ?>
                                                <p style="font-size:12px;"> 我的形象照</p>
                                           <?php 
        } else {
            ?>
                                                <p><a href="index.php?n=myaccount&h=videoindex&pic_url=<?php 
            echo $r_pic['pic_url'];
            ?>
&actio=u">设为形象照</a> <a href="index.php?n=myaccount&h=videoindex&tmp_id=<?php 
            echo $r_pic['tmp_id'];
            ?>
Exemple #5
0
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 .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                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');
    }
}
Exemple #6
0
function send_rose()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    $query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $_MooClass['MooMySQL']->numRows($query);
    //note 自己不能给自己发送玫瑰,直接转到玫瑰列表页面
    if ($userid == $sendtoid) {
        MooMessage('自己不可以给自己送鲜花', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //客服不能模拟操作
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,送鲜花失败', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可给同性发送鲜花', 'javascript:history.go(-1);');
        exit;
    }
    //note 如果自己没有玫瑰花了,就提示没有玫瑰花了
    if ($user['rosenumber'] <= 0) {
        MooMessage('您没有鲜花了,获取更多鲜花', "index.php?n=service&h=rose&t=getmorerose");
        exit;
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid  where s.uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("select b.*,c.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base c on a.uid=c.uid  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '{$userid}'");
    $send_user_info = $send_user_info[0];
    //头像路径
    $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $provice_list[$send_user_info['province']];
    //省
    $city = $city_list[$send_user_info['city']];
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    require_once MooTemplate('public/mail_space_rosetpl', 'module');
    //模板
    $body = ob_get_clean();
    MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    if (empty($uid)) {
        MooMessage('您还没有登录', 'index.php?n=login');
    }
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    if ($user['rosenumber'] > 0) {
        if ($leer['rid']) {
            $rid = $leer['rid'];
            //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
            $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
        } else {
            //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
        }
        //note 发送一朵玫瑰,自己就要减少一朵玫瑰
        //enkytest
        //enkytestend
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
        if (MOOPHP_ALLOW_FASTDB) {
            $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1");
            $value['rosenumber'] = $user_rosenum['rosenumber'];
            MooFastdbUpdate('members_base', 'uid', $userid, $value);
        }
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    if ($res['is_phone']) {
        SendMsg($res['telphone'], "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花,请及时把握您的缘分!4006780405");
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    MooMessage('发送鲜花成功' . $note, "index.php?n=service&h=rose&t=isendrose", "05");
    require MooTemplate('public/service_rose_sendrose', 'module');
}
Exemple #7
0
function addmyfriend()
{
    global $_MooClass, $dbTablePre, $pagesize, $user_arr, $timestamp, $serverid;
    $sendtoid = MooGetGPC('sendtoid', 'integer');
    $userid = $user_arr['uid'];
    if ($sendtoid == $userid) {
        MooMessage('自己不可加自己为意中人', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        MooMessage('因特殊原因,加意中人失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //note 分配客服
    //allotserver($userid);
    //note 获得照片总数
    //$query = $_MooClass['MooMySQL']->query("SELECT imgid FROM {$dbTablePre}pic WHERE uid = '$sendtoid'");
    //$pic_total = $_MooClass['MooMySQL']->numRows($query);
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 要做性别过滤,异性的发送玫瑰,直接转到玫瑰列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        MooMessage('不可加同性为意中人', 'javascript:history.go(-1);', '04');
        exit;
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    if (empty($uid)) {
        MooMessage('您还没有登录', 'index.php?n=login', '04');
    }
    $friend = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_friend WHERE friendid = '{$sendtoid}' AND uid = '{$uid}'", true);
    if ($friend['fid']) {
        $content = '对不起,对方已经在您的意中人列表中';
        $url = 'index.php?n=space&h=viewpro&uid=' . $sendtoid;
        MooMessage($content, $url, '02');
    } else {
        //note 加为意中人,新插入一行记录,谁加谁
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_friend SET friendid  = '{$sendtoid}',uid = '{$uid}',sendtime='" . time() . "'");
    }
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($uid);
    }
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    if (MOOPHP_ALLOW_FASTDB) {
        $res = MooFastdbGet('members_search', 'uid', $sendtoid);
        $res_b = MooFastdbGet('members_base', 'uid', $sendtoid);
        $res = array_merge($res, $res_b);
    } else {
        $res = $_MooClass['MooMySQL']->getOne("select s.telphone,b.is_phone,s.username from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid where uid='{$sendtoid}'");
    }
    $send_user_info = $_MooClass['MooMySQL']->getAll("select c.*,b.*,a.* from `{$dbTablePre}members_search` a left join {$dbTablePre}members_base b on a.uid=b.uid  left join  {$dbTablePre}choice c  on a.uid=c.uid  where a.uid = '{$uid}'");
    $send_user_info = $send_user_info[0];
    //头像路径
    $path = thumbImgPath(2, $send_user_info[pic_date], $send_user_info[pic_name], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $provice_list[$send_user_info[province]];
    //省
    $city = $city_list[$send_user_info[city]];
    //市
    $height = $send_user_info[height] ? $height_list[$send_user_info[height]] : "未知";
    //身高
    ob_start();
    require_once MooTemplate('public/mail_space_friendtpl', 'module');
    //模板
    $body = ob_get_clean();
    //	   MooSendMailSpace2($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员将您添加为意中人了!请尽快查收!您的帐号是:".$res['username'],$type="1",$body);
    MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    // MooSendMailSpace($res['username'],"真爱一生网系统温馨提示","真爱一生网提醒:有会员给您发送秋波了!请尽快查收!您的帐号是:".$res['username'],$type="1",$send_user,$send_type = "秋波",$userid,$send_user_img,$age,$tall,$area,$sendtime,$introduce);
    $week_time = 24 * 3600 * 7;
    //一周时间秒数
    $interval_time = $timestamp - $user_arr['last_login_time'];
    //当前时间-最后登录时间
    $date1 = date("Y-m-d", strtotime("last Monday"));
    $date2 = date("Y-m-d", strtotime("Sunday"));
    if ($interval_time > $week_time) {
        //不活跃用户每周发一条短信
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
        $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}'  and sendtime>='{$date1}' and sendtime<='{$date2}'");
        if ($cos[c] <= 1) {
            //fanglin暂时屏蔽
            Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid);
        }
    } else {
        //每天该用户超过5条信息不发送短信
        $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sendtoid}' and sendtime='" . date("Y-m-d") . "'");
        if ($cos[c] < 5) {
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sendtoid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            //fanglin暂时屏蔽
            Push_message_intab($sendtoid, $res['telphone'], "意中人", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已将您添加为意中人,请及时把握您的缘分!4006780405", $userid);
        }
    }
    require MooTemplate('public/service_friend_addmyfriend', 'module');
}
                                <div class="show-img">
                                    <?php 
    if (!$users2['syscheck']) {
        ?>
                                    <div class="post_s_div">照片正在审核中</div>
                                    <?php 
    }
    ?>
                                    <div class="pic10">
                                        <p>
                                            <a href="./index.php?n=material&h=del&isimage=0&imageid=<?php 
    echo $users2['imgid'];
    ?>
">
                                                <img src="<?php 
    echo thumbImgPath(2, $users2['pic_date'], $users2['pic_name']) . '?sid=' . rand(111111, 999999);
    ?>
" />
                                            </a>
                                        </p>
                                    </div>     
                                    <p style="padding-top:5px;">
                                        <a class="setImage" style="cursor:pointer" data-gender="<?php 
    echo $user_arr['gender'];
    ?>
" data-url="<?php 
    echo $users2['imgurl'];
    ?>
" data-date="<?php 
    echo $users2['pic_date'];
    ?>
Exemple #9
0
function sendnewfl()
{
    global $_MooClass, $dbTablePre, $timestamp, $user_arr, $serverid, $memcached, $_MooCookie, $GLOBALS;
    //是否合法登录
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $sendtoid = MooGetGPC('sendtoid', 'integer', 'P');
    //
    $user_arr = MooMembersData($userid);
    $uid = $userid;
    $return = array();
    $is_first_send = true;
    $query = $_MooClass['MooMySQL']->getOne("SELECT count(1) as c FROM {$dbTablePre}pic WHERE uid = '{$sendtoid}'");
    $pic_total = $query['c'];
    //note 自己不能给自己发送秋波,直接转到秋波列表页面
    if ($sendtoid == $userid) {
        $error = "自己不可以给自己发过送鲜花";
        echo return_data($error, false);
        exit;
    }
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    //系统管理员权限
    $GLOBALS['system_admin'] = array(60);
    if (in_array($groupid, $GLOBALS['system_admin'])) {
        $serverid = null;
    }
    if ($serverid && $user_arr['usertype'] != 3) {
        //只能模拟全权会员
        $error = "对不起您不能模拟操作";
        echo return_data($error, false);
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendtoid)) {
        $error = "因特殊原因,送鲜花失败";
        echo return_data($error, false);
        exit;
    }
    //note 要做性别过滤,异性的发送秋波,直接转到秋波列表页面
    $send_user1 = leer_send_user1($sendtoid);
    $user = leer_send_user1($userid);
    if ($send_user1['gender'] == $user['gender']) {
        $error = "同性之间不可互发鲜花";
        echo return_data($error, false);
        exit;
        exit;
    }
    if ($user['rosenumber'] <= 0) {
        $error = '您没有鲜花了,获取更多鲜花';
        echo return_data($error, false);
        exit;
    }
    //
    //发送短信和邮件
    include_once "./module/crontab/crontab_config.php";
    $res = MooMembersData($sendtoid);
    $send_user_info = array_merge(MooGetData('members_choice', 'uid', $userid), MooMembersData($userid));
    //头像路径
    $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
    if (file_exists($path)) {
        $img_path = $path;
    } else {
        if ($send_user_info['gender'] == 1) {
            $img_path = "/public/images/service_nopic_woman.gif";
        } else {
            $img_path = "/public/images/service_nopic_man.gif";
        }
    }
    $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
    //发送者用户名
    $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
    //发送者性别
    $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
    //省
    $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
    //市
    $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
    //身高
    ob_start();
    //require_once MooTemplate('public/mail_space_rosetpl', 'module'); //模板
    $body = ob_get_clean();
    if ($res['usertype'] != 3) {
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sendtoid);
    }
    if (empty($GLOBALS['MooUid'])) {
        list($uid, $password) = explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'));
        $uid = intval($uid);
    } else {
        $uid = $GLOBALS['MooUid'];
    }
    //if(empty($uid)){
    //	MooMessage('您还没有登录','index.php?n=login');
    //}
    $leer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}service_rose WHERE receiveuid = '{$sendtoid}' AND senduid = '{$userid}' ORDER BY rid DESC LIMIT 1");
    //库中验证鲜花数
    //$rosenum_check =  $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1",true);
    //if($rosenum_check['rosenumber'] > 0) {
    if ($leer['rid']) {
        $is_first_send = false;
        $rid = $leer['rid'];
        //note 如果已经发送过玫瑰,就增加发送玫瑰的次数
        $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_rose SET num = num + 1, receivenum = receivenum + 1,sendtime = '{$timestamp}',receivetime='{$timestamp}',receive_del=0,send_del=0 WHERE rid = '{$rid}'");
    } else {
        //note 发送新的玫瑰,写入数据库 发送者,接受者,发送时间
        $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_rose SET num = 1, receivenum = 1, sendtime = '{$timestamp}',receivetime='{$timestamp}',senduid  = '{$uid}',receiveuid = '{$sendtoid}' ");
    }
    //note 发送一朵玫瑰,自己就要减少一朵玫瑰
    $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}members_base SET rosenumber = rosenumber - 1 WHERE uid = '{$uid}'");
    if (MOOPHP_ALLOW_FASTDB) {
        $user_rosenum = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT rosenumber FROM {$GLOBALS['dbTablePre']}members_base  WHERE `uid`='{$uid}'  LIMIT 1", true);
        $value['rosenumber'] = $user_rosenum['rosenumber'];
        MooFastdbUpdate('members_base', 'uid', $userid, $value);
    }
    //}
    //将新注册的会员更新为优质会员
    if (in_array($user_arr['sid'], array(0, 52, 123)) && $user_arr['is_well_user'] != 1) {
        update_iswell_user($user_arr['uid']);
    }
    //每天向同一用户发送多次,短信记录数表只记一次
    $send_rose_date = isset($leer['sendtime']) ? date("Y-m-d", $leer['sendtime']) : date("Y-m-d");
    //
    $today_rose_count = isset($leer['rid']) ? $leer['num'] + 1 : 1;
    if (date("Y-m-d") > $send_rose_date) {
        $today_rose_count = 1;
    }
    $sendinfo = MooGetGPC('sendinfo', 'string', 'G');
    if (!empty($sendinfo)) {
        $sendinfo = ",对您说:" . $sendinfo;
    }
    if ($res['usertype'] != 3) {
        if ($serverid) {
            //客服模拟会员登录可以选择发送短信或彩信
            $SMStype = MooGetGPC('selectSMSorCMS', 'string', 'G');
            if ($SMStype == 'SMS' && $res['is_phone']) {
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            } elseif ($SMStype == 'CMS' && $res['is_phone']) {
                //====发送彩信   begin  ====
                //发送人有照片
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and images_ischeck=1 and pic_num>0";
                $sendfrom_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                /* $sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}'";// and is_phone=1 and telphone!='' and usertype=1";
                   $sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);*/
                if ($sendfrom_user_info['uid']) {
                    $sendedMMSCount = $memcached->get('hznsimulate' . $serverid);
                    if (empty($sendedMMSCount)) {
                        $sendedMMSCount = 0;
                    }
                    //if($sendedMMSCount > 10){
                    //	MooMessage('您今天累计已经发过10条彩信','index.php?n=service&h=rose');
                    //}
                    send_mms_commission($res['telphone'], 'rose', $userid);
                    $memcached->set('hznsimulate' . $serverid, ++$sendedMMSCount, 0, 28800);
                }
                //====发送彩信 end =====
            }
        } else {
            //真实会员登录
            if ($res['is_phone'] && $is_first_send && $res['s_cid'] != 40) {
                //第一次发才短信提示
                // SendMsg($res['telphone'],"真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花".$sendinfo."     请及时把握您的缘分!4006780405");
                Push_message_intab($sendtoid, $res['telphone'], "鲜花", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送鲜花" . $sendinfo . "     请及时把握您的缘分!4006780405", $userid);
            }
        }
    }
    /*
    	$week_time = 24*3600*7;//一周时间秒数
    	$interval_time = $timestamp - $user_arr['last_login_time'];//当前时间-最后登录时间
    	$date1 = date("Y-m-d",strtotime("last Monday"));
    	$date2 = date("Y-m-d",strtotime("Sunday"));
    	
    	//echo "interval_time:".$interval_time . ' and '.'week:'.$week_time;exit;
    
    	if($interval_time > $week_time){//不活跃用户每周发一条短信
    		 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    		 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid'  and sendtime>='$date1' and sendtime<='$date2'");
    		 if($cos[c] <= 1){
    			//fanglin暂时屏蔽
    			Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    		 }
    	}else{
    		  //echo $today_rose_count;exit;
    		  if($send_rose_date==date("Y-m-d") && $today_rose_count == 1){	//每天同一个用户发送多次秋波,短信只记一次
    			   $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='$sendtoid' and sendtime='".date("Y-m-d")."'");
    			   
               //print_r($cos);exit;
    			   if($cos[c]<5){
    				  $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '".$sendtoid."', sid = '".$userid."',phone = '".$res['telphone']."',sendtime = '".date("Y-m-d")."'" );
    				  //fanglin暂时屏蔽
    				  Push_message_intab($sendtoid,$res['telphone'],"鲜花","真爱一生网 用户ID:".$userid.",".$send_user_grade.",已给您发送鲜花,请及时把握您的缘分!4006780405",$userid);
    			   }
    		}
    	}
    */
    /*
    	//发送彩信
    	$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
    	//$sql="SELECT uid FROM {$dbTablePre}members where uid='{$uid}'";
    	$sendout_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送人有照片
    	$sql="SELECT telphone FROM {$dbTablePre}members where uid='{$sendtoid}' and is_phone=1 and telphone!='' and usertype=1";
    	$sendto_user_info=$_MooClass['MooMySQL']->getOne($sql);
    	//发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
        
    	//echo $sendto_user_info['telphone'].' and '.$sendout_user_info['uid'];exit;
    	if($sendto_user_info['telphone']&&$sendout_user_info['uid']){
    		//echo 'ffff';exit;
    		if(send_mms_commission($sendto_user_info['telphone'],'rose',$sendout_user_info['uid'])){
    			$note="。";
    		}else{
    			$note="!";
    		}
    	}
    */
    /*普通会员对全权会员反馈白名单*/
    if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
        white_list($res['uid'], $user_arr['uid']);
    }
    /*客服模拟全权记录*/
    if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
        $action = '鲜花';
        fulllog($user_arr['uid'], $serverid, $action, $res);
    }
    //提醒所属客服
    $sid = $user_arr['sid'];
    $title = '您的会员 ' . $user_arr['uid'] . ' 向 ' . $sendtoid . ' 发送了鲜花';
    $awoketime = $timestamp + 3600;
    $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
    $res = $_MooClass['MooMySQL']->query($sql_remark);
    $return = "发送鲜花成功";
    echo return_data($return);
    exit;
    //MooMessage('发送鲜花成功',"index.php?n=service&h=rose&t=isendrose","05");
    //require MooTemplate('public/service_rose_sendrose', 'module');
}
Exemple #10
0
function sendcontact()
{
    global $_MooClass, $dbTablePre, $timestamp, $user, $user_arr, $hzn, $serverid;
    $returnurl = 'index.php?' . $_SERVER['QUERY_STRING'];
    //返回的url
    $userid = $GLOBALS['MooUid'];
    //note 目前默认系统不审核
    $contact_sys_check = '0';
    //note 目前系统默认是委托真爱一生等待对方的回应
    $contact_stat = '1';
    $content = MooCutstr(safeFilter(MooGetGPC('content1', 'string')), 200, '');
    $sendid = MooGetGPC('sendid', 'integer');
    //客服不可模拟操作
    /*if($hzn == "hongniangwang"){
          MooMessage('对不起您不能模拟操作','javascript:history.go(-1);','04');
          exit;
      }*/
    if ($serverid) {
        MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04');
        exit;
    }
    //自己不可委托真爱一生联系自己
    if ($sendid == $userid) {
        MooMessage('自己不可委托真爱一生联系自己', 'javascript:history.go(-1);', '02');
        exit;
    }
    //note 双方屏蔽不给操作
    if (MooGetScreen($userid, $sendid)) {
        MooMessage('因特殊原因,委托失败', "index.php?n=service&h=rose&t=getmorerose", '03');
        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 委托也要做性别限制
    if (MOOPHP_ALLOW_FASTDB) {
        $user_s = MooFastdbGet('members_search', 'uid', $sendid);
    } else {
        $user_s = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_search WHERE uid = '{$sendid}'", true);
    }
    //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');
        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');
            exit;
        }
    }
    if ($user_s['showinformation'] != 1) {
        MooMessage('发起委托失败,该会员已经关闭资料!', 'javascript:history.go(-1);', '02');
        exit;
    }
    //note 如果已经联系他就直接提示
    if ($checkuser['mid']) {
        MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02');
    }
    //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');
    }
    //提交时
    if ($formsubmit1 && $content && $sendid) {
        if (!$checkuser['mid']) {
            //发送短信和邮件
            include_once "./module/crontab/crontab_config.php";
            if (MOOPHP_ALLOW_FASTDB) {
                $res = MooFastdbGet('members_search', 'uid', $sendid);
            } else {
                $res = $_MooClass['MooMySQL']->getOne("select telphone,is_phone,username from {$dbTablePre}members_search where uid='{$sendid}'");
            }
            if (MOOPHP_ALLOW_FASTDB) {
                $send_user_info = MooFastdbGet('members_search', 'uid', $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(1, 52, 123)) && $user_arr['is_well_user'] != 1) {
                    update_iswell_user($user_arr['uid']);
                }
                //if($user_arr['uid']=='20796965'){
                //====发送委托彩信   begin  ====
                $sql = "SELECT uid,telphone FROM {$dbTablePre}members_search where uid='{$userid}' and mainimg!='' and images_ischeck=1 and pic_num>0";
                $sendout_user_info = $_MooClass['MooMySQL']->getOne($sql);
                //发送人有照片
                //echo $sendid."<br />".$userid;
                $sql = "SELECT s.telphone FROM {$dbTablePre}members_search as s\n\t                       left join {$dbTablePre}members_base as b on s.uid=b.uid\n\t                       where s.uid='{$sendid}' and b.is_phone=1 and s.telphone!='' and s.usertype=1";
                $sendto_user_info = $_MooClass['MooMySQL']->getOne($sql, true);
                //发送条件:本站注册会员,有电话号码的,开启短信通知的会员发送
                //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 =====
                //}
                MooMessage("委托成功", 'index.php?n=service', '05');
            } else {
                MooMessage("今天委托真爱一生已经 超过3次", 'javascript:history.go(-1);', '02');
            }
        } else {
            MooMessage("对不起,您已经委托真爱一生联系TA了", 'javascript:history.go(-1);', '02');
        }
    }
    //是否有手机号码
    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');
    } else {
        $tel = $status['telphone'];
    }
    require MooTemplate('public/service_contact_sendcontact', 'module');
}
Exemple #11
0
function check_image()
{
    global $_MooClass;
    $sid = $GLOBALS['adminid'];
    $type = MooGetGPC('type', 'string') == '' ? 'list' : MooGetGPC('type', 'string');
    $lei = "会员相册图片审核";
    $uid = MooGetGPC('uid', 'integer');
    $usersid = MooGetGPC('usersid', 'string', 'G');
    //makui
    $id = MooGetGPC('id', 'integer');
    $checkArr = array(1 => '审核通过', 0 => '未审核');
    switch ($type) {
        //相册列表
        case 'list':
            //note 获得当前url
            $pass = MooGetGPC('pass', 'integer', 'G');
            $currenturl = "index.php?action=check&h=image";
            $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl);
            $currenturl2 = preg_replace("/(&pass=\\d+)/", "", $currenturl2) . "&pass={$pass}";
            $currenturl2 = preg_replace("/(&usersid=\\d+)/", '', $currenturl2);
            $page = get_page();
            $prepage = 20;
            $start = ($page - 1) * $prepage;
            $sql_where = '';
            //所管理的客服id列表
            if (isset($_GET['usersid']) && MooGetGPC('usersid', 'string', 'G') == 0) {
                salert("无所属客服");
            }
            $myservice_idlist = get_myservice_idlist();
            if (empty($myservice_idlist)) {
                $sql_where = " AND b.sid IN({$GLOBALS['adminid']})";
            } elseif ($myservice_idlist == 'all') {
                if (isset($_GET['usersid'])) {
                    $sql_where = " AND b.sid='{$usersid}'";
                }
                //all为客服主管能查看所有的
            } else {
                $sql_where = " AND b.sid IN({$myservice_idlist}) ";
                if (isset($_GET['usersid'])) {
                    $sql_where .= " AND b.sid='{$usersid}'";
                }
            }
            if ($uid > 0) {
                $sql_where .= " AND b.uid=" . $uid;
            } else {
                $sql_where .= " AND a.syscheck=" . $pass;
            }
            $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT count(1) as c FROM {$GLOBALS['dbTablePre']}pic AS a left  JOIN {$GLOBALS['dbTablePre']}members AS b on a.uid=b.uid WHERE 1 {$sql_where}");
            $total = $total_count['c'];
            $list = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.uid,a.imgid as id,a.syscheck AS syscheck,b.nickname,b.birthyear,b.sid as sid,b.gender,b.lastvisit FROM {$GLOBALS['dbTablePre']}pic AS a left JOIN {$GLOBALS['dbTablePre']}members AS b on a.uid=b.uid WHERE 1 {$sql_where} ORDER BY b.lastvisit DESC LIMIT {$start},{$prepage} ");
            //echo ("SELECT a.uid,a.imgid as id,a.syscheck AS syscheck,b.nickname,b.birthyear,b.gender,b.lastvisit FROM {$GLOBALS['dbTablePre']}pic AS a JOIN {$GLOBALS['dbTablePre']}members AS b WHERE a.uid=b.uid {$sql_where} ORDER BY a.syscheck,a.imgid DESC LIMIT $start,$prepage ");
            require adminTemplate("check_list");
            break;
            //会员相册查看222
        //会员相册查看222
        case 'show':
            $pass = MooGetGPC('pass', 'integer', 'G');
            //获取待审核列表
            $images = array();
            if ($_COOKIE['images']) {
                $imagedata_dir = MOOPHP_DATA_DIR . '/block/' . 'story' . $sid . '.data';
                if (file_exists($imagedata_dir)) {
                    $images = unserialize(file_get_contents($imagedata_dir));
                }
            }
            if (!$images) {
                $images = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.birthyear,b.gender,b.mainimg FROM {$GLOBALS['dbTablePre']}pic as a join {$GLOBALS['dbTablePre']}members as b  WHERE a.uid=b.uid and a.uid='{$uid}' and a.syscheck={$pass}");
            }
            if ($id && $images) {
                //数组重排
                $sortarr = array();
                foreach ($images as $img) {
                    if ($img['mid'] == $id) {
                        $sortarr[] = -1;
                    } else {
                        $sortarr[] = $img['mid'];
                    }
                }
                array_multisort($sortarr, SORT_ASC, $images);
            }
            //取出待审核照片
            $image = $images[0];
            $_MooClass['MooCache']->setBlockCache('story' . $sid, $images);
            $id = $image['imgid'];
            serverlog(1, $dbTablePre . "pic", $GLOBALS['username'] . "查询会员相册", $GLOBALS['adminid']);
            require adminTemplate("check_show");
            break;
            //审核
        //审核
        case 'submit':
            $is_pass = MooGetGPC('pass', 'string');
            $is_onpass = MooGetGPC('nopass', 'string');
            if ($is_onpass) {
                $imagesname = MooGetGPC('imagesname', 'string');
                $pic_date = MooGetGPC('pic_date', 'string');
                $imagessrc1 = "../data/upload/images/photo/" . $pic_date . "/orgin/" . $imagesname;
                $GLOBALS['_MooClass']['MooMySQL']->query("DELETE FROM {$GLOBALS['dbTablePre']}pic WHERE `imgid`='{$id}'");
                if (file_exists(".." . thumbImgPath("1", $pic_date, $imagesname))) {
                    unlink(".." . thumbImgPath("1", $pic_date, $imagesname));
                }
                if (file_exists(".." . thumbImgPath("2", $pic_date, $imagesname))) {
                    unlink("../" . thumbImgPath("2", $pic_date, $imagesname));
                }
                if (file_exists(".." . thumbImgPath("3", $pic_date, $imagesname))) {
                    unlink(".." . thumbImgPath("3", $pic_date, $imagesname));
                }
                if (file_exists($imagessrc1)) {
                    unlink($imagessrc1);
                }
                serverlog(2, $dbTablePre . "pic", $GLOBALS['username'] . "未通过用户的图片" . $id, $GLOBALS['adminid'], $uid);
                sendusermessage($uid, "您的图片不符合图片要求,已被红娘删除,请您按要求进行操作", "图片审核");
                //salert('审核图片删除成功');
                $alert = '审核图片删除成功';
            } elseif ($is_pass) {
                //用户相册图片总数加1
                $sql = "SELECT COUNT(*) AS num FROM {$GLOBALS['dbTablePre']}pic \n\t\t\t\tWHERE syscheck=1 and isimage='0' and uid='{$uid}'";
                $pic_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                $pc = $pic_count['num'] + 1;
                $sql = "update {$GLOBALS['dbTablePre']}members set pic_num='{$pc}' where uid='{$uid}'";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                if (MOOPHP_ALLOW_FASTDB) {
                    $value['pic_num'] = $pc;
                    MooFastdbUpdate('members', 'uid', $uid, $value);
                }
                $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}pic SET `syscheck`=1 WHERE `imgid`='{$id}'");
                serverlog(3, $dbTablePre . "pic", $GLOBALS['username'] . "通过用户的图片" . $id, $GLOBALS['adminid'], $uid);
                sendusermessage($uid, "您的图片已经过红娘的审核,您还可以继续上传您的照片", "图片审核");
                //salert('审核图片成功');
                $alert = '审核图片成功';
            }
            //更新缓存
            $imagedata_dir = MOOPHP_DATA_DIR . '/block/' . 'story' . $sid . '.data';
            $images = array();
            if (file_exists($imagedata_dir)) {
                $images = unserialize(file_get_contents($imagedata_dir));
            }
            $image = array_shift($images);
            $_MooClass['MooCache']->setBlockCache('story' . $sid, $images);
            if ($images) {
                $url = 'index.php?action=check&h=image&type=show&id=' . $image['imgid'];
            } else {
                $url = 'index.php?action=check&h=image';
            }
            $imgkey = $images ? 1 : 0;
            setcookie('images', $imgkey);
            salert($alert, $url);
            break;
    }
}
Exemple #12
0
function material_photo_show()
{
    global $_MooClass, $dbTablePre, $userid, $user, $user_arr;
    $user_rank_id = get_userrank($userid);
    if (MOOPHP_ALLOW_FASTDB) {
        $usercer = MooFastdbGet('certification', 'uid', $userid);
    } else {
        $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$userid}' LIMIT 1 ", true);
    }
    $memberid = $userid;
    $sql = "select count(*) as c from `{$dbTablePre}pic` where `uid` = '{$memberid}' AND `isimage` = '0'";
    $ret_count = $_MooClass['MooMySQL']->getOne($sql, true);
    $total = $ret_count['c'];
    //note 还可以上传多少张
    $maxuploadnum = 20;
    $leave_num = max(0, $maxuploadnum - $total);
    $user1 = $user_arr;
    //note 查询出相册里面的照片
    $user2 = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}pic` where `uid` = '{$memberid}'  order by imgid desc ", 0, 0, 0, true);
    $thumb_2 = ltrim(thumbImgPath(2, $user_arr['pic_date'], $user_arr['pic_name']), '/');
    include MooTemplate('public/material_getmemberphoto', 'module');
}
Exemple #13
0
function ajax_sellsendactive()
{
    $type = MooGetGPC('type', 'string', 'G');
    $sendid = MooGetGPC('from', 'integer', 'G');
    $receiveuid = MooGetGPC('to', 'integer', 'G');
    if ($type == '' || $sendid == '' || $receiveuid == '' || $sendid == 0 || $receiveuid == 0) {
        echo 'errors';
    }
    $nowtime = time();
    $user = MooMembersData($receiveuid);
    $senduser = MooMembersData($sendid);
    /*if(MOOPHP_ALLOW_FASTDB){
          $user = MooFastdbGet('members','uid',$receiveuid);
          $senduser = MooFastdbGet('members','uid',$sendid);
      }else{
          $sql = "SELECT username,telphone FROM {$GLOBALS['dbTablePre']}members WHERE `uid`='".$receiveuid."'";
          $user=$GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
          $sql = "SELECT gender FROM {$GLOBALS['dbTablePre']}members WHERE `uid`='".$sendid."'";
          $senduser=$GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
      }*/
    $gender = $senduser['gender'] == 1 ? "女" : "男";
    switch ($type) {
        case 'commission':
            //$sql = "SELECT mid,sendtime FROM {$GLOBALS['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";
            $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_contact WHERE you_contact_other = '{$receiveuid}' AND other_contact_you = '{$sendid}' ";
            $com = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
            if (empty($com)) {
                $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_contact SET `you_contact_other`='" . $receiveuid . "',`other_contact_you`='" . $sendid . "',`stat`=1,`syscheck`=1,`sendtime`='" . $nowtime . "',`is_server`=1";
                $result = $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                echo 'ok';
                exit;
            } else {
                echo 'having';
                exit;
            }
            //更改最后活动时间,上线
            $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'";
            $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            if (MOOPHP_ALLOW_FASTDB) {
                $value['lastvisit'] = $GLOBALS['timestamp'];
                MooFastdbUpdate('members_login', 'uid', $sendid, $value);
            }
            //发e-mail提醒(委托)-------开始////////////////////////////////////////////
            include_once "./include/crontab_config.php";
            $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid));
            /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a  left join  {$GLOBALS['dbTablePre']}choice b  on a.uid=b.uid  where a.uid = '$sendid'");
              $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 adminTemplate('mail/mail_space_commissiontpl');
            $body = ob_get_clean();
            MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid);
            //--------->发送邮件提醒  结束///////////////////////////////////////////
            //fangin暂时屏蔽
            Push_message_intab($receiveuid, $user['telphone'], "委托", "尊敬的会员您好!" . $sendid . "," . $gender . ",委托我们联系您,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid);
            //写日志
            serverlog(3, $GLOBALS['dbTablePre'] . 'service_contact', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送委托", $GLOBALS['adminid'], $receiveuid);
            echo 'ok';
            exit;
            break;
        case 'leer':
            $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_leer WHERE senduid = '{$sendid}' AND receiveuid= '{$receiveuid}' ";
            $leer = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
            if (!empty($leer)) {
                $lid = $leer['lid'];
                //note 如果已经发送过秋波,就增加发送秋波的次数
                $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET fakenum = fakenum + 1,num = num + 1,receivenum = receivenum + 1,sendtime = '{$nowtime}',receivetime = '{$nowtime}',receive_del = '0' WHERE lid = '{$lid}'";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                //note 如果已经收到这个人的秋波,已经拒绝,现在改变注意,又发送秋波给这个人,拒绝状态2更改为0
                if ($leer['receive_del'] == 1 || $leer['stat'] == 2) {
                    $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET stat = '0',receive_del = 0 WHERE senduid = '{$sendid}' AND receiveuid = '{$receiveuid}' AND stat = '2'";
                    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                }
            } else {
                //note 发送新的秋波,写入数据库 发送者,接受者,发送时间
                $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_leer SET sendtime = '{$nowtime}',receivetime = '{$nowtime}',fakenum = '1', receivenum = '1', num = '1', senduid  = '{$sendid}',receiveuid = '{$receiveuid}',is_server=1";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            }
            //更改最后活动时间,上线
            $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'";
            $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            if (MOOPHP_ALLOW_FASTDB) {
                $value['lastvisit'] = $GLOBALS['timestamp'];
                MooFastdbUpdate('members_login', 'uid', $sendid, $value);
            }
            //发e-mail提醒(委托)-------开始////////////////////////////////////////////
            include_once "./include/crontab_config.php";
            $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid));
            /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a  left join  {$GLOBALS['dbTablePre']}choice b  on a.uid=b.uid  where a.uid = '$sendid'");
              $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 adminTemplate('mail/mail_space_leertpl');
            $body = ob_get_clean();
            MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid);
            //--------->发送邮件提醒  结束///////////////////////////////////////////
            //fangin暂时屏蔽
            Push_message_intab($receiveuid, $user['telphone'], "秋波", "尊敬的会员您好!ID" . $sendid . "," . $gender . ",给您发送秋波,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid);
            //写日志
            serverlog(3, $GLOBALS['dbTablePre'] . 'service_leer', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送秋波", $GLOBALS['adminid'], $receiveuid);
            echo 'ok';
            exit;
            break;
        case 'rose':
            $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_rose WHERE senduid = '{$sendid}' AND receiveuid= '{$receiveuid}' ";
            $rose = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true);
            if (!empty($rose)) {
                $rid = $rose['rid'];
                //note 如果已经发送过鲜花,就增加发送鲜花的次数
                $sql = "UPDATE {$GLOBALS['dbTablePre']}service_rose SET fakenum = fakenum + 1,num = num + 1,receivenum = receivenum + 1,sendtime = '{$nowtime}',receivetime = '{$nowtime}',receive_del = '0' WHERE rid = '{$rid}'";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                //note 如果用户已经将该鲜花记录删除,则要改变删除状态,不然鲜花不会在前台显示
                if ($rose['receive_del'] == 1) {
                    $sql = "UPDATE {$GLOBALS['dbTablePre']}service_leer SET receive_del = 0 WHERE senduid = '{$sendid}' AND receiveuid = '{$receiveuid}'";
                    $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                }
            } else {
                //note 发送新的鲜花,写入数据库 发送者,接受者,发送时间
                $sql = "INSERT INTO {$GLOBALS['dbTablePre']}service_rose SET sendtime = '{$nowtime}',receivetime = '{$nowtime}',fakenum = '1', receivenum = '1', num = '1', senduid  = '{$sendid}',receiveuid = '{$receiveuid}',is_server=1";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            }
            //更改最后活动时间,上线
            $sql = "UPDATE {$GLOBALS['dbTablePre']}members_login SET lastvisit='{$GLOBALS['timestamp']}' WHERE uid='{$sendid}'";
            $GLOBALS['_MooClass']['MooMySQL']->query($sql);
            if (MOOPHP_ALLOW_FASTDB) {
                $value['lastvisit'] = $GLOBALS['timestamp'];
                MooFastdbUpdate('members_login', 'uid', $sendid, $value);
            }
            //发e-mail提醒--->开始///////////////////////////////////
            include_once "./include/crontab_config.php";
            $send_user_info = array_merge(MooGetData('members_choice', 'uid', $sendid), MooMembersData($sendid));
            /*$send_user_info = $GLOBALS['_MooClass']['MooMySQL']->getAll("select * from `{$GLOBALS['dbTablePre']}members` a  left join  {$GLOBALS['dbTablePre']}choice b  on a.uid=b.uid  where a.uid = '$sendid'");
              $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 adminTemplate('mail/mail_space_rosetpl');
            $body = ob_get_clean();
            MooSendMail($user['username'], "真爱一生网系统温馨提示", $body, "", false, $receiveuid);
            //----->发送email-->结束/////////////////////////
            //fangin暂时屏蔽
            Push_message_intab($receiveuid, $user['telphone'], "鲜花", "尊敬的会员您好!ID" . $sendid . "," . $gender . ",给您发送鲜花,请及时登录www.zhenaiyisheng.cc查收,把握您的缘分。【真爱一生网】", $sendid);
            //写日志
            serverlog(3, $GLOBALS['dbTablePre'] . 'service_rose', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台以会员{$sendid}的身份向{$receiveuid}会员发送鲜花", $GLOBALS['adminid'], $receiveuid);
            echo 'ok';
            exit;
            break;
        default:
            echo "errors";
            break;
    }
    exit;
}
Exemple #14
0
function check_image()
{
    global $_MooClass, $dbTablePre, $allow_order, $rsort;
    $sid = $GLOBALS['adminid'];
    $type = MooGetGPC('type', 'string', 'R') == '' ? 'list' : MooGetGPC('type', 'string', 'R');
    $lei = "会员相册图片审核";
    $uid = MooGetGPC('uid', 'integer', 'R');
    $usersid = MooGetGPC('usersid', 'string', 'R');
    //makui
    $id = MooGetGPC('id', 'integer', 'R');
    $checkArr = array(1 => '审核通过', 0 => '未审核');
    switch ($type) {
        //相册列表
        case 'list':
            //note 获得当前url
            $pass = MooGetGPC('pass', 'integer', 'R');
            $page = get_page();
            $prepage = 20;
            $start = ($page - 1) * $prepage;
            $sql_where = '';
            $usersid = MooGetGPC('usersid', 'string', 'R');
            if ($usersid === null) {
                $usersid = -1;
            } else {
                $usersid = intval($usersid);
            }
            $myservice_idlist = get_myservice_idlist();
            if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) {
                $sql_where = " AND b.sid ={$GLOBALS['adminid']}";
                //$sql_where = " AND b.sid IN({$GLOBALS['adminid']})";
            } elseif ($myservice_idlist == 'all') {
                //all为客服主管能查看所有的
                $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user", 0, 0, 0, true);
                //if(isset($_GET['usersid'])){$sql_where=" AND b.sid='$usersid'";}
                if ($usersid >= 0) {
                    $sql_where = " AND b.sid='{$usersid}'";
                    $start = 0;
                    //重新选择客服,刷新
                }
            } else {
                $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user  where uid in ({$myservice_idlist}) ", 0, 0, 0, true);
                $sql_where = " AND b.sid IN({$myservice_idlist}) ";
                //if(isset($_GET['usersid'])){$sql_where .=" AND b.sid='$usersid'";}
                if ($usersid >= 0) {
                    $sql_where .= " AND b.sid='{$usersid}'";
                    $start = 0;
                    //重新选择客服,刷新
                }
            }
            $currenturl = "index.php?action=check&h=image&pass={$pass}";
            //$currenturl2 = preg_replace("/(&page=\d+)/","",$currenturl);
            $currenturl2 = preg_replace("/(&pass=\\d+)/", "", $currenturl) . "&pass={$pass}";
            $currenturl2 = preg_replace("/(&sid=\\d+)/", '', $currenturl2);
            if (!empty($uid)) {
                $sql_where = '';
                $start = 0;
                $sql_where .= " AND b.uid=" . $uid;
                $usersid = -1;
            } else {
                $sql_where .= " AND a.syscheck=" . $pass;
            }
            if ($usersid >= 0) {
                $currenturl2 = $currenturl2 . "&usersid={$usersid}";
            }
            //排序
            $query_builder = get_query_builder($sql_where, $allow_order, '', '', 'pic_date', 'asc', $rsort);
            $sort_arr = $query_builder['sort_arr'];
            $rsort_arr = $query_builder['rsort_arr'];
            $sql_sort = $query_builder['sort'];
            $order = MooGetGPC('order', 'string', 'R');
            $method = MooGetGPC('method', 'string', 'R');
            if (!empty($order) && !empty($method)) {
                $sql_sort = "order by {$order} {$method} ";
                $currenturl2 .= "&order={$order}&method={$method}";
            }
            $sql_sort = str_replace("pic_date", "a.pic_date", $sql_sort);
            $sql_sort = str_replace("uid", "a.uid", $sql_sort);
            $currentur = $currenturl2;
            if (strpos($sql_where, 'b.') === false) {
                $sql_count = "SELECT count(1) as c FROM {$GLOBALS['dbTablePre']}pic AS a WHERE 1 {$sql_where}";
                $sql = "SELECT a.imgid FROM {$GLOBALS['dbTablePre']}pic AS a left join {$GLOBALS['dbTablePre']}members_login AS d on d.uid=a.uid WHERE 1 {$sql_where} LIMIT {$start},{$prepage} ";
                //ORDER BY d.lastvisit DESC
            } else {
                $sql_count = "SELECT count(1) as c FROM {$GLOBALS['dbTablePre']}pic AS a left  JOIN {$GLOBALS['dbTablePre']}members_search AS b on a.uid=b.uid WHERE 1 {$sql_where}";
                $sql = "SELECT a.imgid FROM {$GLOBALS['dbTablePre']}pic AS a left JOIN {$GLOBALS['dbTablePre']}members_search AS b on a.uid=b.uid left join {$GLOBALS['dbTablePre']}members_login AS d on d.uid=b.uid WHERE 1 {$sql_where} LIMIT {$start},{$prepage} ";
                //ORDER BY d.lastvisit ASC
            }
            $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql_count, true);
            $total = $total_count['c'];
            $list_imgid = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true);
            $list = array();
            if (!empty($list_imgid)) {
                $imgids = array();
                foreach ($list_imgid as $img) {
                    $imgids[] = $img['imgid'];
                }
                $sql = "SELECT a.uid,a.imgid as id,a.syscheck AS syscheck,b.nickname,b.birthyear,b.sid as sid,b.gender,c.allotdate,d.lastvisit FROM {$GLOBALS['dbTablePre']}pic AS a left JOIN {$GLOBALS['dbTablePre']}members_search AS b on a.uid=b.uid left join {$GLOBALS['dbTablePre']}members_base AS c on c.uid=b.uid left join {$GLOBALS['dbTablePre']}members_login AS d on d.uid=c.uid WHERE a.imgid in (" . implode(',', $imgids) . ") {$sql_sort}";
                $list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true);
                //获取图片的上传日期
                foreach ($list as $key => $val) {
                    $uidpic = $val['id'];
                    $sql = "select pic_date from web_pic where imgid='{$uidpic}'";
                    $resultpic = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                    if (!empty($resultpic)) {
                        $picdate = date('Y-m-d', strtotime($resultpic['pic_date']));
                        $list[$key]['pic_date'] = $picdate;
                    } else {
                        $list[$key]['pic_date'] = null;
                    }
                }
            }
            require adminTemplate("check_list");
            break;
            //会员相册查看222
        //会员相册查看222
        case 'show':
            $pass = MooGetGPC('pass', 'integer', 'G');
            $usersid = MooGetGPC('usersid', 'integer', 'R');
            $page = MooGetGPC('page', 'integer', 'G');
            //获取待审核列表
            if (!$images) {
                $images = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.birthyear,b.gender,c.mainimg FROM {$GLOBALS['dbTablePre']}pic as a join {$GLOBALS['dbTablePre']}members_search as b on a.uid=b.uid left join {$GLOBALS['dbTablePre']}members_base as c on b.uid=c.uid WHERE a.uid='{$uid}' and a.syscheck={$pass}");
            }
            //取出待审核照片
            $image = count($images) > 0 ? $images[0] : array();
            $id = isset($image['imgid']) ? $image['imgid'] : '';
            //==========页面返回url=====取值================================
            $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $url = preg_replace("/www./", "", $url);
            $url = preg_replace("/show/", "list", $url);
            //返回列表页
            $url = preg_replace("/&uid=\\d+/", "", $url);
            serverlog(1, $dbTablePre . "pic", $GLOBALS['username'] . "查询会员相册", $GLOBALS['adminid']);
            require adminTemplate("check_show");
            break;
            //审核
        //审核
        case 'submit':
            $is_pass = MooGetGPC('pass', 'string');
            $is_onpass = MooGetGPC('nopass', 'string');
            $uid = MooGetGPC('uid', 'integer', 'P');
            if ($is_onpass) {
                $imagesname = MooGetGPC('imagesname', 'string');
                $pic_date = MooGetGPC('pic_date', 'string');
                $imagessrc1 = "../data/upload/images/photo/" . $pic_date . "/orgin/" . $imagesname;
                $GLOBALS['_MooClass']['MooMySQL']->query("DELETE FROM {$GLOBALS['dbTablePre']}pic WHERE `imgid`='{$id}'");
                if (file_exists(".." . thumbImgPath("1", $pic_date, $imagesname))) {
                    unlink(".." . thumbImgPath("1", $pic_date, $imagesname));
                }
                if (file_exists(".." . thumbImgPath("2", $pic_date, $imagesname))) {
                    unlink("../" . thumbImgPath("2", $pic_date, $imagesname));
                }
                if (file_exists(".." . thumbImgPath("3", $pic_date, $imagesname))) {
                    unlink(".." . thumbImgPath("3", $pic_date, $imagesname));
                }
                if (file_exists($imagessrc1)) {
                    unlink($imagessrc1);
                }
                serverlog(2, $dbTablePre . "pic", $GLOBALS['username'] . "未通过用户的图片" . $id, $GLOBALS['adminid'], $uid);
                sendusermessage($uid, "您的图片不符合图片要求,已被红娘删除,请您按要求进行操作", "图片审核");
                //salert('审核图片删除成功');
                $alert = '审核图片删除成功';
            } elseif ($is_pass) {
                //用户相册图片总数加1
                $sql = "SELECT COUNT(*) AS num FROM {$GLOBALS['dbTablePre']}pic   WHERE syscheck=1 and isimage='0' and uid='{$uid}'";
                $pic_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql);
                $pc = $pic_count['num'] + 1;
                $sql = "update {$GLOBALS['dbTablePre']}members_search set pic_num='{$pc}' where uid='{$uid}'";
                $GLOBALS['_MooClass']['MooMySQL']->query($sql);
                searchApi('members_man members_women')->updateAttr(array('pic_num'), array($uid => array((int) $pc)));
                if (MOOPHP_ALLOW_FASTDB) {
                    $value['pic_num'] = $pc;
                    MooFastdbUpdate('members_search', 'uid', $uid, $value);
                }
                $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}pic SET `syscheck`=1 WHERE `imgid`='{$id}'");
                serverlog(3, $dbTablePre . "pic", $GLOBALS['username'] . "通过用户的图片" . $id, $GLOBALS['adminid'], $uid);
                sendusermessage($uid, "您的图片已经过红娘的审核,您还可以继续上传您的照片", "图片审核");
                //salert('审核图片成功');
                $alert = '审核图片成功';
            }
            //enky add
            if (!$images) {
                $images = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.birthyear,b.gender,c.mainimg FROM {$GLOBALS['dbTablePre']}pic as a join {$GLOBALS['dbTablePre']}members_search as b on a.uid=b.uid left join {$GLOBALS['dbTablePre']}members_base as c on b.uid=c.uid WHERE a.uid='{$uid}' and a.syscheck=0");
            }
            $image = count($images) > 0 ? $images[0] : array();
            $id = isset($image['imgid']) ? $image['imgid'] : '';
            //enky add end
            if ($images) {
                $url = 'index.php?action=check&h=image&type=show&id=' . $image['imgid'] . "&usersid={$usersid}" . "&uid={$uid}";
            } else {
                /* $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
                            $url=preg_replace("/www./","",$url);
                               $url=preg_replace("/submit/", "list", $url);
                               $url=preg_replace("/&uid=\d+/", "", $url);
                		 
                               //$url=preg_replace("/&usersid=\d+/", "", $url);
                               $url .="&pass=0"; */
                $url = "index.php?action=check&h=image&type=list&usersid={$usersid}&pass=0";
            }
            $imgkey = $images ? 1 : 0;
            setcookie('images', $imgkey);
            salert($alert, $url);
            break;
    }
}
Exemple #15
0
function to_send_message()
{
    global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid;
    $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : '';
    $uid = isset($_GET['uid']) ? $_GET['uid'] : '';
    if ($uid) {
        $userid = $mem_uid = $memcached->get('uid_' . $uid);
    }
    $uuid = $memcached->get('uuid_' . $userid);
    //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid);
    $checkuuid = check_uuid($and_uuid, $userid);
    if (!$checkuuid) {
        $error = "uuid_error";
        echo return_data($error, false);
        exit;
    }
    $user_arr = MooMembersData($userid);
    $contentid = MooGetGPC('s_id', 'integer', 'P');
    //不可给同性别发送消息
    $receive_info = MooMembersData($contentid);
    $receive_gender = $receive_info['gender'];
    if ($user_arr['gender'] == $receive_gender) {
        $err = "不可给同性别发送消息";
        echo return_data($err, false);
        exit;
    }
    //系统管理员权限
    /*$result=$_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
      $groupid=$result['groupid'];
      
      //$GLOBALS['system_admin'] = array(60);
      if(in_array($groupid,$GLOBALS['system_admin'])){
          $serverid=null;
      }*/
    $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'");
    $groupid = $result['groupid'];
    if ($serverid && $user_arr['usertype'] != 3) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) {
        $err = "对不起您不能模拟操作";
        echo return_data($err, false);
        exit;
    }
    //如果是本站注册会员
    if ($user_arr['usertype'] == 1) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level != 1) {
            //不是高级会员
            if (!checkIsMobileCertical($userid)) {
                //没有通过了手机验证
                $err = "您还没有进行手机验证,请先认证";
                echo return_data($err, false);
                exit;
            } else {
                //if(!checkIsOver($userid)){ //过了试用期
                $err = "只有钻石或高级会员才可以发送电子邮件给对方";
                echo return_data($err, false);
                exit;
                //}
            }
        }
    }
    //print_r($_POST);
    //note s_cid 发送者的权限(回复时才有)
    $s_cid = MooGetGPC('s_cid', 'integer', 'P');
    //echo $s_cid;exit;
    //收件人id
    $sid = $contentid;
    //发件人id
    $mid = $userid;
    ///echo $sid;exit;
    $s_title = MooGetGPC('s_title', 'string', 'P');
    $s_title = rtrim($s_title);
    //对主题字数限制
    $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = ''));
    $s_content = MooGetGPC('s_content', 'string', 'P');
    //note 特殊字符
    $s_content = rtrim(MooStrReplace(safeFilter($s_content)));
    $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P');
    $message_back = MooGetGPC('message_back', 'integer', 'P');
    //note 双方屏蔽不给操作
    if (MooGetScreen($mid, $sid)) {
        $err = "因特殊原因,消息发送失败";
        echo return_data($err, false);
        exit;
    }
    if ($mid && $sid && $s_title && $s_content) {
        $m_level = get_userrank($userid);
        //会员等级
        if ($m_level == 2 && $user_arr['usertype'] != 3) {
            //普通会员需要审核(除采集会员之外)
            //if($user_arr['gender'] == 0){	//如果是男方发的,需要审核,0表示
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')");
        } else {
            $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')");
        }
        //发送短信和邮件
        include_once "./module/crontab/crontab_config.php";
        $res = MooMembersData($sid);
        //	   $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a  left join  {$dbTablePre}members_choice b  on a.uid=b.uid  where a.uid = '$userid'");
        $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid));
        //	   $send_user_info = $send_user_info[0];
        //头像路径
        $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']);
        if (file_exists($path)) {
            $img_path = $path;
        } else {
            if ($send_user_info['gender'] == 1) {
                $img_path = "/public/images/service_nopic_woman.gif";
            } else {
                $img_path = "/public/images/service_nopic_man.gif";
            }
        }
        $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid'];
        //发送者用户名
        $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男";
        //发送者性别
        $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : '';
        //省
        $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : '';
        //市
        $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知";
        //身高
        ob_start();
        require_once MooTemplate('public/mail_space_messagetpl', 'module');
        //模板
        $body = ob_get_clean();
        MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid);
        $week_time = 24 * 3600 * 7;
        //一周时间秒数
        $interval_time = $timestamp - $user_arr['last_login_time'];
        //当前时间-最后登录时间
        $date1 = date("Y-m-d", strtotime("last Monday"));
        $date2 = date("Y-m-d", strtotime("Sunday"));
        if ($interval_time > $week_time) {
            //不活跃用户每周发一条短信
            $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true);
            if ($cos['c'] <= 1) {
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        } else {
            //活跃用户每天一条
            //每天该用户超过5条信息不发送短信
            $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true);
            if ($cos['c'] < 5) {
                $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'");
                //fanglin暂时屏蔽
                Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid);
            }
        }
        //note 发送资料给接收方
        if ($send_mymessage) {
        }
        //note 备份邮件操作
        if ($message_back) {
            //note 发送MAIL时所需信息
            $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'");
            //note 发送MAIL时收信人的邮箱
            $ToAddress = $user['username'];
            //note 发送MAIL时主题
            $ToSubject = '提示:您在真爱一生网所发的消息备份';
            //note 发送MAIL时Body内容所需信息
            $username = $user['nickname'];
            //note 发送MAIL时Body内容所需信息
            $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'");
            if ($username) {
                $ToBody = $username;
            } else {
                $ToBody = 'ID号为' . $mid . '的会员<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>';
            } else {
                $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>';
            }
            if ($username) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:' . $username . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;发件人:ID号为' . $mid . '<br>';
            }
            if ($toname['nickname']) {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:' . $toname['nickname'] . '<br>';
            } else {
                $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;收件人:ID号为' . $sid . '<br>';
            }
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;主题:' . $s_title . '<br>';
            $ToBody .= '&nbsp;&nbsp;&nbsp;&nbsp;正文:<br>&nbsp;&nbsp;&nbsp;&nbsp;' . $s_content;
            MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid);
        }
        //添加成功提示信息
        if ($send_status) {
            /*普通会员对全权会员反馈白名单*/
            if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) {
                white_list($res['uid'], $user_arr['uid']);
            }
            /*客服模拟全权记录*/
            if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') {
                $action = '站内信';
                fulllog($user_arr['uid'], $serverid, $action, $res);
            }
            //提醒所属客服
            $usid = $user_arr['sid'];
            $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件';
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            if ($user_arr['gender'] == 0) {
                //男方发的
                $suc = "发送成功,真爱一生审核后对方即可以收到。";
                echo return_data($suc, true);
                exit;
            } else {
                $suc = "发送成功";
                echo return_data($suc, true);
                exit;
            }
        } else {
            $err = "发送失败";
            echo return_data($err, false);
            exit;
        }
    } else {
        $err = "数据填写不完整";
        echo return_data($err, false);
        exit;
    }
}
Exemple #16
0
function deletePhoto()
{
    global $_MooClass, $dbTablePre, $userid, $user, $user_arr;
    $imgid = MooGetGPC('imgid', 'integer', 'P');
    $image = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}pic where imgid='{$imgid}' and uid='{$userid}'", true);
    //note 相册三张缩略图
    $thumb_1 = ltrim(thumbImgPath('1', $image['pic_date'], $image['pic_name']), '/');
    $thumb_2 = ltrim(thumbImgPath('2', $image['pic_date'], $image['pic_name']), '/');
    $thumb_3 = ltrim(thumbImgPath('3', $image['pic_date'], $image['pic_name']), '/');
    file_exists($thumb_1) && unlink($thumb_1);
    file_exists($thumb_2) && unlink($thumb_2);
    file_exists($thumb_3) && unlink($thumb_3);
    file_exists($image['imgurl']) && unlink($image['imgurl']);
    $image_woter = str_replace('.', '_nowater.', $image['imgurl']);
    if (file_exists($image_woter)) {
        unlink($image_woter);
    }
    if ($user_arr['mainimg'] == $image['imgurl'] && $user_arr['images_ischeck'] == '2') {
        $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_base` set `mainimg` = '',`pic_date` = '',`pic_name` = '' where `uid` = '{$userid}'");
        $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_search` set `images_ischeck` = '0',updatetime = '{$updatetime}' where `uid` = '{$userid}'");
        if (MOOPHP_ALLOW_FASTDB) {
            $photo_arr = array();
            $photo_arr['mainimg'] = '';
            $members_search['images_ischeck'] = '0';
            $photo_arr['pic_date'] = '';
            $photo_arr['pic_name'] = '';
            MooFastdbUpdate('members_base', 'uid', $userid, $photo_arr);
            MooFastdbUpdate('members_search', 'uid', $userid, $members_search);
        }
    }
    $_MooClass['MooMySQL']->query("delete from `{$dbTablePre}pic` where `imgid` = '{$imgid}' and  uid='{$userid}'");
    $user_pic = $_MooClass['MooMySQL']->getOne("SELECT COUNT(*) AS num FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$userid}'", true);
    $user_pic = (int) $user_pic['num'];
    if ($user_pic == 0) {
        $user_pic = 0;
    }
    $sql = "update {$dbTablePre}members_search set pic_num='{$user_pic}'  where uid='{$userid}'";
    $_MooClass['MooMySQL']->query($sql);
    if (MOOPHP_ALLOW_FASTDB) {
        $pic_arrs = array();
        $pic_arrs['pic_num'] = $user_pic;
        MooFastdbUpdate('members_search', 'uid', $userid, $pic_arrs);
    }
    searchApi("members_man members_women")->updateAttr(array('images_ischeck', 'pic_num'), array($memberid => array(0, $user_pic)));
    //searchApi("members_man members_women")->UpdateAttributes(array($memberid=>array('images_ischeck'=>'0','pic_num'=>$user_pic)));
}