/** * 登录首页 * 描述: * */ function index_index() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached; $sql_condition_province = $sql_condition_city = $province = ''; $currentdistrict = '0'; $arr_diamond_female = $arr_diamond_male = null; $provice_list = $city_list = $province_othercachefile = null; $s_cid = 40; //note 先初始化用户信息 //MooUserInfo(); //-------会员推荐------// $workprovince = MooGetGPC('workprovince', 'integer', 'G'); //工作省份 $workcity = MooGetGPC('workcity', 'integer', 'G'); //工作城市 if (in_array($workprovince, array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $workcity = $workprovince; $workprovince = 10101000; } $age1 = MooGetGPC('age1', 'integer', 'G'); //最小年龄 $age2 = MooGetGPC('age2', 'integer', 'G'); //最大年龄 $userList = $userList2 = array(); $index_total_user = 12; //首页总用户数 //note 当前年份 $year = date('Y'); //登录用户查找性别 $sql_gender = ''; //性别取反 if ($GLOBALS['MooUid']) { $gender = $user_arr['gender'] == 1 ? 0 : 1; /* $sql_gender = " and gender='$gender'"; $sql_condition_province .= $sql_gender; $sql_condition_city .= " and gender='$gender'"; */ } else { $gender = !MooGetGPC('gender', 'integer', 'G') ? 0 : 1; //note 性别 } $date_time = date('d'); $month_time = date('m'); $reguser_num = 30000 + $month_time * 1100 + $date_time * 191; //新加滚动文字 /*$time_list = time(); $sql = "select content from {$dbTablePre}text_show where start_time<'$time_list' and end_time>'$time_list' order by reg_time desc limit 0,15"; $text_list = $_MooClass['MooMySQL']->getAll($sql);*/ //显示男姓or显示女生搜索 /* if(isset($workprovince) && isset($workcity) && isset($age1) && $age2){ //$sql = "select * from {$dbTablePre}members where gender=$sex and images_ischeck=1 "; include_once("./module/crontab/crontab_config.php"); //note 从快速搜索表中查询 if($gender == '0'){ $sql = "select uid from {$dbTablePre}members_search where images_ischeck=1 and gender='0'"; } if($gender == '1'){ $sql = "select uid from {$dbTablePre}members_search where images_ischeck=1 and gender='1'"; } if($workprovince != 0 && $workcity == 0){//仅选择了省 $sql .= " and province=$workprovince"; }elseif($workprovince != 0 && $workcity != 0){ //选择了省市 $sql .= " and province=$workprovince and city=$workcity"; } if($age1 != '0' && $age2 != '0'){ if($age1 < $age2){ //查找数据的年龄条件 $between = ($year-$age2).' and '.($year-$age1); $sql .= " and birthyear between $between"; }else{ //查找数据的年龄条件 $between = ($year-$age1).' and '.($year-$age2); $sql .= " and birthyear between $between"; } } $sql .= " and is_lock = 1"; //$sql .= " and is_lock = 1 limit 12"; $sql .= " order by city_star desc,s_cid asc,bgtime desc ,pic_num desc limit 20"; //var_dump($sql);exit; //note 查询出来的用户id写入缓存 $md5 = md5($sql); $index_search = ("type=query/name=userid_{$md5}/sql=$sql/cachetime=86400"); $_MooClass['MooCache']->getBlock($index_search); $userid = $GLOBALS['_MooBlock']["userid_{$md5}"]; //查询为空则跳转到首页 if(empty($userid)) { MooMessage("非常抱歉!没有您所找的会员!", 'index.php','01'); exit; } //note uid数组转换成字符串 $index_img_num = 5; $index_img = index_img($currentdistrict,$index_img_num); $small_img_num = 3; $small_img = small_img($currentdistrict,$small_img_num); $user_arr1 = array(); foreach ($userid as $v1){ $user_arr1[] = $v1['uid']; } //note 获得用户id $userid_list = implode(",",$user_arr1); $sql = "select s.uid,s.gender,s.images_ischeck,s.nickname,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce i on s.uid=i.uid where s.uid in ($userid_list) order by s.city_star desc, s.s_cid asc"; //note 查询出来的用户信息写入缓存 $md5 = md5($sql); $index_search = ("type=query/name=userList_{$md5}/sql=$sql/cachetime=86400"); $_MooClass['MooCache']->getBlock($index_search); $userList = $GLOBALS['_MooBlock']["userList_{$md5}"]; } else{ */ //默认进入 //包含配置文件 include_once "./module/crontab/crontab_config.php"; $cur_ip = GetIP(); // $cur_ip = "61.190.44.98"; // $cur_ip = "202.120.2.200";//上海ip // $cur_ip = "218.202.206.102";//新疆ip //$cur_ip = "218.70.178.197"; //重庆 // $cur_ip="221.130.166.242"; MooPlugins('ipdata'); $ip_arr = convertIp($cur_ip); //得到省份对应的数值,查库 $province = $city = ""; foreach ($provice_list as $key => $val) { if (strstr($ip_arr, $val)) { $province = $key; $currentdistrict = $val; break; } } if (isset($_GET['province'])) { foreach ($provice_list as $key => $val) { if ($_GET['province'] == $key) { $currentdistrict = $val; break; } } } $test = array(); if (isset($currentdistrict)) { $index_img_num = 5; $index_img = index_img($currentdistrict, $index_img_num); $small_img_num = 3; $small_img = small_img($currentdistrict, $small_img_num); $test = test($currentdistrict); } //得到市对应的城市代号 foreach ($city_list as $city_key => $city_val) { if (strstr($ip_arr, $city_val)) { $city = $city_key; break; } } if (isset($_GET['province'])) { //默认快速查询没有进入 $province = MooGetGPC('province', 'integer', 'G'); //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } /* $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cachefile_list = $_MooClass['MooMySQL']->getAll($sql); foreach($cachefile_list as $cachefile){ if(file_exists("data/block/{$cachefile['provincestarfile']}")){ @unlink("data/block/{$cachefile['provincestarfile']}"); } if(file_exists("data/block/{$cachefile['citystarfile']}")){ @unlink("data/block/{$cachefile['citystarfile']}"); } if(file_exists("data/block/{$cachefile['provinceotherfile']}")){ @unlink("data/block/{$cachefile['provinceotherfile']}"); } } */ } $userList = array(); //查市城市之星 //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } $sql_city = "s.city='{$city}'"; //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } if ($city == 0) { $sql_city = "s.province='{$province}'"; } if (!empty($city) || !empty($province)) { //默认没有进入 选择省后进入 $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.s_cid='20' and s.gender='{$gender}' and ({$sql_city} AND s.is_lock=1 AND s.images_ischeck=1 and s.nickname!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1) AND i.introduce!='' order by s.s_cid limit 6"; //$userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$city}_citystar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); // $userList = $GLOBALS['_MooBlock']["userlist_{$city}_citystar"]; //市缓存文件 //$city_cachefile = "userlist_{$city}_citystar".'_'.md5($param).'.data'; } //市无城市之星,从省取城市之星 if (empty($userList)) { //默认进入 //enky note //$sql="select * from {$dbTablePre}members_base as b left join {$dbTablePre}members_search as s on b.uid=s.uid WHERE s.province='$province' AND s.is_lock=1 AND s.images_ischeck = 1 AND s.showinformation=1 and s.city_star>=1 and s.usertype=1 AND s.uid!=20752315 LIMIT 20"; $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.province='{$province}'\n\t\t\t AND s.is_lock=1 and s.gender={$gender}\n\t\t\t AND s.images_ischeck = 1 AND s.showinformation=1 \n\t\t\t and s.city_star>=1 and s.usertype=1 AND i.introduce!='' and s.nickname!='' LIMIT 6"; // $userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$province}_provincestar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $userList = $GLOBALS['_MooBlock']["userlist_{$province}_provincestar"]; //省缓存文件 //$province_cachefile = "userlist_{$province}_provincestar".'_'.md5($param).'.data'; } //城市之星不够取钻石会员(市->省->全国) $count = count($userList); if ($count < 6) { //默认进入 $addarr = array('cityadd', 'provinceadd', 'countryadd'); $user_in = '1747188|2154375|1600591|2159633|20782701|20785837|20561126|20305660|20910184'; //城市之星uid $user_list = array(); if (!is_array($userList)) { $userList = array(); } //enky add foreach ($userList as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode('|', $user_list); } //从(市->省->全国)取钻石会员 $cityadd = array(); $provinceadd = array(); $countryadd = array(); foreach ($addarr as $add) { if ($count < 6) { $id = ''; //从市取 if ($add == 'cityadd') { if (!$city || $city == 0) { continue; } $sql_add = "s.city='{$city}' and"; $id .= $city; } //从省取 if ($add == 'provinceadd') { if (!$province || $province == 0) { continue; } $sql_add = "s.province='{$province}' and"; $id .= $province; } //全国取 if ($add == 'countryadd') { $sql_add = ''; $id .= 'country'; } //取几个钻石会员 $add_query_sum = 6 - $count; //enky need change $cl = searchApi('members_women members_man'); $cond[] = array('is_lock', '1', false); $cond[] = array('images_ischeck', '1', false); $cond[] = array('gender', $gender, false); $cond[] = array('usertype', '1', false); $cond[] = array('@id', '20752315|' . $user_in, true); //uid $cond[] = array('s_cid', '20', false); $cond[] = array('city_star', '0', false); $cond[] = array('showinformation', '1', false); $cond[] = array('pic_num', array(1, 20), false); if ($province) { array('province', $province, false); } if ($city) { array('city', $city, false); } $limit = array($add_query_sum); $res_matches = $cl->getResult($cond, $limit); if ($res_matches) { $count_res = count($res_matches); $array_merge = array(); for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i])) { $ids[] = $res_matches['matches'][$i]['id']; } } $sql_str = implode(',', $ids); $nickname_res = $_MooClass['MooMySQL']->getAll("select nickname,uid from web_members_search where uid in " . "({$sql_str})"); $mainimg_res = $_MooClass['MooMySQL']->getAll("select mainimg from web_members_base where uid in " . "({$sql_str})"); $introduce_res = $_MooClass['MooMySQL']->getAll("select introduce from web_members_introduce where uid in " . "({$sql_str})"); //合并到sphinx查询出的整理后的数组 for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i]['attrs'])) { $res_matches['matches'][$i]['attrs']['nickname'] = $nickname_res[$i]['nickname']; $res_matches['matches'][$i]['attrs']['uid'] = $nickname_res[$i]['uid']; $res_matches['matches'][$i]['attrs']['mainimg'] = $mainimg_res[$i]['mainimg']; $res_matches['matches'][$i]['attrs']['introduce'] = $introduce_res[$i]['introduce']; $bigarr[] = $res_matches['matches'][$i]['attrs']; } } ${$add} = $bigarr; } else { $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.uid not in({$user_in})\n\t\t\t\t\t\t\t\t AND {$sql_add} s.city_star=0 AND s.s_cid = 20 and s.gender={$gender}\n\t\t\t\t\t\t\t\t AND s.images_ischeck = 1 AND s.is_lock = 1 AND s.showinformation = 1\n\t\t\t\t\t\t\t\t AND s.pic_num >=1 AND s.usertype=1 AND i.introduce!='' and s.nickname!='' LIMIT {$add_query_sum}"; $param = "type=query/name=userlist_{$id}_other/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); ${$add} = $GLOBALS['_MooBlock']["userlist_{$id}_other"]; } //已获取的首页会员uid $user_list = array(); if (!is_array(${$add})) { ${$add} = array(); } //enky add foreach (${$add} as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode(',', $user_list); } //echo $user_in;exit; //已有总数 $count += count(${$add}); } } //$countryadd have data $userList = array_merge($userList, $cityadd, $provinceadd, $countryadd); //省其它类型会员缓存文件 //$province_othercachefile = "userlist_{$id}_other".'_'.md5($param).'.data'; } //生成的block缓存文件存库 /* $city = $city ? $city : 0; $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cache_arr = $_MooClass['MooMySQL']->getAll($sql); if(empty($cache_arr)){ $province_cachefile = isset($province_cachefile)?$province_cachefile:''; $sql = "INSERT INTO {$dbTablePre}index_cachefile SET province='{$province}',city='{$city}',provincestarfile='{$province_cachefile}',citystarfile='{$city_cachefile}',provinceotherfile='{$province_othercachefile}'"; $_MooClass['MooMySQL']->query($sql); } */ //推荐列表中如果存在,则以推荐列表中的指定的sort替换 $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE province='{$province}' AND city='{$city}' order by sort asc"; $recommend_list = $_MooClass['MooMySQL']->getAll($sql); if (!empty($recommend_list)) { foreach ($recommend_list as $list) { $sort = $list['sort'] < 1 ? 0 : $list['sort'] - 1; if (MOOPHP_ALLOW_FASTDB) { $u = MooFastdbGet('members_search', 'uid', $list['uid']); $u2 = MooFastdbGet('members_base', 'uid', $list['uid']); $u = array_merge($u, $u2); } else { $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.uid='{$list['uid']}'"; $u = $_MooClass['MooMySQL']->getOne($sql); } if ($u) { foreach ($userList as $key => $val) { if ($list['uid'] == $val['uid']) { $user_key = $key; break; } } if (isset($user_key)) { if (isset($userList[$sort])) { $userList[$key] = $userList[$sort]; } $userList[$sort] = $u; } else { $userList[$sort] = $u; } } } } // } //删除数组中多余的部分 array_splice($userList, 6); $userArr = array(); $i = 0; $imgSrcSmall = $imgSrcMid = $imgSrcUrl = ''; foreach ($userList as $v) { $introduce = ''; if (isset($v['introduce'])) { $introduce = MooCutstr($v['introduce'], 50, '...'); } $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $age = date('Y') - $v['birthyear'] . '岁'; } else { $age = '年龄保密'; } $userArr[] = array("i" => $i, "uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $v['nickname'], "age" => $age, "province" => $v['province'], "city" => $v['city']); $i++; } //===============最新注册会员,按照片数排序 ,男会员========================= $newMale = array(); $param = "type=query/name=new_members_male/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.gender=0 and s.pic_num>4 and s.images_ischeck=1 and s.is_lock=1 and i.introduce!='' and s.nickname!='' order by s.uid desc limit 3/cachetime=10800"; $_MooClass['MooCache']->getBlock($param); $new_reguser_male = isset($GLOBALS['_MooBlock']['new_members_male']) ? $GLOBALS['_MooBlock']['new_members_male'] : ''; foreach ($new_reguser_male as $v) { $introduce = MooCutstr($v['introduce'], 14, '...'); $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $birthyear = date('Y') - $v['birthyear'] . '岁'; } else { $birthyear = '年龄保密'; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 15, ''); } else { $nickname = 'ID:' . $v['uid']; } $newMale[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $nickname, "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']); } //==================最新注册会员,按照片数排序 ,女会员========================== $param = "type=query/name=new_members_female/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.gender=1 and s.pic_num>4 and s.images_ischeck=1 and s.is_lock=1 order by s.uid desc limit 3/cachetime=10800"; $_MooClass['MooCache']->getBlock($param); $new_reguser_female = isset($GLOBALS['_MooBlock']['new_members_female']) ? $GLOBALS['_MooBlock']['new_members_female'] : ''; foreach ($new_reguser_female as $v) { $introduce = MooCutstr($v['introduce'], 14, '...'); $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $birthyear = date('Y') - $v['birthyear'] . '岁'; } else { $birthyear = '年龄保密'; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 15, ''); } else { $nickname = 'ID:' . $v['uid']; } $newFemale[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $nickname, "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']); } //=================钻石会员 地区切换时真爱一生推荐会员涉及的================================== $sql = "select count(uid) as num from web_diamond_recommend where isindex=1 and province='{$province}'"; $result = $_MooClass['MooMySQL']->getOne($sql); $num = $result['num']; /* $sql="select count(uid) as num from web_diamond_recommend where isindex=1 and gender='0' and province='{$province}'"; $result_male=$_MooClass['MooMySQL']->getOne($sql); $num_male=$result_male['num']; */ if ($num >= 5) { //女钻石会员 $sql = "select uid,birthyear,province,city,nickname from {$dbTablePre}diamond_recommend where isindex=1 and province='{$province}' order by city<>'{$city}' ,city desc,sort desc limit 10"; //FEMAIL $param = "type=query/name=web_diamond_recommend/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $arr_diamond = $GLOBALS['_MooBlock']['web_diamond_recommend']; //男钻石会员 /* $sql_male = "select uid,birthyear,province,city,nickname from {$dbTablePre}diamond_recommend where isindex=1 and gender='0' and province='{$province}' order by city<>'{$city}' ,city desc,sort desc limit 10"; //MAIL $param = ("type=query/name=web_diamond_recommend/sql=$sql_male/cachetime=86400"); $_MooClass['MooCache']->getBlock($param); $arr_diamond_male = $GLOBALS['_MooBlock']['web_diamond_recommend']; */ } else { $diamond_filename = "data/cache/diamond_intro.php"; if (!file_exists($diamond_filename)) { //女钻石会员 $sql = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1'"; $sql = $sql . " order by m.pic_num desc,m.bgtime desc limit 10"; $arr_diamond = $_MooClass['MooMySQL']->getAll($sql); foreach ($arr_diamond as $k => $v) { $diamond_str .= $v['uid'] . ','; } //男钻石会员 /* $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.s_cid='20' and m.usertype='1' and i.introduce_pass='******' and m.is_lock='1' and m.images_ischeck='1' and m.gender='0'"; $sql = $sql_male . " order by m.pic_num desc,m.bgtime desc limit 10"; $arr_diamond_male = $_MooClass['MooMySQL']->getAll($sql); foreach($arr_diamond_male as $k=>$v){ $diamond_str_male .= $v['uid'].','; } */ //$diamond_str=$diamond_str_female.$diamond_str_male; file_put_contents($diamond_filename, $diamond_str); } else { $arr_diamond = file($diamond_filename); if ($arr_diamond) { $star_user = trim($arr_diamond[0], ','); $star_user = explode(',', $star_user); if (count($star_user) == 10) { $star = $star_user[0] . ',' . $star_user[1] . ',' . $star_user[2] . ',' . $star_user[3] . ',' . $star_user[4] . ',' . $star_user[5] . ',' . $star_user[6] . ',' . $star_user[7] . ',' . $star_user[8] . ',' . $star_user[9]; //女钻石会员 enky need change $sql = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in({$star}) limit 10"; //FEMAIL $param = "type=query/name=web_star_recommend/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $arr_diamond = $GLOBALS['_MooBlock']['web_star_recommend']; /* $star_male=$star_user[10].','.$star_user[11].','.$star_user[12].','.$star_user[13].','.$star_user[14].','.$star_user[15].','.$star_user[16].','.$star_user[17].','.$star_user[18].','.$star_user[19]; //男钻石会员 enky need change $sql_male = "select m.uid,m.birthyear,m.province,m.city,m.nickname,b.mainimg,m.images_ischeck,i.introduce from {$dbTablePre}members_search m left join {$dbTablePre}members_base as b on m.uid=b.uid left join {$dbTablePre}members_introduce as i on m.uid=i.uid left join {$dbTablePre}members_choice c on m.uid=c.uid where m.uid in($star_male) limit 10"; //MAIL $param = ("type=query/name=web_star_recommend/sql=$sql_male/cachetime=86400"); $_MooClass['MooCache']->getBlock($param); $arr_diamond_male = $GLOBALS['_MooBlock']['web_star_recommend']; */ } } } } $diamond = array(); foreach ($arr_diamond as $v) { if (MooGetphoto($v['uid'], 'middle')) { $imgSrc = MooGetphoto($v['uid'], 'mid'); } else { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 6, ''); } else { $nickname = "ID:" . $v['uid']; } if ($v['birthyear'] == '') { $age = iconv('gbk', 'utf-8', "年龄:保密"); } else { $age = date('Y') - $v['birthyear'] . "岁"; } foreach ($provice_list as $key => $val) { if ($v['province'] == $key) { $PROVINCE = $val; break; } } foreach ($city_list as $key => $val) { if ($v['city'] == $key) { $CITY = $val; break; } } $diamond[] = array("uid" => $v['uid'], "imgSrc" => $imgSrc, "nickname" => $nickname, "age" => $age, "province" => $PROVINCE, "city" => $CITY); } //========================高级会员============================= $param = "type=query/name=members_advance/sql=SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid where s.s_cid='30' and s.images_ischeck=1 and s.is_lock=1 and s.showinformation=1 order by s.uid desc limit 8/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $members_advance = isset($GLOBALS['_MooBlock']['members_advance']) ? $GLOBALS['_MooBlock']['members_advance'] : ''; $advance = array(); foreach ($members_advance as $v) { if (MooGetphoto($v['uid'], 'middle')) { $imgSrc = MooGetphoto($v['uid'], 'mid'); } else { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } if ($v['nickname']) { $nickname = MooCutstr($v['nickname'], 6, ''); } else { $nickname = "ID:" . $v['uid']; } if ($v['birthyear'] == '') { $age = iconv('gbk', 'utf-8', "年龄:保密"); } else { $age = date('Y') - $v['birthyear'] . "岁"; } foreach ($provice_list as $key => $val) { if ($v['province'] == $key) { $PROVINCE = $val; break; } } foreach ($city_list as $key => $val) { if ($v['city'] == $key) { $CITY = $val; break; } } $advance[] = array("uid" => $v['uid'], "imgSrc" => $imgSrc, "nickname" => $nickname, "age" => $age, "province" => $PROVINCE, "city" => $CITY); } //========================成功案例============================= $storyList = array(); $param = "type=query/name=story/sql=select s.sid,s.uid,s.title,s.content,s.name1,s.name2,s.story_date,sp.img from `{$dbTablePre}story` as s left join `{$dbTablePre}story_pic` as sp on s.is_index=sp.mid where sp.syscheck=1 and s.syscheck=1 and s.recommand= '1' order by s.story_date desc,sp.img desc limit 0, 4/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $story = $GLOBALS['_MooBlock']['story']; foreach ($story as $v) { $picsmall = MooGetstoryphoto($v['sid'], $v['uid'], 'medium'); if ($picsmall) { $imgSrc = "<img src=\"" . $picsmall . "\" width=\"211\" height=\"143\" /> "; } else { $imgSrc = "<img src=\"module/index/templates/default/images/story_sample.jpg\" width=\"211\" height=\"143\" />"; } $title = MooCutstr($v['title'], 18, $dot = ' '); $name1 = MooCutstr($v['name1'], 8, ''); $name1 = getSex($v['uid']) ? "她" . $name1 : "他" . $name1; $name2 = MooCutstr($v['name2'], 8, ''); $name2 = getSex($v['uid']) ? '她' . $name2 : '他' . $name2; $date = Date('Y-m-d', $v['story_date']); $content = MooCutstr($v['content'], 50, $dot = ' ...'); $storyList[] = array("sid" => $v['sid'], "imgSrc" => $imgSrc, "title" => $title, "name1" => $name1, "name2" => $name2, "date" => $date, "content" => $content); } // print_r($storyList);exit; MooPlugins('ipdata'); $ip = GetIP(); //$ip = '119.145.41.181'; $finally_ip = convertIp($ip); //$news_ip =iconv('gbk','utf-8',file_get_contents('http://fw.qq.com/ipaddress')); //$finally_ip = $news_ip; //echo $finally_ip; if (preg_match('/(广东|广州|深圳|佛山|珠海|东莞|汕头|韶关|江门|湛江|茂名|肇庆|惠州|梅州|汕尾|河源|清远|阳江|潮州|揭阳|云浮)/', $finally_ip)) { $finally_address = 1; } $time = time(); //活动时间 $activitytime1 = "2011-02-01 00:30:00"; $activitytime2 = "2011-02-08"; if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) { $appear = "1"; } // note 与相亲网首页错开会员 $api = MooGetGPC('api', 'string', "G"); if ($api == '0019') { $d = ''; foreach ($userList as $v) { if ($v['uid'] < 30000000) { $apistr .= $d . $v['uid']; $d = ','; } } exit($apistr); } $text_list = text_show(); //echo $province; require MooTemplate('public/index_test', 'module'); }
?> ',city)</script><?php } ?> </dd> <!-- <dd class="f-ed0a91">< <?php echo activetime($friend['s']['lastvisit'], $friend['s']['usertype']); ?> ></dd> --> </dl> </li> <li class="fright"> <dl class="r-service-heart"> <dt>内心独白</dt> <dd class="r-service-heart-text"><?php echo $friend['t']['introduce'] ? MooCutstr($friend['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容'; ?> </dd> <!-- <dd> <p><input name="" onclick="location.href='index.php?n=service&h=commission&t=sendcontact&sendid=<?php echo $friend['s'][uid]; ?> '" type="button" class="btn btn-default" value="委托真爱一生联系TA" /></p></dd> --> </dl> </li> </ul> <?php } ?> <div class="clear"></div> <div class="pages"><span class="fleft" style="padding-left:40px;"><input name="" type="checkbox" onclick="checkAll(this)" value="" /> 全选 <input name="" type="submit" class="btn btn-default" value="删除信息" /><input type="hidden" name="delfriend" value="删除秋波"></span><?php
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'); }
function to_send_hn_message() { global $_MooClass, $dbTablePre, $userid, $user_arr; $s_title = MooGetGPC('s_title', 'string', 'P'); $s_title = rtrim($s_title); //对主题字数限制 $s_title = MooCutstr($s_title, 30, $dot = ''); $s_content = MooGetGPC('s_content', 'string', 'P'); //note 特殊字符 $s_content = rtrim($s_content); if ($s_title && $s_content) { //note 客服ID $user = $_MooClass['MooMySQL']->getOne("select uid,sid,telphone from {$dbTablePre}members_search where uid='{$userid}'"); if (empty($user['sid'])) { $sid = 20; } else { $sid = $user['sid']; } //note 添回复的消息、添加发送的消息 $remark_title = "{$userid}会员给给您发消息了,请速查看。"; $awoketime = time() + 600; $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$sid}',title='{$remark_title}',content='{$s_content}',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'"; $send_status = $_MooClass['MooMySQL']->query($sql); //邮件回复提醒 $sql = "INSERT INTO {$GLOBALS['dbTablePre']}services(s_cid,s_uid,s_fromid,s_title,s_content,s_time,is_server,sid,flag)\n\t\t\t\tVALUES(3,{$userid},'{$sid}','真爱一生消息','您好!您的消息红娘已经收到,我们将在一个工作日内解决!4008787920','{$GLOBALS['timestamp']}','1','{$sid}','1')"; $ret = $GLOBALS['_MooClass']['MooMySQL']->query($sql); //短信回复提醒 Push_message_intab($userid, $user['telphone'], "邮件回复", "您的消息红娘已经收到,我们将在一个工作日内解决。4008787920!", "system"); //添加成功提示信息 if ($send_status) { MooMessage('发送成功', 'javascript:history.go(-2)', '05'); } else { MooMessage('发送失败', 'javascript:history.go(-1)', '03'); } } else { MooMessage('数据填写不完整', 'javascript:history.go(-1)', '03'); } }
<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>升级钻石会员——真爱一生网</title> <?php include MooTemplate('system/js_css', 'public'); ?> <link href="module/payment/templates/default/payment.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="d"> <?php if ($GLOBALS['MooUid']) { ?> <div class="logined"> 您的用户名是:<?php echo $GLOBALS['MooUserName'] ? MooCutstr($GLOBALS['MooUserName'], 16) : $user_arr['nickname']; ?> 您的ID是:<?php echo $GLOBALS['MooUid']; ?> 最新邮件(<a href="index.php?n=service&h=message"><?php echo $GLOBALS['new_email_num']; ?> ) <a href="service.html">进入我的红娘>></a> <a href="index.php?n=index&h=logout">安全退出</a> </div><?php } ?> </div> <div class="main">
function advance_search($gender, $age_begin, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $weight1, $weight2, $body, $smoking, $drinking, $occupation, $house, $vehicle, $corptype, $children, $wantchildren, $home_townprovince, $home_towncity, $nation, $body, $animalyear, $constellation, $bloodtype, $religion, $family, $language, $photo, $email, $searchsign) { global $_MooClass, $dbTablePre; global $user_arr; // 包含配置文件 require_once "crontab_config.php"; //note 获得当前的url 去除多余的参数page= $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $condition_str = ""; /* 以下分页参数设置 */ $pagesize = 16; //note limit查询开始位置 $start = 0; $index = 'members_man'; //索引 sphinx $filter = array(); //过滤条件 sphinx if ($gender == 1) { $condition_str .= "女性"; $index = 'members_women'; } elseif ($gender == 0) { $condition_str .= "男性"; } //note 查询是否显示照片 if ($photo == '1') { $condition_str .= " 必须要照片"; //$photo_sql = " AND `pic_name` != ''"; $filter[] = array('images_ischeck', 1); } //note 转换成实际的年份 if ($age_end) { $age_begin1 = gmdate('Y', time()) - intval($age_end); } if ($age_begin) { $age_end1 = gmdate('Y', time()) - intval($age_begin); } //note 年龄条件查询sql语句 //$age_sql = ''; if ($age_begin1 && $age_end1) { //$age_sql = ' AND (s.birthyear >= '.$age_begin1.' AND s.birthyear <= '.$age_end1.')'; $filter[] = array('birthyear', array($age_begin1, $age_end1)); $condition_str .= " 年龄" . $age_begin . "到" . $age_end . "岁"; } else { if ($age_begin1 && empty($age_end1)) { //$age_sql = ' AND s.birthyear >= '.$age_begin; $filter[] = array('birthyear', array($age_begin, $age_begin + 99)); $condition_str .= " 年龄大于等于" . $age_begin . "岁"; } else { if ($age_end1 && empty($age_begin1)) { //$age_sql = ' AND s.birthyear <= '.$age_end; $filter[] = array('birthyear', array($age_end1 - 99, $age_end1)); $condition_str .= " 年龄小于等于" . $age_end . "岁"; } } } //note 地区条件查询sql语句 /* $area_sql = ''; $area_sql = ' AND s.province = '.$work_province.' AND s.city = '.$work_city; if($work_city == '-1' && $work_province != '-1') $area_sql = ' AND province = '.$work_province; if($work_province == '-1' && $work_city == '-1') $area_sql = ''; if($work_province=="-1"){ $area_sql = ''; } */ if ($work_province != '-1' && $work_province != 0) { $condition_str .= " 所在地区:" . $provice_list[$work_province]; if ($work_province == '-2') { $work_province = 2; } $filter[] = array('province', $work_province); if ($work_city != '-1' && $work_city != 0) { $filter[] = array('city', $work_city); $condition_str .= " " . $city_list[$work_city]; } } //note 婚姻状况条件查询sql语句 if ($marriage != 0 && $marriage != '-1' && is_array($marriage)) { $marr_str = " 婚烟状况:"; //$marriage_sql =" and s.marriage in("; $marr_sql = array(); foreach ($marriage as $v) { $marr_str .= $marriage_list[$v] . " "; $marr_sql[] = $v; } /* if($marr_sql){ $marr_sql=join(",",$marr_sql); }*/ $filter[] = array('marriage', implode(' | ', $marr_sql)); //$marriage_sql.=$marr_sql.")"; $condition_str .= $marr_str; } //note 月收入条件查询sql语句 if ($salary != 0 && $salary != '-1' && is_array($salary)) { $salary_str = " 月收入:"; //$salary_sql = " and s.salary in("; $sal_sql = array(); foreach ($salary as $v) { $salary_str .= $salary_list[$v]; $sal_sql[] = $v; } /*if($sal_sql){ $sal_sql=join(",",$sal_sql); } $salary_sql.=$sal_sql.")";*/ $filter[] = array('salary', implode(' | ', $sal_sql)); $condition_str .= $salary_str; } //if($salary == '-1') $salary_sql = ''; //$condition_str .= $salary_str; //note 教育程度条件查询sql语句 if ($education != '0' && $education != '-1' && is_array($education)) { $education_str = " 教育程度:"; //$education_sql = " and s.education in("; $e_sql = array(); foreach ($education as $v) { $education_str .= $education_list[$v]; $e_sql[] = $v; } /*if($e_sql){ $e_sql=join(",",$e_sql); } $education_sql.=$e_sql.")";*/ $filter[] = array('education', implode(' | ', $e_sql)); $condition_str .= $education_str; } //if($education == '-1') $education_sql = ''; //note 身高条件查询sql语句 //$height_sql = ''; $height1 = $height1 != 0 && $height1 != '-1' ? $height1 : 0; $height2 = $height2 != 0 && $height2 != '-1' ? $height2 : 0; if ($height1 || $height1) { if ($height1 && $height2 && $height2 > $height1) { //$height_sql = ' AND (s.height >= '.$height1.' AND s.height <= '.$height2.')'; $filter[] = array('height', array($height1, $height2)); $condition_str .= " 身高" . $height1 . "cm到" . $height2 . "cm"; } else { if ($height1 && $height2 && $height2 < $height1) { //$height_sql = ' AND (s.height <= '.$height1.' AND s.height >= '.$height2.')'; $filter[] = array('height', array($height2, $height1)); $condition_str .= " 身高" . $height2 . "cm到" . $height1 . "cm"; } else { if ($height1 && !$height2) { //$height_sql = ' AND s.height >= '.$height1; $filter[] = array('height', array($height1, $height1 + 200)); $condition_str .= " 身高大于等于" . $height1 . "cm"; } else { if ($height2 && !$height1) { //$height_sql = ' AND s.height <='.$height2; $filter[] = array('height', array(0, $height2)); $condition_str .= " 身高小于等于" . $height2 . "cm"; } else { if ($height1 && $height2 && $height1 == $height2) { //$height_sql = ' AND s.height ='.$height1; $filter[] = array('height', $height1); $condition_str .= " 身高等于" . $height1 . "cm"; } } } } } } /*else if($height2 =='-1' && $height1 == '-1') { $height_sql = ''; } */ //note 体重条件查询sql语句 //$weight_sql = ''; $weight1 = $weight1 != 0 && $weight1 != '-1' ? $weight1 : 0; $weight2 = $weight2 != 0 && $weight2 != '-1' ? $weight2 : 0; if ($weight1 && $weight2) { if ($weight1 && $weight2 && $weight2 > $weight1) { //$weight_sql = ' AND (sf.weight >= '.$weight1.' AND sf.weight <= '.$weight2.')'; $filter[] = array('weight', array($weight1, $weight2)); $condition_str .= " 体重" . $weight1 . "kg到" . $weight2 . "kg"; } else { if ($weight1 && $weight2 && $weight2 < $weight1) { //$weight_sql = ' AND (sf.weight <= '.$weight1.' AND sf.weight >= '.$weight2.')'; $filter[] = array('weight', array($weight2, $weight1)); $condition_str .= " 体重" . $weight2 . "kg到" . $weight1 . "kg"; } else { if ($weight1 && !$weight2) { //$weight_sql = ' AND sf.weight >= '.$weight1; $filter[] = array('weight', array($weight1, $weight1 + 80)); $condition_str .= " 体重大于等于" . $weight1 . "kg"; } else { if ($weight2 && !$weight1) { //$weight_sql = ' AND sf.weight <='.$weight2; $filter[] = array('weight', array(0, $weight2)); $condition_str .= " 体重小于等于" . $weight2 . "kg"; } else { if ($weight1 && $weight2 && $weight1 == $weight2) { //$weight_sql = ' AND sf.weight ='.$weight1; $filter[] = array('weight', $weight1); $condition_str .= " 体重等于" . $weight1 . "kg"; } } } } } } /*else if($weight2 =='-1' && $weight1 == '-1') { $weight_sql = ''; }*/ //note 是否抽烟查询sql语句 if ($smoking != 0 && $smoking != '-1' && $smoking != '-2' && is_array($smoking)) { $smoking_str = " 抽烟要求:"; //$smoking_sql = " and sf.smoking in("; $smok_sql = array(); foreach ($smoking as $v) { $smoking_str .= $smoking_list[$v]; $smok_sql[] = $v; } /*if($smok_sql){ $smok_sql=join(",",$smok_sql); } $smoking_sql.= $smok_sql.")";*/ $filter[] = array('smoking', implode(' | ', $smok_sql)); $condition_str .= $smoking_str; } //if($smoking == '-1' || $smoking == '-2') $smoking_sql = ''; //note 是否喝酒查询sql语句 if ($drinking != 0 && $drinking != '-1' && $drinking != '-2' && is_array($drinking)) { $drinking_str = " 喝酒要求:"; //$drinking_sql = " and sf.drinking in("; $drink_sql = array(); foreach ($drinking as $v) { $drinking_str .= $drinking_list[$v] . " "; $drink_sql[] = $v; } $filter[] = array('drinking', implode(' | ', $drink_sql)); /* if($drink_sql){ $drink_sql=join(",",$drink_sql); } $drinking_sql.=$drink_sql.")";*/ $condition_str .= $drinking_str; } // //if($drinking == '-1' || $drinking == '-2') $drinking_sql = ''; //note 从事职业查询sql语句 if ($occupation != 0 && $occupation != '-1' && $occupation != '-2' && is_array($occupation)) { $occupation_str = " 从事行业要求:"; //$occupation_sql = " and sf.occupation in( "; $oc_sql = array(); foreach ($occupation as $v) { $occupation_str .= $drinking_list[$v] . " "; $oc_sql[] = $v; } /*if($oc_sql){ $oc_sql=join(",",$oc_sql); } $occupation_sql.=$oc_sql.")"; */ $filter[] = array('occupation', implode(' | ', $oc_sql)); $condition_str .= $occupation_str; } //if($occupation == '-1' || $occupation == '-2') $occupation_sql= ''; //note 住房情况查询sql语句 if ($house != 0 && $house != '-1' && $house != '-2' && is_array($house)) { $house_str = " 住房情况:"; //$house_sql = " and s.house in( "; $ho_sql = array(); foreach ($house as $v) { $house_str .= $house_list[$v] . " "; $ho_sql[] = $v; } /*if($ho_sql){ $ho_sql=join(",",$ho_sql); } $house_sql.=$ho_sql.")";*/ $filter[] = array('house', implode(' | ', $ho_sql)); $condition_str .= $house_str; } // if($house == '-1' || $house == '-2') $house_sql = ''; //note 购车查询sql语句 if ($vehicle != 0 && $vehicle != '-1' && $vehicle != '-2' && is_array($vehicle)) { $vehicle_str = " 购车情况:"; //$vehicle_sql =" and sf.vehicle in("; $ve_sql = array(); foreach ($vehicle as $v) { $vehicle_str .= $vehicle_list[$v] . " "; $ve_sql[] = $v; } /*if($ve_sql){ $ve_sql=join(",",$ve_sql); } $vehicle_sql.=$ve_sql.")";*/ $filter[] = array('vehicle', implode(' | ', $ve_sql)); $condition_str .= $vehicle_str; } //if($vehicle == '-1' || $vehicle == '-2') $vehicle_sql = ''; //note 公司类别sql语句 if ($corptype != 0 && $corptype != '-1' && $corptype != '-2' && is_array($corptype)) { $corptype_str = " 公司类别:"; //$corptype_sql = " and sf.corptype in("; $co_sql = array(); foreach ($corptype as $v) { $corptype_str .= $corptype_list[$v] . " "; $co_sql[] = $v; } /*if($co_sql){ $co_sql=join(",",$co_sql); } $corptype_sql.=$co_sql." )";*/ $filter[] = array('corptype', implode(' | ', $co_sql)); $condition_str .= $corptype_str; } //if($corptype == '-1' || $corptype == '-2') $corptype_sql = ''; //note 是否有孩子sql语句 if ($children != 0 && $children != '-1' && $children != '-2' && is_array($children)) { $children_str = " 有无孩子:"; //$children_sql = " and s.children in("; $chil_sql = array(); foreach ($children as $v) { $children_str .= $children_list[$v] . " "; $chil_sql[] = $v; } /*if($chil_sql){ $chil_sql=join(",",$chil_sql); } $children_sql.=$chil_sql.")";*/ $filter[] = array('children', implode(' | ', $chil_sql)); $condition_str .= $children_str; } //if($children == '-1' || $children == '-2') $children_sql = ''; //note 是否要孩子sql语句 if ($wantchildren != 0 && $wantchildren != '-1' && $wantchildren != '-2' && is_array($wantchildren)) { $wantchildren_str = " 可要孩子:"; //$wantchildren_sql = " and sf.wantchildren in("; $wan_sql = array(); foreach ($wantchildren as $v) { $wantchildren_str .= $wantchildren_list[$v] . " "; $wan_sql[] = $v; } /*if($wan_sql){ $wan_sql=join(",",$wan_sql); } $wantchildren_sql.=$wan_sql.")";*/ $filter[] = array('wantchildren', implode(' | ', $wan_sql)); $condition_str .= $wantchildren_str; } // if($wantchildren == '-1' || $wantchildren == '-2') $wantchildren_sql = ''; //note 籍贯查询sql语句 /* $hometown_sql = ''; $hometown_sql = ' AND sf.hometownprovince = '.$home_townprovince.' AND sf.hometowncity = '.$home_towncity; if($home_towncity == '-1' && $home_townprovince !='-1') { $hometown_sql = ' AND sf.hometownprovince = '.$home_townprovince; } if($home_townprovince == '-1' && $home_townprovince == '-1') $hometown_sql = '';*/ if ($home_townprovince != 0 && $home_townprovince != -1) { if ($home_townprovince == '-2') { $home_townprovince = 2; } $filter[] = array('home_townprovince', $home_townprovince); $condition_str .= " 籍贯:" . $city_list[$home_townprovince]; if ($home_towncity != 0 && $home_towncity != -1) { $filter[] = array('home_towncity', $home_towncity); $condtion_str .= " " . $city_list[$home_towncity]; } } //note 名族查询sql语句 /*$nation_sql = ''; $nation_sql = ' AND sf.nation = '.$nation; if($nation == '-1') $nation_sql = ''; */ if ($nation != -1) { $filter[] = array('nation', $nation); $condition_str .= " 民族:" . $stock_list[$nation]; } //note 体型查询sql语句 if ($body != 0 && $body != '-1' && $body != '-2' && is_array($body)) { $body_str = " 体型:"; //$body_sql = " and sf.body in("; $body_list = $user_arr["gender"] == 0 ? $body1_list : $body0_list; $bo_sql = array(); foreach ($body as $v) { /*if ($user_arr["gender"] == 0) { $body_str .= $body1_list[$v] . " "; } else { $body_str .= $body0_list[$v] . " "; }*/ $body_str .= $body_list[$v]; $bo_sql[] = $v; } /*if($bo_sql){ $bo_sql=join(",",$bo_sql); } $body_sql.=$bo_sql.")";*/ $filter[] = array('body', implode(' | ', $bo_sql)); $condition_str .= $body_str; } //if($body == '-1' || $body == '-2') $body_sql = ''; //note 生肖查询sql语句 if ($animalyear != 0 && $animalyear != '-1' && $animalyear != '-2' && is_array($animalyear)) { $animalyear_str = " 生肖:"; //$animalyear_sql = " and sf.animalyear in("; $ani_sql = array(); foreach ($animalyear as $v) { $animalyear_str .= $animals_list[$v] . " "; $ani_sql[] = $v; } /*if($ani_sql){ $ani_sql=join(",",$ani_sql); } $animalyear_sql.=$ani_sql.")";*/ $filter[] = array('animalyear', implode(' | ', $ani_sql)); $condition_str .= $animalyear_str; } //if($animalyear == '-1' || $animalyear == '-2') $animalyear_sql = ''; //note 星座查询sql语句 if ($constellation != 0 && $constellation != '-1' && $constellation != '-2' && is_array($constellation)) { $constellation_str = " 星座:"; //$constellation_sql = " and sf.constellation in( "; $cons_sql = array(); foreach ($constellation as $v) { $constellation_str .= $constellation_list[$v] . " "; $cons_sql[] = $v; } /*if($cons_sql){ $cons_sql=join(",",$cons_sql); } $constellation_sql.=$cons_sql.")";*/ $filter[] = array('constellation', implode(' | ', $cons_sql)); $condition_str .= $constellation_str; } //if($constellation == '-1' || $constellation == '-2') $constellation_sql = ''; //note 血型查询sql语句 if ($bloodtype != 0 && $bloodtype != '-1' && $bloodtype != '-2' && is_array($bloodtype)) { $bloodtype_str = " 血型:"; //$bloodtype_sql =" and sf.bloodtype in("; $bloo_sql = array(); foreach ($bloodtype as $v) { $bloodtype_str .= $bloodtype_list[$v] . " "; $bloo_sql[] = $v; } /*if($bloo_sql){ $bloo_sql=join(",",$bloo_sql); } $bloodtype_sql.=$bloo_sql.")";*/ $filter[] = array('bloodtype', implode(' | ', $bloo_sql)); $condition_str .= $bloodtype_str; } //if($bloodtype == '-1' || $bloodtype == '-2') $bloodtype_sql = ''; //note 信仰查询sql语句 if ($religion != 0 && $religion != '-1' && $religion != '-2' && is_array($religion)) { $religion_str = " 信仰:"; //$religion_sql = " and sf.religion in("; $reli_sql = array(); foreach ($religion as $v) { $religion_str .= $belief_list[$v] . " "; $reli_sql[] = $v; } /* if($reli_sql){ $reli_sql=join(",",$reli_sql); } $religion_sql.=$reli_sql.")";*/ $filter[] = array('religion', implode(' | ', $reli_sql)); $condition_str .= $religion_str; } // if($religion == '-1' || $religion == '-2') $religion_sql = ''; //note 兄弟姐妹sql语句 if ($family != '0' && $family != '-1' && $family != '-2' && is_array($family)) { $family_str = " 兄弟姐妹:"; //$family_sql = " and sf.family in("; $fami_sql = array(); foreach ($family as $v) { $family_str .= $family_list[$v]; $fami_sql[] = $v; } /*if($fami_sql){ $fami_sql=join(",",$fami_sql); } $family_sql.=$fami_sql.")";*/ $filter[] = array('family', implode(' | ', $fami_sql)); $condition_str .= $family_str; } //if($family == '-1' || $family == '-2') $family_sql = ''; //note 语言能力sql语句,采用like查询 $language_sql = ""; if (is_array($language)) { $language_str = " 语言能力:"; //$language_sql = " and("; //$lan_sql = ""; $lan_sql = array(); foreach ($language as $v) { $language_str .= $language_list[$v] . " "; $lan_sql[] = $v; /*if (empty($lan_sql)) { $lan_sql .= " FIND_IN_SET('" . $v . "'," . "sf.language)"; } else { $lan_sql .= " or FIND_IN_SET('" . $v . "'," . "sf.language)"; }*/ } $filter[] = array('language', implode(' | ', $lan_sql)); //$language_sql .= $lan_sql . ")"; $condition_str .= $language_str; } //if($language == '-1' || $language == '-2') $language_sql = ''; /*$sql = " on sf.uid=s.uid where s.is_lock = 1 and s.gender='$gender' ".$age_sql.$area_sql.$marriage_sql.$salary_sql.$education_sql.$height_sql.$weight_sql. $smoking_sql.$drinking_sql.$occupation_sql.$house_sql.$vehicle_sql.$corptype_sql.$children_sql.$wantchildren_sql.$hometown_sql. $nation_sql.$body_sql.$animalyear_sql.$constellation_sql.$bloodtype_sql.$religion_sql.$family_sql.$language_sql.$photo_sql;*/ $filter[] = array('is_lock', 1); $limit = array(16); $sp = searchApi($index); $sp->getResultOfReset($filter, $limit); $user_ids = $sp->getIds(); //$user = $_MooClass['MooMySQL']->getAll("select s.*,sf.body, sf.hometownprovince, sf.hometowncity from `{$dbTablePre}members` s left join `{$dbTablePre}memberfield` sf $sql LIMIT 0, 16"); //note 找不到匹配的结果返回单独提示页面 if (count($user_ids) == '0') { return; } $sql = "select s.uid,s.nickname,s.birthyear,s.height,s.hometownprovince,s.hometowncity,b.pic_date,b.pic_name from `{$dbTablePre}members_search` s left join `{$dbTablePre}members_base` b on s.uid=b.uid where s.uid in (" . implode(',', $user_ids) . ")"; $user = $_MooClass['MooMySQL']->getAll($sql); $recommend_member = $user[0]; $recommend_member_href = '<a href="http://' . MOOPHP_HOST . '/index.php?n=space&h=viewpro&uid=' . $recommend_member["uid"] . '" style="color:#bd0000; text-decoration:underline" target="_blank">'; if (!empty($recommend_member["nickname"])) { $recommend_member_href .= htmlspecialchars(MooCutstr($recommend_member["nickname"], 10)); } else { $recommend_member_href .= htmlspecialchars($recommend_member["uid"]); } $recommend_member_href .= "</a>"; $sql = "select introduce from " . $dbTablePre . "members_introduce where uid = '" . $recommend_member["uid"] . "'"; $choice = $_MooClass['MooMySQL']->getOne($sql, true); ob_start(); include MooTemplate('public/crontab_index', 'module'); $content = ob_get_clean(); //error_log($content, 0); //echo $email; $return = MooSendMail($email, "真爱一生网推荐会员", $content, "", false, $user_arr['uid']); }
function payment_ifyouaretheone_reg() { global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr; if ($_POST) { $name = safeFilter(MooGetGPC('name', 'string', 'P')); $profession = safeFilter(MooGetGPC('profession', 'string', 'P')); $mobile = safeFilter(MooGetGPC('mobile', 'string', 'P')); $telphone = safeFilter(MooGetGPC('telphone', 'string', 'P')); $qq = safeFilter(MooGetGPC('qq', 'string', 'P')); $msn = safeFilter(MooGetGPC('msn', 'string', 'P')); $email = safeFilter(MooGetGPC('email', 'string', 'P')); $lovede = safeFilter(MooGetGPC('lovede', 'string', 'P')); $description = safeFilter(MooGetGPC('description', 'string', 'P')); $lovede1 = safeFilter(MooGetGPC('lovede1', 'string', 'P')); $description1 = safeFilter(MooGetGPC('description1', 'string', 'P')); $ip = GetIP(); $uid = $userid; $dateline = time(); //note 如果用户没有填写爱情宣言或者自我描述 if ($lovede == $lovede1) { $lovede = ""; } if ($description == $description1) { $description = ""; } //note 限制爱情宣言和自我描述进库的字数 $lovede = MooCutstr($lovede, "1000"); $description = MooCutstr($description, "1000"); //note 表单每一项都要填写 if (!empty($name) && !empty($profession) && !empty($mobile) && !empty($lovede) && !empty($description)) { $sql = "insert into {$dbTablePre}ifyouaretheone (uid,name,profession,mobile,telphone,qq,msn,email,lovede,description,ip,dateline) \n values('{$uid}','{$name}','{$profession}','{$mobile}','{$telphone}','{$qq}','{$msn}','{$email}','{$lovede}','{$description}','{$ip}','{$dateline}')"; $_MooClass['MooMySQL']->query($sql); MooMessage("您的注册报名成功!", "index.php", '05'); } else { MooMessage("提交失败,请填写完整!", "index.php?n=payment&h=ifyouaretheone_reg", '02'); } } include MooTemplate('public/payment_ifyouaretheone_reg', 'module'); }
function to_send_message() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $timestamp, $serverid; $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $uuid = $memcached->get('uuid_' . $userid); //$error[] = array("getand_uuid"=>$and_uuid,"getuid"=>$uid,"userid"=>$userid,"mem_uuid"=>$uuid); $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = MooMembersData($userid); $contentid = MooGetGPC('s_id', 'integer', 'P'); //不可给同性别发送消息 $receive_info = MooMembersData($contentid); $receive_gender = $receive_info['gender']; if ($user_arr['gender'] == $receive_gender) { $err = "不可给同性别发送消息"; echo return_data($err, false); exit; } //系统管理员权限 /*$result=$_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'"); $groupid=$result['groupid']; //$GLOBALS['system_admin'] = array(60); if(in_array($groupid,$GLOBALS['system_admin'])){ $serverid=null; }*/ $result = $_MooClass['MooMySQL']->getOne("select groupid from web_admin_user where uid='{$serverid}'"); $groupid = $result['groupid']; if ($serverid && $user_arr['usertype'] != 3) { $err = "对不起您不能模拟操作"; echo return_data($err, false); exit; } if ($serverid && $user_arr['usertype'] == 3 && !in_array($groupid, $GLOBALS['admin_aftersales'])) { $err = "对不起您不能模拟操作"; echo return_data($err, false); exit; } //如果是本站注册会员 if ($user_arr['usertype'] == 1) { $m_level = get_userrank($userid); //会员等级 if ($m_level != 1) { //不是高级会员 if (!checkIsMobileCertical($userid)) { //没有通过了手机验证 $err = "您还没有进行手机验证,请先认证"; echo return_data($err, false); exit; } else { //if(!checkIsOver($userid)){ //过了试用期 $err = "只有钻石或高级会员才可以发送电子邮件给对方"; echo return_data($err, false); exit; //} } } } //print_r($_POST); //note s_cid 发送者的权限(回复时才有) $s_cid = MooGetGPC('s_cid', 'integer', 'P'); //echo $s_cid;exit; //收件人id $sid = $contentid; //发件人id $mid = $userid; ///echo $sid;exit; $s_title = MooGetGPC('s_title', 'string', 'P'); $s_title = rtrim($s_title); //对主题字数限制 $s_title = MooStrReplace(MooCutstr($s_title, 30, $dot = '')); $s_content = MooGetGPC('s_content', 'string', 'P'); //note 特殊字符 $s_content = rtrim(MooStrReplace(safeFilter($s_content))); $send_mymessage = MooGetGPC('send_mymessage', 'integer', 'P'); $message_back = MooGetGPC('message_back', 'integer', 'P'); //note 双方屏蔽不给操作 if (MooGetScreen($mid, $sid)) { $err = "因特殊原因,消息发送失败"; echo return_data($err, false); exit; } if ($mid && $sid && $s_title && $s_content) { $m_level = get_userrank($userid); //会员等级 if ($m_level == 2 && $user_arr['usertype'] != 3) { //普通会员需要审核(除采集会员之外) //if($user_arr['gender'] == 0){ //如果是男方发的,需要审核,0表示 $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','0')"); } else { $send_status = $_MooClass['MooMySQL']->query("insert into {$dbTablePre}services (s_cid,s_uid,s_fromid,s_title,s_content,s_time,sid,flag) values ('{$s_cid}','{$sid}','{$mid}','{$s_title}','{$s_content}'," . time() . ",'{$user_arr['sid']}','1')"); } //发送短信和邮件 include_once "./module/crontab/crontab_config.php"; $res = MooMembersData($sid); // $send_user_info = $_MooClass['MooMySQL']->getAll("select * from `{$dbTablePre}members_search` a left join {$dbTablePre}members_choice b on a.uid=b.uid where a.uid = '$userid'"); $send_user_info = array_merge(MooGetData("members_choice", 'uid', $userid), MooMembersData($userid)); // $send_user_info = $send_user_info[0]; //头像路径 $path = thumbImgPath(2, $send_user_info['pic_date'], $send_user_info['pic_name'], $send_user_info['gender']); if (file_exists($path)) { $img_path = $path; } else { if ($send_user_info['gender'] == 1) { $img_path = "/public/images/service_nopic_woman.gif"; } else { $img_path = "/public/images/service_nopic_man.gif"; } } $send_username = $send_user_info['nickname'] ? $send_user_info['nickname'] : $send_user_info['uid']; //发送者用户名 $send_user_grade = $send_user_info['gender'] == 1 ? "女" : "男"; //发送者性别 $province = $send_user_info['province'] ? $provice_list[$send_user_info['province']] : ''; //省 $city = $send_user_info['city'] ? $city_list[$send_user_info['city']] : ''; //市 $height = $send_user_info['height'] ? $height_list[$send_user_info['height']] : "未知"; //身高 ob_start(); require_once MooTemplate('public/mail_space_messagetpl', 'module'); //模板 $body = ob_get_clean(); MooSendMail($res['username'], "真爱一生网系统温馨提示", $body, "", false, $sid); $week_time = 24 * 3600 * 7; //一周时间秒数 $interval_time = $timestamp - $user_arr['last_login_time']; //当前时间-最后登录时间 $date1 = date("Y-m-d", strtotime("last Monday")); $date2 = date("Y-m-d", strtotime("Sunday")); if ($interval_time > $week_time) { //不活跃用户每周发一条短信 $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime>='{$date1}' and sendtime<='{$date2}'", true); if ($cos['c'] <= 1) { //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], "邮件", "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid); } } else { //活跃用户每天一条 //每天该用户超过5条信息不发送短信 $cos = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}today_send where uid='{$sid}' and sendtime='" . date("Y-m-d") . "'", true); if ($cos['c'] < 5) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}today_send SET uid = '" . $sid . "', sid = '" . $userid . "',phone = '" . $res['telphone'] . "',sendtime = '" . date("Y-m-d") . "'"); //fanglin暂时屏蔽 Push_message_intab($sid, $res['telphone'], '邮件', "真爱一生网 用户ID:" . $userid . "," . $send_user_grade . ",已给您发送电子邮件,请及时到真爱一生网查看!4006780405", $userid); } } //note 发送资料给接收方 if ($send_mymessage) { } //note 备份邮件操作 if ($message_back) { //note 发送MAIL时所需信息 $user = $_MooClass['MooMySQL']->getOne("select username,nickname from {$dbTablePre}members_search where uid='{$mid}'"); //note 发送MAIL时收信人的邮箱 $ToAddress = $user['username']; //note 发送MAIL时主题 $ToSubject = '提示:您在真爱一生网所发的消息备份'; //note 发送MAIL时Body内容所需信息 $username = $user['nickname']; //note 发送MAIL时Body内容所需信息 $toname = $_MooClass['MooMySQL']->getOne("select nickname from {$dbTablePre}members_search where uid='{$sid}'"); if ($username) { $ToBody = $username; } else { $ToBody = 'ID号为' . $mid . '的会员<br>'; } if ($toname['nickname']) { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给' . $toname['nickname'] . ',内容如下:<br>'; } else { $ToBody .= ':您好,您于' . date('Y-m-d H:i:s', time()) . ',在真爱一生网发送电子邮件给ID号为' . $sid . '的会员,内容如下:<br>'; } if ($username) { $ToBody .= ' 发件人:' . $username . '<br>'; } else { $ToBody .= ' 发件人:ID号为' . $mid . '<br>'; } if ($toname['nickname']) { $ToBody .= ' 收件人:' . $toname['nickname'] . '<br>'; } else { $ToBody .= ' 收件人:ID号为' . $sid . '<br>'; } $ToBody .= ' 主题:' . $s_title . '<br>'; $ToBody .= ' 正文:<br> ' . $s_content; MooSendMail($ToAddress, $ToSubject, $ToBody, $is_template = true, $sid); } //添加成功提示信息 if ($send_status) { /*普通会员对全权会员反馈白名单*/ if ($res['usertype'] == '3' && $user_arr['usertype'] != '3' && !$serverid) { white_list($res['uid'], $user_arr['uid']); } /*客服模拟全权记录*/ if ($user_arr['usertype'] == '3' && $serverid && $res['usertype'] != '3') { $action = '站内信'; fulllog($user_arr['uid'], $serverid, $action, $res); } //提醒所属客服 $usid = $user_arr['sid']; $title = '您的会员 ' . $mid . ' 向 ' . $sid . ' 发送了邮件'; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$usid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); if ($user_arr['gender'] == 0) { //男方发的 $suc = "发送成功,真爱一生审核后对方即可以收到。"; echo return_data($suc, true); exit; } else { $suc = "发送成功"; echo return_data($suc, true); exit; } } else { $err = "发送失败"; echo return_data($err, false); exit; } } else { $err = "数据填写不完整"; echo return_data($err, false); exit; } }
.html" target="_blank"><img src="<?php echo MooGetstoryphoto($s['sid'], $s['uid'], 'medium'); ?> " class="lazy" data-original="<?php echo MooGetstoryphoto($s['sid'], $s['uid'], 'medium'); ?> " /></a> <span><?php echo $s['name1']; ?> &<?php echo $s['name2']; ?> </span> <div class="line_"></div> <div class="detail"><?php echo MooCutstr($s['content'], 140); ?> </div> </div> <?php } ?> </div> </div> <div class="footer"> <!-- <div style="position:fixed;top:300px;right:20px;"><img src="module/index/templates/default/images/vution/Animated_Xmas-tree-animation.gif" /></div> --> <div class="g">品牌:专业婚恋服务 专业:庞大的资深红娘队伍 真实:诚信会员验证体系 </div> <div class="g">Copyright@<?php echo date('Y'); ?>
<dt><strong>内心独白:</strong></dt> <dt> <?php if (isset($vote_mem['introduce'])) { ?> <?php if ($vote_mem['uid'] < 1599400) { ?> <?php echo MooStrReplace(Moorestr(strip_tags(MooCutstr($vote_mem['introduce'], 500)))); ?> <?php } else { ?> <?php echo Moorestr(strip_tags(MooCutstr($vote_mem['introduce'], 500))); ?> <?php } } ?> </dt> </dl> </div> <div class="vote-cnter-bottom"></div> </div> <!--中间结束--> <!--右边开始--> <div class="vote-right"> <div class="vote-right-content"> <span class="right-title fleft">等您打分的会员</span>
echo $hot_story['title']; ?> </h3> <div class="detail"> <div class="m_title"> <span><?php echo $hot_story['name1']; ?> </span> 与 <span><?php echo $hot_story['name2']; ?> </span> 的爱情故事 </div> <p> <?php echo MooCutstr($hot_story['content'], 270, "……"); ?> <a target="_blank" href="index.php?n=story&h=content&sid=<?php echo $hot_story['sid']; ?> "> [查看详情]</a></p> </div> </div> <div class="clear"></div> </div> <div class="storys-box"> <?php foreach ((array) $index_story as $index_storys) { ?> <div class="singmarry">
<dd><?php if ($send_user1['s_cid'] == 20) { ?> <a href="index.php?n=payment&h=diamond" target="_blank"><img src="module/index/templates/default/images/zuan0.gif" title="钻石会员" alt="钻石会员"/></a><?php } elseif ($send_user1['s_cid'] == 30) { ?> <a href="index.php?n=payment" target="_blank"><img src="module/index/templates/default/images/zuan1.gif" title="高级会员" alt="高级会员"/></a><?php } else { } $nickname = $send_user1['nickname2'] ? $send_user1['nickname2'] : $send_user1['nickname']; if ($nickname) { echo MooCutstr($nickname, '10', ''); } else { ?> 会员<?php echo MooCutstr($send_user1['uid'], '10', ''); } ?> </dd> <dd><?php if ($send_user1['birthyear']) { echo gmdate('Y', time()) - $send_user1['birthyear']; ?> 岁<?php } else { ?> 年龄保密<?php } ?> </dd> </dl>
" width="120" height="150"></div> </div> </a> </li> <?php } ?> </ul> </div> <div class="upgradeMember"> <ul> <?php foreach ((array) $textInfo_ as $k_ => $v_) { ?> <li><span><?php echo MooCutstr(str_replace('您的', '', $v_['content']), 40, ''); ?> </span></li> <?php } ?> </ul> </div> </div> <div class="search"> <form id="search" name="search" method="get" action="index.php" onSubmit="return checkSearchForm();"> <input type="hidden" name="n" value="search"> <input type="hidden" name="h" value="quick"> <input name="search_type" type="hidden" value="1"> <span class="isearch">我要找:</span> <select name="gender">
function getcontactme() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr; $pagesize = 4; //note 获得当前url $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl2 = preg_replace("/(&page2=\\d+)/", "", $currenturl2); $currenturl2 = preg_replace("/(&page3=\\d+)/", "", $currenturl2); //note ---------------------等待回应的请求 //note 获得第几页 $page = empty($_GET['page']) ? 1 : $_GET['page']; //note limit查询开始位置 $start = ($page - 1) * $pagesize; $ret = $_MooClass['MooMySQL']->getAll("SELECT stat,count(*) as c FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' and receive_del=0 and send_del=0 group by stat"); $total = 0; $total2 = 0; $total3 = 0; foreach ($ret as $v) { switch ($v['stat']) { case 1: $total = $v['c']; break; case 2: $total2 = $v['c']; break; case 3: $total3 = $v['c']; break; } } //note 查询等待回应的请求 if ($total) { $results = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 1 and receive_del=0 and send_del=0 order by sendtime desc LIMIT {$start},{$pagesize}"); foreach ($results as $k => $v) { $send_user1 = array(); $send_user2 = array(); $contact = array(); $send_user1 = leer_send_user1($v['other_contact_you']); $send_user2 = leer_send_user2($v['other_contact_you']); $contact['l'] = $v; $contact['s'] = $send_user1; $contact['t'] = $send_user2; $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容'; $contacts[$k] = $contact; } } $page2 = empty($_GET['page2']) ? 1 : $_GET['page2']; $start2 = ($page2 - 1) * $pagesize; if ($total2) { $results2 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 2 and receive_del=0 and send_del=0 order by sendtime desc LIMIT {$start2},{$pagesize}"); foreach ($results2 as $k => $v) { $send_user1 = array(); $send_user2 = array(); $contact = array(); $send_user1 = leer_send_user1($v['other_contact_you']); $send_user2 = leer_send_user2($v['other_contact_you']); $contact['l'] = $v; $contact['s'] = $send_user1; $contact['t'] = $send_user2; $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容'; $contacts2[$k] = $contact; } } $page3 = empty($_GET['page3']) ? 1 : $_GET['page3']; $start3 = ($page3 - 1) * $pagesize; if ($total3) { $results3 = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}service_contact WHERE you_contact_other = '{$userid}' AND stat = 3 and receive_del=0 and send_del=0 order by sendtime desc LIMIT {$start3},{$pagesize}"); foreach ($results3 as $k => $v) { $send_user1 = array(); $send_user2 = array(); $contact = array(); $send_user1 = leer_send_user1($v['other_contact_you']); $send_user2 = leer_send_user2($v['other_contact_you']); $contact['l'] = $v; $contact['s'] = $send_user1; $contact['t'] = $send_user2; $contact['t']['introduce'] = trim($contact['t']['introduce']) ? MooCutstr($contact['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容'; $contacts3[$k] = $contact; } } require MooTemplate('public/service_contact_getcontactme', 'module'); }
?> 女士<?php } else { ?> 男士<?php } ?> </dd> <dd> <p class="c999"> <?php echo isset($seach['introduce']) && $seach['introduce'] ? Moorestr(MooCutstr($seach['introduce'], 120, $dot = ' ...')) : '无内心独白内容'; ?> </p> </dd> <dd class="modalContainer"> <a class="modalLink bt5" data-uid="<?php echo $users['uid']; ?> " href="#modalLeer">送秋波</a> <a class="modalLink bt55" data-uid="<?php echo $users['uid']; ?> " href="#modalLiker">加关注</a> <a class="modalLink bt555" data-uid="<?php echo $users['uid']; ?>
</dl> </li> <li class="fright"> <dl class="r-service-heart"> <dt>内心独白</dt> <dd class="r-service-heart-text"> <?php if ($send_user1['uid'] < 1599400) { ?> <?php echo $send_user2['introduce'] ? MooStrReplace(MooCutstr($send_user2['introduce'], 148, $dot = ' ...')) : '无内心独白内容'; ?> <?php } else { ?> <?php echo $send_user2['introduce'] ? MooCutstr($send_user2['introduce'], 148, $dot = ' ...') : '无内心独白内容'; ?> <?php } ?> </dd> </dl> </li> </ul> <?php } ?> <div class="clear"></div> <div class="pages"><span class="fleft" style="padding-left:40px;"><input name="checkall" type="checkbox" value="" /> 全选<input name="" type="submit" class="my-e-button" value="删除信息" /></span>
',city)</script><?php } ?> </dd> <!-- <dd class="f-ed0a91"><<?php echo activetime($visitor['s']['lastvisit'], $visitor['s']['usertype']); ?> ></dd> --> </dl> </li> <li class="fright"> <dl class="r-service-heart"> <dt>内心独白</dt> <dd class="r-service-heart-text"> <?php echo $visitor['t']['introduce'] ? MooCutstr($visitor['t']['introduce'], 148, $dot = ' ...') : '无内心独白内容'; ?> </dd> <dd> <p>浏览时间:<span class="f-ed0a91"><?php echo date("Y年m月d日 ", $visitors['visitortime']); ?> </span></p></dd> </dl> </li> </ul> <?php } ?> <div class="clear"></div> <div class="pages"><span class="fleft" style="padding-left:40px;"><input type="checkbox" name="allcheck" onclick="checkAll(this)" /> 全选 <input name="" type="submit" class="btn btn-default" value="删除信息" /><input type="hidden" name="delvisitor" value="删除"></span><?php
/** * 输出所有备注,后台右下角提醒 * @author:fanglin * 可对组,所有客服,某个id客服提醒 */ function ajax_remark() { $result = ''; $sid = MooGetGPC('sid', 'integer', 'G'); $type = MooGetGPC('type', 'string', 'G'); $time = time(); $myservice_idlist = get_myservice_idlist(); if ($type == 'timeover') { //最近备注 if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t`status`='0' AND `awoketime`>='{$time}' AND (`sid`='{$GLOBALS['adminid']}') ORDER BY `awoketime` ASC limit 30"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } elseif ($myservice_idlist == 'all') { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t`status`='0' AND `awoketime`>='{$time}' AND (`sid`='{$GLOBALS['adminid']}') ORDER BY `awoketime` ASC limit 30"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } else { if (!in_array($GLOBALS['groupid'], $GLOBALS['admin_userinfo_check']) && !in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team'])) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t`status`='0' AND `awoketime`>='{$time}' AND (`sid` in ({$myservice_idlist})) ORDER BY `awoketime` ASC limit 30"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } else { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t`status`='0' AND `awoketime`>='{$time}' AND (`sid`='{$GLOBALS['adminid']}') ORDER BY `awoketime` ASC limit 30"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } } $remark = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); } elseif ($type == 'notime') { //备注 if (empty($myservice_idlist)) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE \n\t\t\t\t `status`='0' AND `awoketime`='' AND flag>0 and (`sid`='{$GLOBALS['adminid']}') ORDER BY id desc limit 10"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } elseif ($myservice_idlist == 'all') { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE \n\t\t\t\t `status`='0' AND `awoketime`='' AND flag>0 and (`sid`='{$GLOBALS['adminid']}') \tORDER BY id desc limit 10"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } else { if (!in_array($GLOBALS['groupid'], $GLOBALS['admin_userinfo_check']) && !in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team'])) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE \n\t\t\t\t`status`='0' AND `awoketime`='' AND flag>0 and (`sid` in ({$myservice_idlist})) ORDER BY id desc limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } else { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE \n\t\t\t\t `status`='0' AND `awoketime`='' AND flag>0 and (`sid`='{$GLOBALS['adminid']}') ORDER BY id desc limit 10"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1') } } $remark = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); } elseif ($type == 'all') { //所有备注 $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE \n\t\t\t\t(`sid`='{$GLOBALS['adminid']}') AND status=0 ORDER BY id desc limit 50"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' $remark = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); } $six_minute = time() - 300; $sql = "select s_fromid from {$GLOBALS['dbTablePre']}service_chat where s_uid='{$GLOBALS['adminid']}' and s_status=0 and s_time>'{$six_minute}' GROUP BY s_fromid"; $chatmsg = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); //=============回电总数单独统计==================== if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t\t(`sid`='{$GLOBALS['adminid']}') AND `status`='0' AND `awoketime`>='{$time}' limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' ORDER BY `awoketime` ASC"; } elseif ($myservice_idlist == 'all') { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE (`sid`='{$GLOBALS['adminid']}') AND `status`='0' AND `awoketime`>='{$time}' limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' ORDER BY `awoketime` ASC"; } else { if (!in_array($GLOBALS['groupid'], $GLOBALS['admin_userinfo_check']) && !in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team'])) { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t\t`status`='0' AND `awoketime`>='{$time}' and (`sid` in ({$myservice_idlist})) limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' ORDER BY `awoketime` ASC"; } else { $sql = "SELECT id,sid,groupid,title,content,status,awoketime,dateline,dealstate,send_id,flag FROM {$GLOBALS['dbTablePre']}admin_remark WHERE\n\t\t\t\t\t(`sid`='{$GLOBALS['adminid']}') AND `status`='0' AND `awoketime`>='{$time}' limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } } $remark_timeover = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) { $sql = "SELECT id FROM {$GLOBALS['dbTablePre']}admin_remark WHERE (`sid`='{$GLOBALS['adminid']}') and flag>0 AND `status`='0' AND `awoketime`='' \tORDER BY id desc limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } elseif ($myservice_idlist == 'all') { $sql = "SELECT id FROM {$GLOBALS['dbTablePre']}admin_remark WHERE (`sid`='{$GLOBALS['adminid']}') and flag>0 AND `status`='0' AND `awoketime`='' ORDER BY id desc limit 10"; //OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } else { if (!in_array($GLOBALS['groupid'], $GLOBALS['admin_userinfo_check']) && !in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team'])) { $sql = "SELECT id FROM {$GLOBALS['dbTablePre']}admin_remark WHERE `status`='0' AND `awoketime`='' and flag>0 AND \n\t\t\t\t(`sid` in ({$myservice_idlist})) ORDER BY id desc limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } else { $sql = "SELECT id FROM {$GLOBALS['dbTablePre']}admin_remark WHERE (`sid`='{$GLOBALS['adminid']}') and flag>0 AND `status`='0' AND `awoketime`='' \tORDER BY id desc limit 10"; // OR groupid='{$GLOBALS['groupid']}' OR groupid='-1' } } $remark_notime = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql, 0, 0, 0, true); if (count($remark_timeover) == 0 && empty($chatmsg) && count($remark_notime) == 0) { echo 0; exit; } if (!empty($chatmsg)) { $result .= "<ul class=\"bgon\">"; foreach ($chatmsg as $msg) { $result .= "<li><a href='index.php?n=chat&chatorid=" . $msg['s_fromid'] . "' target='_brank' onclick=\"javascript:\$(this).empty()\">客服ID:" . $msg['s_fromid'] . "发给你在线消息</a></li>"; } $result .= "</ul>"; } if (empty($remark)) { $result .= "<p>您有<a href='#'>0条备注</a></p>"; } else { $result .= "<ul class=\"remark\">"; foreach ($remark as $key => $arr) { if ($arr['status'] == 0) { $result .= "<li class=\"title state-{$arr['id']}\" onclick=\"showcontent(" . $key . ");\"><a href=\"javascript:deal(" . $arr['id'] . ")\" id=\"state-" . $arr['id'] . "\" style=\"float:right;\">未解决</a>"; } else { $result .= "<li class=\"title\" onclick=\"showcontent(" . $key . ");\"><a href=\"javascript:aworke()\" style=\"float:right;\">已解决</a>"; } if ($arr['title'] == '会员付款') { $result .= $key + 1 . ".<span style='color:#ff0000;font-weight:bold;'>" . $arr['sid'] . ":" . MooCutstr($arr['title'], 20, "…") . "</span></li>"; } else { $result .= $key + 1 . "." . $arr['sid'] . ":" . MooCutstr($arr['title'], 20, "…") . "</li>"; } $result .= "<li class=\"content state-{$arr['id']}\" id=\"content-" . $key . "\">" . $arr['content'] . "</li>"; } $result .= "</ul>"; } /*if($type!='notime'){ $count=count($remark); }elseif($type=='notime'){ $count=0; }*/ $result .= "|最近备注(" . count($remark_timeover) . ")"; $result .= "|备注回电(" . count($remark_notime) . ")"; /*if ($type=='timeover'){ $result .= "|最近备注(".count($remark).")"; }elseif ($type=='notime'){ $result .= "|备注回电(".count($remark).")"; }*/ echo $result; exit; }
function recommendMember() { global $_MooClass, $dbTablePre, $timestamp, $memcached, $_MooCookie; $gender = !MooGetGPC('gender', 'integer', 'G') ? 0 : 1; //note 性别 include_once "./module/crontab/crontab_config.php"; $cur_ip = GetIP(); // $cur_ip = "202.120.2.200";//上海ip // $cur_ip = "218.202.206.102";//新疆ip //$cur_ip = "218.70.178.197"; //重庆 // $cur_ip="221.130.166.242"; MooPlugins('ipdata'); $ip_arr = convertIp($cur_ip); //得到省份对应的数值,查库 $province = $city = ""; foreach ($provice_list as $key => $val) { if (strstr($ip_arr, $val)) { $province = $key; $currentdistrict = $val; break; } } if (isset($_GET['province'])) { foreach ($provice_list as $key => $val) { if ($_GET['province'] == $key) { $currentdistrict = $val; break; } } } //得到市对应的城市代号 foreach ($city_list as $city_key => $city_val) { if (strstr($ip_arr, $city_val)) { $city = $city_key; break; } } if (isset($_GET['province'])) { $province = MooGetGPC('province', 'integer', 'G'); //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cachefile_list = $_MooClass['MooMySQL']->getAll($sql); foreach ($cachefile_list as $cachefile) { $cachefile['provincestarfile'] = rtrim($cachefile['provincestarfile'], '.data'); if ($memcached->get($cachefile['provincestarfile'])) { $memcached->delete($cachefile['provincestarfile']); } $cachefile['citystarfile'] = rtrim($cachefile['citystarfile'], '.data'); if ($memcached->get($cachefile['citystarfile'])) { $memcached->delete($cachefile['citystarfile']); } $cachefile['provinceotherfile'] = rtrim($cachefile['provinceotherfile'], '.data'); if ($memcached->get($cachefile['provinceotherfile'])) { $memcached->delete($cachefile['provinceotherfile']); } } } $userList = array(); //查市城市之星 //note 修正广东省深圳和广州的区域查询 if (in_array($province, array(10101201, 10101002))) { $city = $province; $province = 10101000; } $sql_city = "s.city='{$city}'"; //修正直辖市查询 if (in_array($province, array('10102000', '10103000', '10104000', '10105000'))) { $city = '0'; } if ($city == 0) { $sql_city = "s.province='{$province}'"; } if (!empty($city) || !empty($province)) { //默认没有进入 选择省后进入 $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce i on s.uid=i.uid WHERE s.images_ischeck=1 and s.s_cid='20' and s.gender='{$gender}' and ({$sql_city} AND s.is_lock=1 AND s.nickname!='' AND i.introduce!='' AND s.showinformation=1 AND s.city_star>=1 AND s.usertype=1) order by s.s_cid limit 6"; //$userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$city}_citystar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); // $userList = $GLOBALS['_MooBlock']["userlist_{$city}_citystar"]; //市缓存文件 //$city_cachefile = "userlist_{$city}_citystar".'_'.md5($param).'.data'; } //市无城市之星,从省取城市之星 if (empty($userList)) { $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.province='{$province}'\n\t\t\t AND s.is_lock=1 and s.gender='{$gender}' \n\t\t\t AND s.images_ischeck = 1 AND s.showinformation=1 \n\t\t\t and s.city_star>=1 and s.usertype=1 and i.introduce!='' ans s.nickname!='' LIMIT 6"; // $userList = $_MooClass['MooMySQL']->getAll($sql); $param = "type=query/name=userlist_{$province}_provincestar/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); $userList = $GLOBALS['_MooBlock']["userlist_{$province}_provincestar"]; //省缓存文件 //$province_cachefile = "userlist_{$province}_provincestar".'_'.md5($param).'.data'; } //城市之星不够取钻石会员(市->省->全国) $count = count($userList); if ($count < 6) { //默认进入 $addarr = array('cityadd', 'provinceadd', 'countryadd'); $user_in = '1747188|2154375|1600591|2159633|20782701|20785837|20561126|20305660|20910184'; //城市之星uid $user_list = array(); if (!is_array($userList)) { $userList = array(); } //enky add foreach ($userList as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode('|', $user_list); } //从(市->省->全国)取钻石会员 $cityadd = array(); $provinceadd = array(); $countryadd = array(); foreach ($addarr as $add) { if ($count < 6) { $id = ''; //从市取 if ($add == 'cityadd') { if (!$city || $city == 0) { continue; } $sql_add = "s.city='{$city}' and"; $id .= $city; } //从省取 if ($add == 'provinceadd') { if (!$province || $province == 0) { continue; } $sql_add = "s.province='{$province}' and"; $id .= $province; } //全国取 if ($add == 'countryadd') { $sql_add = ''; $id .= 'country'; } //取几个钻石会员 $add_query_sum = 6 - $count; //enky need change $cl = searchApi('members_women members_man'); $cond[] = array('is_lock', '1', false); $cond[] = array('images_ischeck', '1', false); $cond[] = array('gender', $gender, false); $cond[] = array('usertype', '1', false); //$cond[] = array('@id','20752315|'.$user_in,true);//uid $cond[] = array('s_cid', '20', false); $cond[] = array('city_star', '0', false); $cond[] = array('showinformation', '1', false); $cond[] = array('pic_num', array(1, 20), false); if ($province) { array('province', $province, false); } if ($city) { array('city', $city, false); } $limit = array($add_query_sum); $res_matches = $cl->getResult($cond, $limit); if ($res_matches) { $count_res = count($res_matches); $array_merge = array(); for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i])) { $ids[] = $res_matches['matches'][$i]['id']; } } $sql_str = implode(',', $ids); $nickname_res = $_MooClass['MooMySQL']->getAll("select nickname,uid from web_members_search where uid in " . "({$sql_str})"); $mainimg_res = $_MooClass['MooMySQL']->getAll("select mainimg from web_members_base where uid in " . "({$sql_str})"); $introduce_res = $_MooClass['MooMySQL']->getAll("select introduce from web_members_introduce where uid in " . "({$sql_str})"); //合并到sphinx查询出的整理后的数组 for ($i = 0; $i < $count_res; $i++) { if (!empty($res_matches['matches'][$i]['attrs'])) { $res_matches['matches'][$i]['attrs']['nickname'] = $nickname_res[$i]['nickname']; $res_matches['matches'][$i]['attrs']['uid'] = $nickname_res[$i]['uid']; $res_matches['matches'][$i]['attrs']['mainimg'] = $mainimg_res[$i]['mainimg']; $res_matches['matches'][$i]['attrs']['introduce'] = $introduce_res[$i]['introduce']; $bigarr[] = $res_matches['matches'][$i]['attrs']; } } ${$add} = $bigarr; } else { $sql = "select s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid where s.uid not in({$user_in})\n\t\t\t\t\t\t\t\t AND {$sql_add} s.city_star=0 AND s.s_cid = 20 and s.gender=" . $gender . " \n\t\t\t\t\t\t\t\t AND s.images_ischeck = 1 AND s.is_lock = 1 AND s.showinformation = 1\n\t\t\t\t\t\t\t\t AND s.pic_num >=1 AND s.usertype=1 AND i.introduce!='' AND s.nickname!='' LIMIT {$add_query_sum}"; $param = "type=query/name=userlist_{$id}_other/sql={$sql}/cachetime=86400"; $_MooClass['MooCache']->getBlock($param); ${$add} = $GLOBALS['_MooBlock']["userlist_{$id}_other"]; } //已获取的首页会员uid $user_list = array(); if (!is_array(${$add})) { ${$add} = array(); } //enky add foreach (${$add} as $user) { $user_list[] = $user['uid']; } if (!empty($user_list)) { $user_in .= ',' . implode(',', $user_list); } //echo $user_in;exit; //已有总数 $count += count(${$add}); } } //$countryadd have data $userList = array_merge($userList, $cityadd, $provinceadd, $countryadd); //省其它类型会员缓存文件 //$province_othercachefile = "userlist_{$id}_other".'_'.md5($param).'.data'; } //生成的block缓存文件存库 /* $city = $city ? $city : 0; $sql = "SELECT * FROM {$dbTablePre}index_cachefile WHERE province='{$province}' AND city='{$city}'"; $cache_arr = $_MooClass['MooMySQL']->getAll($sql); if(empty($cache_arr)){ $province_cachefile = isset($province_cachefile)?$province_cachefile:''; $sql = "INSERT INTO {$dbTablePre}index_cachefile SET province='{$province}',city='{$city}',provincestarfile='{$province_cachefile}',citystarfile='{$city_cachefile}',provinceotherfile='{$province_othercachefile}'"; $_MooClass['MooMySQL']->query($sql); } */ //推荐列表中如果存在,则以推荐列表中的指定的sort替换 $sql = "SELECT * FROM {$dbTablePre}members_recommend WHERE province='{$province}' AND city='{$city}' order by sort asc"; $recommend_list = $_MooClass['MooMySQL']->getAll($sql); if (!empty($recommend_list)) { foreach ($recommend_list as $list) { $sort = $list['sort'] < 1 ? 0 : $list['sort'] - 1; if (MOOPHP_ALLOW_FASTDB) { $u = MooFastdbGet('members_search', 'uid', $list['uid']); $u2 = MooFastdbGet('members_base', 'uid', $list['uid']); if (is_array($u) && is_array($u2)) { $u = array_merge($u, $u2); } } else { $sql = "SELECT s.uid,s.nickname,s.gender,s.images_ischeck,s.province,s.city,s.birthyear,s.s_cid,s.city_star,b.mainimg,i.introduce FROM {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}members_introduce as i on s.uid=i.uid WHERE s.uid='{$list['uid']}'"; $u = $_MooClass['MooMySQL']->getOne($sql); } if ($u) { foreach ($userList as $key => $val) { if ($list['uid'] == $val['uid']) { $user_key = $key; break; } } if (isset($user_key)) { if (isset($userList[$sort])) { $userList[$key] = $userList[$sort]; } $userList[$sort] = $u; } else { $userList[$sort] = $u; } } } } //删除数组中多余的部分 array_splice($userList, 6); $result = array(); $imgSrcSmall = $imgSrcMid = $imgSrcUrl = ''; foreach ($userList as $v) { $introduce = ''; if (isset($v['introduce'])) { $introduce = MooCutstr($v['introduce'], 50, '...'); } $imgSrcSmall = MooGetphoto($v['uid'], 'small'); $imgSrcMid = MooGetphoto($v['uid'], 'mid'); if ($imgSrcSmall) { $imgSrc = $imgSrcMid; } elseif ($v['gender'] == '1') { $imgSrc = "module/index/templates/default/images/se_woman.gif"; } else { $imgSrc = "module/index/templates/default/images/se_man.gif"; } if (isset($v['mainimg']) && !empty($v['mainimg']) && isset($v['images_ischeck']) && $v['images_ischeck'] == 1) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src={$imgSrc} width=\"120\"/> </a>"; } else { if (isset($v['gender']) && $v['gender']) { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_woman.gif\" /> </a> "; } else { $imgUrl = "<a href=\"index.php?n=space&uid={$v['uid']}\" target=\"_blank\"><img src=\"module/index/templates/default/images/se_man.gif\" /></a> "; } } if ($v['birthyear']) { $birthyear = date('Y') - $v['birthyear'] . '岁'; } else { $birthyear = '年龄保密'; } $result[] = array("uid" => $v['uid'], "mainimg" => $v['mainimg'], "images_ischeck" => $v['images_ischeck'], "gender" => $v['gender'], "introduce" => $introduce, "imgUrl" => $imgUrl, "nickname" => $v['nickname'], "birthyear" => $birthyear, "province" => $v['province'], "city" => $v['city']); } echo json_encode($result); }
function material_upinfo_submit() { global $_MooClass, $dbTablePre, $userid, $user_arr; checkAuthMod('index.php?n=material'); //客服模拟登录操作没有修改权限 $validation = MooAutoLoad('MooValidation'); $uid = $userid; $user_rank_id = get_userrank($userid); //var_dump($user_rank_id); //$update1_arr = $update2_arr = $update3_arr = array(); //note members表字段 $members_search = array(); $members_base = array(); $members_choice = array(); $members_introduce = array(); $birthyear = MooGetGPC('year', 'string', 'P'); $members_search['birthyear'] = $birthyear; $birthmonth = MooGetGPC('month', 'string', 'P'); $birthday = MooGetGPC('days', 'string', 'P'); $members_search['updatetime'] = time(); $members_search['nickname'] = safeFilter(MoogetGPC('nickname', 'string', 'P')); $members_search['telphone'] = MoogetGPC('telphone', 'string', 'P'); $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P'); $members_search['height'] = MoogetGPC('height', 'integer', 'P'); $members_search['salary'] = MoogetGPC('salary', 'integer', 'P'); $members_search['education'] = MoogetGPC('education1', 'integer', 'P'); $members_search['children'] = MoogetGPC('children1', 'integer', 'P'); $members_search['house'] = MoogetGPC('house', 'integer', 'P'); $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P'); $members_search['province'] = MoogetGPC('province', 'integer', 'P'); $members_search['city'] = MoogetGPC('city', 'integer', 'P'); if (in_array($members_search['province'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_search['city'] = $members_search['province']; $members_search['province'] = 10101000; } //note choice表字段 $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true); if ($gender['gender'] == 0) { $members_choice['gender'] = 1; } else { $members_choice['gender'] = 0; } //$update2_arr['sex'] = MoogetGpc('sex','integer','p'); $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P'); $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P'); $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P'); $members_choice['workcity'] = MoogetGPC('workCity', 'integer', 'P'); if (in_array($members_choice['workprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['workcity'] = $members_choice['workprovince']; $members_choice['workprovince'] = 10101000; } $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P'); $members_choice['education'] = MoogetGPC('education2', 'integer', 'P'); $members_choice['children'] = MoogetGPC('children2', 'integer', 'P'); $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P'); $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P'); $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P'); $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P'); $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P'); $members_choice['body'] = MoogetGPC('body2', 'integer', 'P'); $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P'); $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P'); $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P'); $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P'); $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P'); $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P'); if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['hometowncity'] = $members_choice['hometownProvince']; $members_choice['hometownprovince'] = 10101000; } $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P'); $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P'); $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P'); $members_introduce['introduce_check'] = safeFilter(trim(MoogetGPC('introduce', 'string', 'P'))); $rs = $user_arr; //note 验证状态 if (MOOPHP_ALLOW_FASTDB) { $sta = MooFastdbGet('certification', 'uid', $uid); } else { $sta = $_MooClass['MooMySQL']->getOne("select telphone from {$dbTablePre}certification WHERE uid='{$uid}'", true); } $where_arr = array('uid' => $uid); foreach ($members_search as $key => $val) { //无手机号吗 if ($key == 'telphone' && $val == '') { continue; } $memberssearch[$key] = $val; } // foreach ($members_base as $key=>$val){ // $membersbase[$key]=$val; // } if (count($members_base) >= 1 || count($memberssearch) >= 1) { $members_search['updatetime'] = time(); if (!rtrim($members_search['nickname'])) { MooMessage('昵称必填', 'javascript:history.go(-1)'); } if (preg_match('/^(1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*)$/', $members_search['nickname'])) { MooMessage("昵称不符合规范!", "javascript:history.go(-1)"); } //echo 'sss';exit; str_length($members_search['nickname']); //note 昵称截取 $members_search['nickname'] = MooCutstr($members_search['nickname'], 18, $dot = ''); if ($members_search['telphone'] && !preg_match('/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/', $members_search['telphone'])) { MooMessage('请输入正确的手机号码', 'javascript:history.go(-1)'); } //$birth=strtotime("$birthyear/$birthmonth/$birthday"); $birth = "{$birthyear}-{$birthmonth}-{$birthday}"; $members_base['birth'] = $birth; updatetable('members_base', $members_base, $where_arr); updatetable('members_search', $memberssearch, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $members_base); MooFastdbUpdate('members_search', 'uid', $uid, $memberssearch); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_search)); } //提交会员动态makui UpdateMembersSNS($uid, '修改了资料'); //内心独白必填 //if(rtrim($update2_arr['introduce_check'] != '')){ $members_introduce['introduce'] = ''; $members_introduce['introduce_pass'] = '******'; //if(isset($members_choice)){ $members_choice['updatetime'] = time(); updatetable('members_choice', $members_choice, $where_arr); //} updatetable('members_introduce', $members_introduce, $where_arr); if (MOOPHP_ALLOW_FASTDB) { $members_choice['uid'] = $uid; $members_introduce['uid'] = $uid; //print_r($update2_arr);exit; if (isset($members_choice)) { $members_choice['updatetime'] = time(); MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice); } MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_choice)); if (MOOPHP_ALLOW_FASTDB) { $userchoice = MooFastdbGet('members_choice', 'uid', $uid); $introduce = MooFastdbGet('members_introduce', 'uid', $uid); $userchoice = array_merge($userchoice, $introduce); } else { $userchoice = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_choice mc left join {$dbTablePre}members_introduce mi WHERE mc.uid=mi.uid AND uid = '{$uid}'", true); } //}else{ // MooMessage("内心独白必填!", "index.php?n=material&h=upinfo"); //} /* //低质量会员自动分配 if($user_rank_id == 0){ //以下信息都没选,都规为垃圾会员,自动分配给普通客服 if($update1_arr['height']=='-1' || $update1_arr['salary']=='-1' || $update1_arr['children']=='-1' || $update1_arr['oldsex']=='-1' || $update2_arr['age1']=='-1' || $update2_arr['age2']=='-1' || $update2_arr['marriage'] == '-1' || $update2_arr['children'] == '-1' || $update2_arr['body'] == '-1'){ invalid_user_allotserver($uid); } } */ $actio = MoogetGPC('actio', 'integer', 'R'); switch ($actio) { case 1: if ($rs['telphone'] == $members_search['telphone'] || $sta['telphone'] == '' || $members_search['telphone'] == '') { header("location:index.php?n=material&h=upinfo&actio=1"); } else { //重新手机认证 $sql = "update {$dbTablePre}certification set telphone='' where uid='{$uid}'"; $_MooClass['MooMySQL']->query($sql); $certif_arr['telphone'] = ''; MooFastdbUpdate('certification', 'uid', $uid, $certif_arr); if (MOOPHP_ALLOW_FASTDB) { if (MOOPHP_ALLOW_FASTDB) { $certification_1 = MooFastdbGet('certification', 'uid', $userid); } else { $certification_1 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid = '{$userid}'", true); } } MooMessage("您的手机信息有变动请再次通过我们的验证", 'index.php?n=myaccount&h=telphone'); } break; default: header("location:index.php?n=material&h=upinfo"); break; } //note 快速常用搜索表更新 //fastsearch_update($userid,'1'); //note 快速高级搜索表更新 //fastsearch_update($userid,'2'); }
function register_steptwo() { global $_MooClass, $dbTablePre, $uid, $user_arr, $_MooCookie; $userinfo = $user_arr; $password = isset($_MooCookie['password2']) ? $_MooCookie['password2'] : ''; MooSetCookie('password2', ''); $userchoice = MooGetData('members_choice', 'uid', $uid); $telphonecheck = MooGetGPC('telphonecheck', 'string'); if (MooSubmit('register_submittwo')) { // note members表字段 $members_search['nickname'] = safeFilter(rtrim(MoogetGPC('nickname', 'string', 'P'))); $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P'); // update1_arr $members_search['height'] = MoogetGPC('height', 'integer', 'P'); $members_search['salary'] = MoogetGPC('salary', 'integer', 'P'); $members_search['education'] = MoogetGPC('education1', 'integer', 'P'); $members_search['children'] = MoogetGPC('children1', 'integer', 'P'); $members_search['house'] = MoogetGPC('house', 'integer', 'P'); $members_search['updatetime'] = time(); $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P'); $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true); if ($gender['gender'] == 0) { $members_choice['gender'] = 1; } else { $members_choice['gender'] = 0; } $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P'); // $update2_arr $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P'); $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P'); $members_choice['workCity'] = MoogetGPC('workCity', 'integer', 'P'); if (in_array($members_choice['workprovince'], array(10101201, 10101002))) { $members_choice['workcity'] = $members_choice['workprovince']; $members_choice['workprovince'] = 10101000; } $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P'); $members_choice['education'] = MoogetGPC('education2', 'integer', 'P'); $members_choice['children'] = MoogetGPC('children2', 'integer', 'P'); $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P'); $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P'); $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P'); $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P'); $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P'); $members_choice['body'] = MoogetGPC('body2', 'integer', 'P'); $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P'); $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P'); $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P'); $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P'); $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P'); $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P'); $members_choice['updatetime'] = time(); if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) { $members_choice['hometowncity'] = $members_choice['hometownprovince']; $members_choice['hometownprovince'] = 10101000; } $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P'); $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P'); $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P'); // *********内心独白处理**********// $members_introduce['introduce'] = MoogetGPC('introduce', 'string', 'P'); // $update2_arr $members_introduce['introduce_check'] = safeFilter(rtrim(MoogetGPC('introduce', 'string', 'P'))); $telcheck = MoogetGPC('telcheck', 'string'); $truetelphone = MoogetGPC('truetelphone', 'string'); $telphonemack = md5(md5(MoogetGPC('telphonemack', 'string', 'P'))); $web_rand = $_MooCookie['rand']; // wxmtest******************************************** // SQL条件 $where_arr = array('uid' => $uid); if ($members_search || $members_choice) { // 会员基本信息 //if ($members_search) { // 判断昵称 if (rtrim($members_search['nickname']) != '') { if (preg_match('/^((1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*))$/', $members_search['nickname'])) { MooMessage("昵称不符合规范!", "index.php?n=register&h=steptwo"); } // note 昵称截取 $members_search['nickname'] = MooCutstr($members_search['nickname'], 12, $dot = ''); // 更新数据 updatetable('members_search', $members_search, $where_arr); updatetable('members_base', $members_base, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_search', 'uid', $uid, $members_search); MooFastdbUpdate('members_base', 'uid', $uid, $members_base); } // searchApi("members_man // members_women")->updateAttr(array('nickname','marriage','height','salary','education','children','house'),array(9888888888=>$search)); } else { MooMessage("昵称必填!", "index.php?n=register&h=steptwo"); } //} if ($members_choice) { updatetable('members_choice', $members_choice, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice); } } if ($members_introduce) { // 内心独白必填 // if($update2_arr['introduce_check'] != ''){ $members_introduce['introduce'] = ''; $members_introduce['introduce_pass'] = '******'; updatetable('members_introduce', $members_introduce, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce); } // }else{ // MooMessage("内心独白必填!", "index.php?n=register&h=steptwo"); // } } MooMessage("进入下一步!", "index.php?n=register&h=stepthree"); } } include MooTemplate('public/register_steptwo', 'module'); }
<td class="desc">用户名:</td> <td class="desc2"><span <?php if ($member['usertype'] == 3 && $GLOBALS['adminid'] != 1) { ?> title="您无权查看此条信息"<?php } else { ?> title="<?php echo $member['username']; ?> "<?php } ?> ><?php if ($member['usertype'] != 3) { echo MooCutstr($member['username'], 16); } else { if ($GLOBALS['adminid'] != 1) { ?> ******<?php } } ?> </span></td> <td> <a href="#" onclick="show_search(event,'<?php echo $member['username']; ?> ');"><img src="templates/images/sou-btn.gif" ></a> </td> </tr>
<div class="clear"></div> </div> <h3><?php echo MooCutstr($love_storys['title'], 36, "……"); ?> </h3> <dl class="story-text"> <dt> <font class="f-ed0a91"><?php echo $love_storys['name1']; ?> </font> 与<font class="f-ed0a91"><?php echo $love_storys['name2']; ?> </font> 的爱情故事</dt> <dd><?php echo MooCutstr($love_storys['content'], 200, "……"); ?> </dd> <dd><a href="index.php?n=story&h=content&sid=<?php echo $love_storys['sid']; ?> ">[查看详情]</a></dd> </dl> <div class="clear"></div> </div> <?php } ?> <div class="pages">
<div class="top"> <!-- <span style="position:absolute;left:185px;top:20px;background:url('public/default/images/nationalday.png') no-repeat;width:50px;height:50px;"></span> --> <a href="index.php" class="logo" title="真爱一生网www.zhenaiyisheng.cc"></a> <span class="top-tel"></span> <?php if ($GLOBALS['MooUid']) { ?> <div class="top-title">欢迎您 <span class="f-ed0a91"><?php echo MooCutstr($GLOBALS["user_arr"]['nickname'], 8, ''); ?> </span> 您的ID是 <span class="f-ed0a91"><?php echo $GLOBALS["user_arr"]['uid']; ?> </span> <a href="index.php?n=service&h=message" class="f-000">最新邮件</a>(<span class="f-ed0a91"><?php echo $message_total = header_show_total($GLOBALS["user_arr"]['uid']); ?> </span>) <a href="index.php?n=material&h=password" class="f-000">修改密码</a> <a href="./index.php?n=index&h=logout" class="f-000">安全退出</a></div> <?php } else { ?> <div class="top-title">您好,欢迎来到真爱一生网![<a href="login.html" class="f-024890">请登录</a>] [<a href="register.html" class="f-024890">免费注册</a>]</div> <?php } ?> <?php if (MooGetGPC('h', 'string', 'G') != 'channel' && MooGetGPC('n', 'string', 'G') != 'payment') { ?>
</ul> <input type="text" name="search_uid" id="search_uid" class="reg-info-text" style="display:none"/> <input type="hidden" name="n" value="search" /> <input type="hidden" name="h" value="quick" /> <input type="hidden" name="quick_search" value="search" id="quick_search" /> <input type="submit" id="quick_search" name="" class="search-btn" value="" style="width:106px;" /> </form> </div> --> <div class="content"> <div class="c-right"> <div class="c-rightbox"> <div class="right-title"><span class="r-title"><?php if ($uid != $userid) { echo $user['nickname'] ? MooCutstr($user['nickname'], 12, '') : 'ID:' . $user['uid']; } else { ?> 我<?php } ?> 的征婚资料</span></div> <div class="pInfo"> <div class="myself"> <p style="width:110px;height:138px;overflow:hidden;padding-top:5px;margin-left:8px;"> <?php if ($user['images_ischeck'] == '1' && $user['mainimg']) { ?> <img id="show_pic_1" class="fixphoto_" src="<?php if (MooGetphoto($user['uid'], 'mid')) { echo IMG_SITE . MooGetphoto($user['uid'], 'mid');
?> <?php } ?> <?php if (isset($users['nickname']) && $users['nickname'] != '') { ?> <?php echo MooCutstr($users['nickname'], '7', ''); ?> <?php } else { ?> ID:<?php echo MooCutstr($users['uid'], '6', ''); ?> <?php } ?> </span> <?php if (isset($users['birthyear']) && $users['birthyear']) { echo date('Y', time()) - $users['birthyear']; ?> 岁<?php } else { ?> 年龄保密<?php } ?>