function getone() { global $_MooClass, $dbTablePre, $userid, $memcached; $sendid = MooGetGPC('sendid', 'integer', 'G'); //$sendid = '21691205'; $user = MooMembersData($sendid); if ($user['uid'] != $sendid || $sendid == '') { $error = '查无此人'; echo return_data($error, false); exit; } if (MooGetphoto($user['uid'], 'com')) { $mainimg = MooGetphoto($userid, 'com'); $user['mainimg'] = $mainimg; } $user['password'] = ''; $user['regip'] = ''; $user['qq'] = ''; $user['msn'] = ''; $user['telphone'] = ''; $user['username'] = ''; //print_r($user); echo return_data($user, true); exit; }
<dl class="left-likes"> <dt> <div class="left-likes-img"> <p> <a style="display:block;" href="space_<?php echo $able_likes['uid']; ?> .html"> <?php if ($able_likes['images_ischeck'] == '1' && $able_likes['mainimg']) { ?> <img id="show_pic" src="<?php if (MooGetphoto($able_likes['uid'], 'index')) { echo IMG_SITE . MooGetphoto($able_likes['uid'], 'index'); } elseif (MooGetphoto($able_likes['uid'], 'medium')) { echo IMG_SITE . MooGetphoto($able_likes['uid'], 'medium'); } elseif ($able_likes['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " onload="javascript:DrawImage(this,100,125)" width="100"/> <?php } elseif ($able_likes['mainimg']) { ?> <?php if ($able_likes['gender'] == '1') { ?> <img id="show_pic" src="public/system/images/woman_100.gif" /> <?php
} ?> <div class="r-s-img-in"> <p> <a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $comment['cuid']; ?> " target="_blank"> <?php if ($send_user1['images_ischeck'] == '1' && $send_user1['mainimg']) { ?> <img src=" <?php if (MooGetphoto($send_user1['uid'], 'index')) { echo MooGetphoto($send_user1['uid'], 'index'); } elseif (MooGetphoto($send_user1['uid'], 'medium')) { echo MooGetphoto($send_user1['uid'], 'medium'); } elseif ($send_user1['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " onload="javascript:DrawImage(this,100,125)" /> <?php } elseif ($send_user1['mainimg']) { ?> <?php if ($send_user1['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
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'); } elseif ($user['gender'] == '1') { echo 'public/system/images/woman_1.gif'; } else { echo 'public/system/images/man_1.gif'; } ?> " flag=''/></a> <?php } elseif ($user['mainimg']) { ?> <?php if ($user['gender'] == '1') { ?> <img id="show_pic_1" src="public/system/images/woman.gif"/> <?php
function quick_search_page($gender, $age_start, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $photo) { global $_MooClass, $dbTablePre; global $user_arr, $userid, $last_login_time, $isdelcond, $isselectarea, $isdispmore, $isresult; $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $pagesize = 16; $page = 1; if (isset($_GET['page']) && $_GET['page']) { $page = $_GET['page']; } $offset = ($page - 1) * $pagesize; $blacklist = BlackList(); $index = 'members_women'; if ($gender == 0) { $index = 'members_man'; } if ($age_start || $age_end) { if ($age_start == 0) { $age_start = 18; } if ($age_end == 0) { $age_end = 99; } } // $sort_str = 'city_star desc,s_cid asc,@weight desc,city desc,province asc'; // $sortway = '1'; // if(isset($_GET['sortway']) && $_GET['sortway'] == '2'){ // //note 最新注册 // $sortway = '2'; // $sort_str = 'regdate desc,city_star desc,s_cid asc,@weight desc,city desc'; // }elseif(isset($_GET['sortway']) && $_GET['sortway'] == '3'){ // //note 诚信等级 // $sortway = '3'; // $sort_str = 'certification desc,city_star desc,s_cid asc,@weight desc,city desc'; // } // $cond[] = array('is_lock', '1', false); if ($photo) { $cond[] = array('images_ischeck', '1', false); } $cond[] = array('usertype', '1', false); if (is_array($blacklist) && !empty($blacklist)) { $cond[] = array('@id', implode('|', $blacklist), true); } if ($age_start && $age_end) { $year = date('Y', time()); $cond[] = array('birthyear', array($year - $age_end, $year - $age_start), false); } if ($work_province) { $cond[] = array('province', $work_province, false); } elseif (isset($user_arr['province']) && $user_arr['province'] && !$work_city) { $cond[] = array('province', $user_arr['province'], false); } if ($work_city) { $cond[] = array('city', $work_city, false); } elseif (isset($user_arr['city']) && $user_arr['city'] && !$work_province) { $cond[] = array('city', $user_arr['city'], false); } $dispmore = false; if ($work_province || $work_city) { $isselectarea = true; $isdispmore = false; $dispmore = MooGetGPC('dm'); if ($dispmore) { $isdispmore = true; } } if ($marriage) { $cond[] = array('marriage', $marriage, false); } if ($salary) { $cond[] = array('salary', $salary, false); } if ($education) { $cond[] = array('education', $education, false); } if ($height1 || $height2) { if ($height1 == 0) { $cond_height1 = 154; } else { $cond_height1 = $height1; } if ($height2 == 0) { $cond_height2 = 201; } else { $cond_height2 = $height2; } $cond[] = array('height', array($cond_height1, $cond_height2), false); } $sortway = MooGetGPC('sortway'); $sort_str = getSortsStr($sortway, $cond); $rs = sphinx_search($index, $cond, $sort_str, $page, $pagesize); if (!$rs || is_array($rs) && empty($rs)) { //没有结果 //MooMessage("您指定的搜索不存在或已过期", "index.php?n=search", '03'); $error = "找不到匹配的结果"; echo return_data($error, false); exit; } else { $data = $rs['user']; $total = $rs['total']; if ($total > 600) { $total = 600; } $user_list = implode(',', $data); if (empty($data)) { //MooMessage("您指定的搜索不存在或已过期", "index.php?n=search", '03'); $error = "找不到匹配的结果"; echo return_data($error, false); exit; } else { $user = array(); $sortway = isset($_GET['sortway']) ? $_GET['sortway'] : '1'; $sql = "select s.*,b.mainimg,b.showinformation_val from `{$dbTablePre}members_search` s left join `{$dbTablePre}members_base` b on s.uid=b.uid where s.uid in ({$user_list})"; $user = $_MooClass['MooMySQL']->getAll($sql); $sql = "select lastvisit from web_members_login where uid in ({$user_list})"; $user_lastvisit = $_MooClass['MooMySQL']->getAll($sql); foreach ($user_lastvisit as $key => $val) { $user[$key]['lastvisit'] = $val['lastvisit']; } } //会员基本信息补充 if ($user) { $user = userbasicadd($user); //排序 $tmp_user = array(); foreach ($data as $k => $v) { foreach ($user as $key => $val) { if ($v == $val['uid']) { $tmp_user[] = $user[$key]; break; } } } $user = $tmp_user; foreach ($user as $k => $u) { $mainimg = MooGetphoto($u['uid'], $style = "com"); $users[] = array('uid' => $u['uid'], 'nickname' => $u['nickname'], 'birthyear' => $u['birthyear'], 'height' => $u['height'], 'salary' => $u['salary'], 'province' => $u['province'], 'city' => $u['city'], 'mainimg' => $mainimg, 'gender' => $u['gender']); } echo return_data($users); exit; /* foreach($user as $va){ echo $va['nickname'].'<br />'; } exit;*/ //$error = "找不到匹配的结果"; /* $str = 'gender:'.$gender.'age_start:'.$age_start.'age_end:'.$age_end.'work_province:'.$work_province.'work_city:'.$work_city.'marriage:'.$marriage.'salary' .$salary.'education:'.$education.'height1:'.$height1.'height2:'.$height2; $return[] = $str; $return[] = $user; */ //echo return_data($user,true);exit; } //note 找不到匹配的结果返回单独提示页面 if (empty($user) && empty($user1)) { $error = "找不到匹配的结果"; echo return_data($error, false); exit; } } }
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 youAbleLiker() { global $user_arr; $result = array(); //月薪 $salary = array("0" => "不限", "1" => "1000元以下", "2" => "1001-2000元", "3" => "2001-3000元", "4" => "3001-5000元", "5" => "5001-8000元", "6" => "8001-10000元", "7" => "10001-20000元", "8" => "20001-50000元", "9" => "50000元以上"); $marriage = array("0" => "不限", "1" => "未婚", "3" => "离异", "4" => "丧偶"); $education = array("0" => "不限", "3" => "高中及以下", "4" => "大专", "5" => "大学本科", "6" => "硕士", "7" => "博士"); $userid = $user_arr['uid']; $offset = MooGetGPC('offset', 'integer', 'P'); if (empty($userid)) { return array(); } //note 您可能喜欢的人,匹配相同地区 $result = youAbleLike($l, $offset); if ($offset > (int) $l) { unset($result); $result = youAbleLike($l, 0); } elseif ($offset + 5 > (int) $l) { //5是偏移量,固定取5个会员 $result_ = youAbleLike($l, 0); $result = array_slice(array_merge($result, $result_), 0, 5); } $str = ''; foreach ($result as $k => $able_likes) { if ($able_likes['images_ischeck'] == '1' && $able_likes['mainimg']) { if (MooGetphoto($able_likes['uid'], 'index')) { $image = IMG_SITE . MooGetphoto($able_likes['uid'], 'index'); } elseif (MooGetphoto($able_likes['uid'], 'medium')) { $image = IMG_SITE . MooGetphoto($able_likes['uid'], 'medium'); } elseif ($able_likes['gender'] == '1') { $image = 'public/system/images/woman_100.gif'; } else { $image = 'public/system/images/man_100.gif'; } $image = "<img id='show_pic' src='{$image}' onload='javascript:DrawImage(this,100,125)' width='100'/>"; } elseif ($able_likes['mainimg']) { if ($able_likes['gender'] == '1') { $image = '<img id="show_pic" src="public/system/images/woman_100.gif" />'; } else { $image = '<img id="show_pic" src="public/system/images/man_100.gif" />'; } } else { if ($able_likes['gender'] == '1') { $image = '<img src="public/system/images/nopic_woman_100.gif" />'; } else { $image = '<img src="public/system/images/nopic_man_100.gif" />'; } } $nickname = $able_likes['nickname'] ? $able_likes['nickname'] : 'ID:' . $able_likes['uid']; $birthyear = $able_likes['birthyear'] ? gmdate('Y', time()) - $able_likes['birthyear'] . '岁' : '年龄保密'; $m = $able_likes['marriage'] == 0 ? '婚姻状况:保密' : "{$marriage[$able_likes['marriage']]}"; $e = $able_likes['education'] == 0 ? '保密' : "{$education[$able_likes['education']]}"; $s = $able_likes['salary'] == 0 ? '薪资:保密' : "{$salary[$able_likes['salary']]}"; $str .= <<<EOT \t\t\t<dl class="left-likes" data-len="{$l}"> \t\t\t\t<dt><div class="left-likes-img"><p><a style="display:block;" href="space_{$able_likes['uid']}.html">{$image}</a></p></div></dt> \t\t\t\t<dd class="f-b-d73c90"><a href="space_{$able_likes['uid']}.html" class="f-ed0a91-a"></a>{$nickname}</dd> \t\t\t\t<dd>{$birthyear}</dd> \t\t\t\t<dd>{$m}</dd> \t\t\t\t<dd>{$e}</dd> \t\t\t\t<dd>{$s}</dd> \t\t\t</dl> \t EOT; } echo $str; }
?> <img src="public/system/images/se_man.jpg" /> <?php } ?> <?php } else { ?> <?php if (isset($users['mainimg']) && $users['mainimg'] && isset($users['images_ischeck']) && $users['images_ischeck'] == 1) { ?> <img src="<?php if (MooGetphoto($users['uid'], 'mid')) { echo IMG_SITE . MooGetphoto($users['uid'], 'mid'); } elseif (MooGetphoto($users['uid'], 'medium')) { echo IMG_SITE . MooGetphoto($users['uid'], 'medium'); } elseif ($users['gender'] == '1') { echo 'public/system/images/se_woman.jpg'; } else { echo 'public/system/images/se_man.jpg'; } ?> " /> <?php } else { ?> <img src="public/system/images/se_woman.jpg" /> <?php } ?> <?php
function public_showmsg($uid) { header("Expires: Mon, 26 Jul 1970 05:00:00 GMT"); header("Cache-Control:no-cache, must-revalidate"); header("Pragma:no-cache"); global $_MooClass, $dbTablePre, $timestamp, $memcached, $user_arr; //会员ID //$uid = MooGetGPC('uid','integer'); //初始化显示数据 $str = ''; $n = 0; //未读消息条数 //$msg = $_MooClass['MooMySQL']->getOne("select count(*) from {$dbTablePre}services where s_uid={$uid} and s_status='0' and flag = '1' and s_uid_del='0'"); //$msg_count = $msg['count(*)']; $msg_count = header_show_total($uid); //前台显示 if ($msg_count) { //3个发件人的ID $user_msg_id = $_MooClass['MooMySQL']->getAll("select distinct s_fromid from {$dbTablePre}services where s_uid={$uid} and s_status='0' and s_uid_del='0' order by s_time desc limit 3"); $inidArr = array(); foreach ($user_msg_id as $v) { if ($v['s_fromid'] == 0) { $from_kefu = 1; } else { $inidArr[] = $v['s_fromid']; } } $inid = implode(',', $inidArr); //提示信息 $user_msg = array(); if (MOOPHP_ALLOW_FASTDB) { foreach ($inidArr as $arruid) { $user_msg[] = MooFastdbGet('members_search', 'uid', $arruid); } } else { $user_msg = $_MooClass['MooMySQL']->getAll("select uid,nickname,s_cid from {$dbTablePre}members_search where uid in ({$inid})"); } $str .= '<p>您有<a href="index.php?n=service&h=message">' . $msg_count . '条新消息</a></p>'; foreach ($user_msg as $vv) { //设置不同链接 if ($vv) { //$nickname=$vv['nickname2']?$vv['nickname2']:$vv['nickname']; $nickname = $vv['nickname']; if ($nickname) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">' . $nickname . '给您发的新邮件</a></p>'; } else { $str .= '<p>查看<a href="index.php?n=service&h=message&t=membermessage">会员ID ' . $vv['uid'] . '给您发的新邮件</a></p>'; } } } if ($from_kefu) { $str .= '<p>查看<a href="index.php?n=service&h=message&t=hlmessage">真爱一生网发新邮件</a></p>'; } $n++; } //提示被哪些用户访问主页 if ($user_arr['regdate'] < time() - 7200) { if ($user_arr['showinformation']) { $visitor_msg = public_showmsg_two($uid); } //$nickname=$visitor_msg['nickname2']?$visitor_msg['nickname2']:$visitor_msg['nickname']; $nickname = $visitor_msg['nickname']; $nc = $nickname ? $nickname : 'ID:' . $visitor_msg['uid']; if ($visitor_msg) { //伪造查看共多少秒,存memcached $makevisit_sec = $memcached->get('makevisit' . $visitor_msg['uid'] . '_' . $uid); if ($makevisit_sec) { $sec = $makevisit_sec; } else { $sec = rand(100, 200); $memcached->set('makevisit' . $visitor_msg['uid'] . '_' . $uid, $sec, 60); } $img = MooGetphoto($visitor_msg['uid'], 'page'); //显示访问者的头像 $mid_img = MooGetphoto($visitor_msg['uid'], 'mid'); if ($mid_img && !$img) { $image = MooAutoLoad('MooImage'); $pic_dir = substr($mid_img, 0, 28); $new_file_name = $visitor_msg['uid'] * 3 . "_page.jpg"; $image->config(array('thumbDir' => $pic_dir, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $new_file_name, 'waterMarkMinWidth' => '82', 'waterMarkMinHeight' => '114', 'waterMarkStatus' => 9)); $image->thumb(49, 62, $mid_img); $img = $page_img; } if ($img) { $photo = "<a target='_blank' href='index.php?n=space&h=viewpro&uid=" . $visitor_msg['uid'] . "'><img src=" . $img . " class='u-photo'></a>"; $str .= '<div class="c-line"></div><p>您的资料正在被:</p>' . $photo . '<p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>查看,</p><p>已查看' . $sec . '秒,</p><p><a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">查看Ta的资料</a></p><div style="clear:both"></div>'; } else { $str .= '<p>您的资料正在被' . $photo . '<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">' . $nc . '</a>查看,已查看' . $sec . '秒,<a target="_blank" href="index.php?n=space&h=viewpro&uid=' . $visitor_msg['uid'] . '">查看Ta的资料</a></p>'; } $n++; } } //提示当前会员有未读在线聊天消息 $chat_msg = public_showmsg_three($uid); $new_message = ''; if ($chat_msg) { $str .= '<p>您有<a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=service&h=chat&chatorid=' . $chat_msg['s_fromid'] . '\', \'_blank\', \'height=500, width=700, toolbar =no, menubar=no, scrollbars=no, resizable=yes, location=no, status=no\')">新的在线消息</a></p>'; $new_message = '|new_message'; $n++; } //委托真爱一生联系TA消息提醒,十五天后自动消失 $expires_time = time() - 3600 * 24 * 15; $sql_contact = "SELECT count(*) as yc_count,other_contact_you,you_contact_other FROM {$dbTablePre}service_contact WHERE is_read=0 and you_contact_other = '{$uid}' AND syscheck = '1' AND stat = '1' AND sendtime > " . $expires_time; $ret = $_MooClass['MooMySQL']->getOne($sql_contact); if ($uid == $ret['you_contact_other']) { $you_contact_other_msg_count = $ret['yc_count']; if ($you_contact_other_msg_count > 0) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret['other_contact_you'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=2,uid=' . $uid . ')">ID为' . $ret['other_contact_you'] . '</a>委托真爱一生联系您</p>'; $n++; } } //秋波发送提醒,十五天后自动消失 $sql_leer = "SELECT receiveuid,senduid FROM web_service_leer WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_leer = $_MooClass['MooMySQL']->getOne($sql_leer); if ($uid == $ret_leer['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_leer['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=0,uid=' . $uid . ')">ID为' . $ret_leer['senduid'] . '</a>向您送出了一个秋波</p>'; $n++; } //鲜花发送提醒 $sql_rose = "SELECT receiveuid,senduid,num FROM web_service_rose WHERE is_read=0 and receiveuid = '" . $uid . "' AND receivetime > " . $expires_time; $ret_rose = $_MooClass['MooMySQL']->getOne($sql_rose); if ($uid == $ret_rose['receiveuid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_rose['senduid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=1,uid=' . $uid . ')">ID为' . $ret_rose['senduid'] . '</a>向您送出了鲜花</p>'; $n++; } //意中人提醒 $sql_liker = "SELECT * FROM web_service_friend WHERE is_read=0 and friendid = '" . $uid . "' AND sendtime > " . $expires_time; $ret_liker = $_MooClass['MooMySQL']->getOne($sql_liker); if ($uid == $ret_liker['friendid']) { $str .= '<p><a style="cursor:pointer" onclick="javascript:window.open(\'index.php?n=space&h=viewpro&uid=' . $ret_liker['uid'] . '\', \'newwindow\', \'height=480, width=680, toolbar =no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no\'),update_read(type=3,uid=' . $uid . ')">ID为' . $ret_liker['uid'] . '</a>将您添加为意中人了</p>'; $n++; } //输出 if ($str) { $str .= "|最新提醒({$n}){$new_message}"; echo $str; } else { echo $n; } }
<div class="vote-right-content"> <span class="right-title fleft">等您打分的会员</span> <ul class="votr-photos"> <?php if (isset($pic_4)) { foreach ((array) $pic_4 as $pic) { ?> <li> <div class="votr-photos-list"> <p> <?php if ($pic['images_ischeck'] == '1' && $pic['mainimg']) { ?> <img src="<?php if (MooGetphoto($pic['uid'], 'mid')) { echo IMG_SITE . MooGetphoto($pic['uid'], 'mid'); } elseif ($pic['gender'] == '1') { echo 'public/system/images/se_woman_60.jpg'; } else { echo 'public/system/images/se_man_60.jpg'; } ?> " width="60" height="75"/> <?php } elseif ($pic['mainimg']) { ?> <?php if ($pic['gender'] == '1') { ?> <img src="public/system/images/se_woman_60.jpg" width="60" height="75"/> <?php
?> <?php $send_user1 = leer_send_user1($visitors['visitorid']); ?> <li> <dl class="r-like-c-data"> <dt><div><a style="display:block;" href="space_<?php echo $visitors['visitorid']; ?> .html" target="_blank"> <?php if ($send_user1['mainimg'] && $send_user1['images_ischeck'] == '1') { ?> <img class="_photo_ fixphoto" src=" <?php if (MooGetphoto($send_user1['uid'], 'mid')) { echo IMG_SITE . MooGetphoto($send_user1['uid'], 'mid'); } elseif ($send_user1['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " /> <?php } elseif ($send_user1['mainimg']) { ?> <?php if ($send_user1['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif" /> <?php
function shadow_master() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached, $uuid; $womenList = array('30407189', '21186208', '21199933', '20686096', '20223069', '20520991', '20069562', '21156987', '21023025', '21206132', '21201459', '21161703', '20619161', '20301718', '20719091', '21740236', '20681292', '21424242', '20554506', '20111310', '20660269', '30632759', '30631960', '30630519', '30608962', '30387074', '30378615', '30360483', '30300309', '30252809', '30214641'); $manList = array('30391348', '21793878', '30129941', '21514524', '30087732', '30621435', '30071838', '30610492', '30619608', '30080561', '30403838', '30211025', '30069490', '30359171', '30368726', '30405061', '30192000', '30069742', '30141451', '30052221', '30253012', '30016533', '30286293', '30247063', '30403530', '30365362', '21767568', '30341955', '21359517', '21708383', '30041513'); $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); $user_arr = MooMembersData($userid); } if ($userid) { $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } } if ($userid) { $gender = $user_arr['gender'] == 1 ? 0 : 1; } else { $gender = $_GET['gender']; } if ($gender == 0) { $rand_keys = array_rand($manList, 12); for ($i = 0; $i < 12; $i++) { $returnarr[] = $manList[$rand_keys[$i]]; } } elseif ($gender == 1) { $rand_keys = array_rand($womenList, 12); for ($i = 0; $i < 12; $i++) { $returnarr[] = $womenList[$rand_keys[$i]]; } } else { $rand_keys = array_rand($womenList, 6); for ($i = 0; $i < 6; $i++) { $returnarr[] = $womenList[$rand_keys[$i]]; } $rand_keys = array_rand($manList, 6); for ($i = 0; $i < 6; $i++) { $returnarr[] = $manList[$rand_keys[$i]]; } //shuffle($returnarr); } foreach ($returnarr as $value) { $mainimg = MooGetphoto($value, $style = "com"); $users[] = array('uid' => $value, 'mainimg' => $mainimg); } echo return_data($users); exit; }
} ?> <div class="r-s-img-in"> <p style="width:105px;"> <a style="display:block;" href="index.php?n=service&h=commission&t=getcontactdata1&uid=<?php echo $contact['l']['other_contact_you']; ?> "> <?php if ($contact['s']['images_ischeck'] == '1' && $contact['s']['mainimg']) { ?> <img src="<?php if (MooGetphoto($contact['s'][uid], 'mid')) { echo MooGetphoto($contact['s'][uid], 'mid'); } elseif (MooGetphoto($contact['s'][uid], 'medium')) { echo MooGetphoto($contact['s'][uid], 'medium'); } elseif ($contact['s']['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " /> <?php } elseif ($contact['s']['mainimg']) { ?> <?php if ($contact['s']['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a><?php } ?> <div class="r-s-img-in"> <p style="width:105px;"> <a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $friend['l']['friendid']; ?> " target="_blank"> <?php if ($friend['s']['images_ischeck'] == '1' && $friend['s']['mainimg']) { ?> <img src="<?php if (MooGetphoto($friend['s'][uid], 'mid')) { echo MooGetphoto($friend['s'][uid], 'mid'); } elseif (MooGetphoto($friend['s'][uid], 'medium')) { echo MooGetphoto($friend['s'][uid], 'medium'); } elseif ($friend['s']['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " /> <?php } elseif ($friend['s']['mainimg']) { ?> <?php if ($friend['s']['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
<img src="module/service/templates/default/images/bind-img.gif" class="fleft" /> <dl class="bindtwo"> <dt> <div class="cl-photo-img"> <p><a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $user_bind['uid']; ?> " target="_blank"> <?php if ($user_bind['images_ischeck'] == '1' && $user_bind['mainimg']) { ?> <img src="<?php if (MooGetphoto($user_bind['uid'], 'com')) { echo MooGetphoto($user_bind['uid'], 'com'); } elseif (MooGetphoto($user_bind['uid'], 'medium')) { echo MooGetphoto($user_bind['uid'], 'medium'); } elseif ($user_bind['gender'] == '1') { echo 'public/system/images/woman.gif'; } else { echo 'public/system/images/man.gif'; } ?> " onload="javascript:DrawImage(this,110,138)" /> <?php } elseif ($user_bind['mainimg']) { ?> <?php if ($user_bind['gender'] == '1') { ?> <img src="public/system/images/woman.gif"/> <?php
/** * 登录首页 * 描述: * */ 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'); }
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a><?php } ?> <div class="r-s-img-in"> <p style="width:110px;"> <a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $rose['s']['uid']; ?> " target="_blank"> <?php if ($rose['s']['images_ischeck'] == '1' && $rose['s']['mainimg']) { ?> <img src="<?php if (MooGetphoto($rose['s'][uid], 'mid')) { echo MooGetphoto($rose['s'][uid], 'mid'); } elseif (MooGetphoto($rose['s'][uid], 'medium')) { echo MooGetphoto($rose['s'][uid], 'medium'); } elseif ($rose['s']['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " /> <?php } elseif ($rose['s']['mainimg']) { ?> <?php if ($rose['s']['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
/** * 疯狂粉丝会 */ function crazyfan() { $tb_pre = $GLOBALS['dbTablePre']; $memcache = $GLOBALS['memcached']; $db = $GLOBALS['_MooClass']['MooMySQL']; $year = (int) date('Y'); $month = (int) date('m'); $fullyear = $year * 12 + $month; $history_month = 6; // 得到$history_month个月历史记录 // 得到推荐会员 $user_list = $db->getAll("select uid, score, gender, nickname from {$tb_pre}carcrazyfan where sort > 0"); foreach ($user_list as $user) { $uid = $user['uid']; $score = unserialize($user['score']); $cur_score = $score[$year][$month]; if ($cur_score === null) { $cur_score = 0; $score[$year][$month] = 0; $score = addslashes(serialize($score)); $db->query("update {$tb_pre}carcrazyfan set score='{$score}' where uid={$uid}"); } $fans_list[$user['gender']][$uid] = $cur_score; $photo_list[$uid] = MooGetphoto($uid); } arsort($fans_list[0]); // 得分最高排在最前 arsort($fans_list[1]); // 历届月度冠军 memcache $needupdate = false; $mem_month = $memcache->get('lovestation_history_month'); if ($mem_month != $fullyear) { $memcache->set('lovestation_history_month', $fullyear, 0, time() + 86400 * 31); } $history_score = unserialize($memcache->get('lovestation_history_score')); // 去除超过$history_month个月的记录 if (is_array($history_score)) { foreach ($history_score as $key => $value) { if ($key < $fullyear - $history_month) { unset($history_score[$key]); } } } if ($mem_month != $fullyear || !$history_score) { // 需要更新memcache $all_user_list = $db->getAll("select uid, score, gender from {$tb_pre}carcrazyfan"); for ($i = 0; $i < $history_month; ++$i) { $pre_fullyear = $fullyear - $history_month + $i; if (!isset($history_score[$pre_fullyear])) { $needupdate = true; $max_score = array(0 => array(0, 0), 1 => array(0, 0)); // 最高票数为0认为当月没有数据 foreach ($all_user_list as $user) { $gender = $user['gender']; $pre_year = floor($pre_fullyear / 12); $pre_month = $pre_fullyear % 12; if ($pre_month == 0) { // eg: 2012年12月 $pre_year--; $pre_month = 12; } $score = unserialize($user['score']); $pre_score = $score[$pre_year][$pre_month]; // 对应历史年月的得分 if ($pre_score === null) { $pre_score = 0; } // 得到分数最大的会员 if ($pre_score > $max_score[$gender][1]) { $max_score[$gender] = array($user['uid'], $pre_score); } } $history_score[$pre_fullyear] = array($max_score[0][0], $max_score[1][0]); // 历届月度冠军 array(男,女) } } if ($needupdate) { $memcache->set('lovestation_history_score', serialize($history_score), 0, time() + 86400 * 31); } } require MooTemplate('public/lovestation_crazyfan', 'module'); }
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a><?php } ?> <div class="r-s-img-in"> <p style="width:105px;"> <a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $visitor['l']['uid']; ?> " target="_blank"> <?php if ($visitor['s']['images_ischeck'] == '1' && $visitor['s']['mainimg']) { ?> <img src="<?php if (MooGetphoto($visitor['s'][uid], 'mid')) { echo MooGetphoto($visitor['s'][uid], 'mid'); } elseif (MooGetphoto($visitor['s'][uid], 'medium')) { echo MooGetphoto($visitor['s'][uid], 'medium'); } elseif ($visitor['s']['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> " /> <?php } elseif ($visitor['s']['mainimg']) { ?> <?php if ($visitor['s']['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
<?php if ($user_arr['images_ischeck'] == '1' && $user_arr['mainimg']) { ?> <a id="show_big_pic" href="<?php if (MooGetphoto($user_arr['uid'], 'mid')) { echo MooGetphoto($user_arr['uid'], 'mid'); } elseif ($user_arr['gender'] == '1') { echo 'public/system/images/woman_1.gif'; } else { echo 'public/system/images/man_1.gif'; } ?> " onclick="return false;"> <img id="show_pic_1" src="<?php if (MooGetphoto($user_arr['uid'], 'mid')) { echo MooGetphoto($user_arr['uid'], 'mid'); } elseif ($user_arr['gender'] == '1') { echo 'public/system/images/woman_1.gif'; } else { echo 'public/system/images/man_1.gif'; } ?> " class="preview" onload="javascript:DrawImage(this,110,138)" /></a> <?php } elseif ($user_arr['mainimg']) { ?> <a id="show_big_pic" href="###" onclick="return false;"> <img id="show_pic_1" src="public/system/images/<?php echo $user_arr['gender'] == 1 ? 'woman' : 'man'; ?> .gif" class="preview" />
<a class="citystar2"><img src="module/service/templates/default/images/citystar.gif" /></a><?php } ?> <div class="r-s-img-in"> <p style="width:110px;"> <a style="display:block;" href="index.php?n=space&h=viewpro&uid=<?php echo $leer['l']['senduid']; ?> " target="_blank"> <?php if ($leer['s']['images_ischeck'] == '1' && $leer['s']['mainimg']) { ?> <img src="<?php if (MooGetphoto($leer['s'][uid], 'mid')) { echo MooGetphoto($leer['s'][uid], 'mid'); } elseif (MooGetphoto($leer['s'][uid], 'medium')) { echo MooGetphoto($leer['s'][uid], 'medium'); } elseif ($leer['s']['gender'] == '1') { echo 'public/system/images/woman_100.gif'; } else { echo 'public/system/images/man_100.gif'; } ?> "/> <?php } elseif ($leer['s']['mainimg']) { ?> <?php if ($leer['s']['gender'] == '1') { ?> <img src="public/system/images/woman_100.gif"/> <?php
/** * 登录表单处理 * 描述: */ function login_submit() { global $_MooClass, $dbTablePre, $_MooCookie, $uuid, $memcached; $error = array(); //noet 对提交的数据过滤 if ($_POST) { $username = trim($_POST['username']); // $username = "******"; $md5_password = md5($_POST['password']); // $md5_password = md5(123456); $cookietime = intval(isset($_POST['cookietime']) ? $_POST['cookietime'] : ''); $remember_username = MooGetGPC('remember', 'integer', 'P'); } /*****设置回转的页面*****/ if (empty($_POST['username']) && empty($_POST['password'])) { //note 转至邮箱验证页 $error = "用户名和密码为空"; echo return_data($error, false); exit; } //note 用户名不能为空 if (empty($_POST['username'])) { //note 转至邮箱验证页 $error = "用户名为空"; echo return_data($error, false); exit; } //note 密码不能为空 if (empty($_POST['password'])) { //note 转至邮箱验证页 $error = "密码为空"; echo return_data($error, false); exit; } if (empty($error)) { $userid = 0; $sp = searchApi('members_man members_women'); $limit = array(0, 1); //note 验证用户名,密码 enky if (is_numeric($username)) { if (strlen($username) == 11) { //判断手机号是否存在 $filter = array(); $filter[] = array('telphone', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } } if (!$userid) { //判断uid是否存在 $filter = array(); $filter[] = array('@id', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } } if (!$userid) { if ($user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_base` where qq='{$username}'", true)) { $userid = $user_one['uid']; } } } else { $filter = array(); $filter[] = array('username', $username); if ($sp->getResultOfReset($filter, $limit)) { $ids = $sp->getIds(); if (isset($ids[0])) { $userid = $ids[0]; } } } //note 用户名找不到 if (!$userid) { $login_where = is_numeric($username) ? "uid='{$username}' or telphone='{$username}'" : "username='******'"; $user_one = $_MooClass['MooMySQL']->getOne("SELECT uid from `{$dbTablePre}members_search` where {$login_where}", true); if ($user_one) { $userid = $user_one['uid']; } else { $error = "用户名不存在"; echo return_data($error, false); exit; } } //获取 $user = array_merge(MooGetData('members_login', 'uid', $userid), MooMembersData($userid)); if ($user['is_lock'] != '1') { $error = "用户已经被锁定"; echo return_data($error, false); exit; } //note 用户密码错误 if ($user['uid'] && $user['password'] != $md5_password) { //note 转至邮箱验证页 $error = "密码错误"; echo return_data($error, FALSE); exit; } if (empty($error)) { //note 验证通过 if ($user['uid'] && $user['password'] == $md5_password) { //生成随机唯一id,andriod用 $userid = $user['uid']; $uuid = user_md5_id($user['uid']); $memcached->set('uuid_' . $userid, $uuid, 0, 0); $memcached->set('uid_' . $userid, $userid, 0, 0); $user['uuid'] = $uuid; if ($user['automatic'] == 1) { MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400 * 7); } else { MooSetCookie('auth', MooAuthCode("{$user['uid']}\t{$user['password']}", 'ENCODE'), 86400); } $user_sha = $_MooClass['MooMySQL']->getOne("SELECT lastvisit from `{$dbTablePre}members_login` where uid='{$userid}'"); $s_time = $user_sha['lastvisit']; $ret_count = $_MooClass['MooMySQL']->getOne("SELECT count(uid) as c FROM {$dbTablePre}service_visitor WHERE uid >0 and visitorid = '{$userid}' AND who_del !=2 and visitortime > '{$s_time}' "); $shadow_numb = $ret_count['c'] ? $ret_count['c'] : 0; // MooSetCookie('auth','SDFSFGAFGD\AHFGHGHJ',86400); $time = time(); $_MooClass['MooMySQL']->query("update {$dbTablePre}members_login set last_login_time = '{$time}',login_meb = login_meb+1,lastvisit='{$time}' where uid = '{$user['uid']}'"); //更新最后登录时间 //会员最后登录时间 MooSetCookie('last_login_time', $time, 86400); //note 客服提醒 if ($user['is_awoke'] == '1') { $awoketime = time() + 120; $sql = "INSERT INTO `{$dbTablePre}admin_remark` SET sid='{$user['sid']}',title='会员上线',content='ID:{$user['uid']}会员刚刚通过pc机上线,请联系',awoketime='{$awoketime}',dateline='{$GLOBALS['timestamp']}'"; $_MooClass['MooMySQL']->query($sql); } MooPlugins('ipdata'); $online_ip = GetIP(); if ($online_ip != $user['lastip']) { $user_address = convertIp($online_ip); include "./module/crontab/crontab_config.php"; foreach ($provice_list as $key => $provice_arr) { if (strstr($user_address, $provice_arr) !== false) { //if(){ $province = $key; break; } } if (empty($province)) { $province = $current_user['province']; } //得到市对应的城市代号 foreach ($city_list as $city_key => $city_val) { if (strstr($user_address, $city_val) !== false) { $city = $city_key; break; } } } MooSetCookie('province', $user['province'], 86400); MooSetCookie('city', $user['city'], 86400); $lastactive = time(); $uid = $user['uid']; //note 更新用户的最近登录ip和最近登录时间 $updatesqlarr = array('lastip' => $online_ip); $wheresqlarr = array('uid' => $uid); updatetable("members_login", $updatesqlarr, $wheresqlarr); if (MOOPHP_ALLOW_FASTDB) { $val = array(); $val['lastip'] = $online_ip; //$val['client']=0; $val['last_login_time'] = $time; $val['lastvisit'] = $time; //$val['isOnline']=1; MooFastdbUpdate('members_login', 'uid', $uid, $val); //!! } //记录本次登录ip及上次的ip,及真实的最后访问时间 $sql_ip = "SELECT last_ip,finally_ip FROM {$GLOBALS['dbTablePre']}member_admininfo WHERE uid='{$uid}'"; $member_admin_info = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql_ip); if (!empty($member_admin_info)) { $sql_ip = "UPDATE {$GLOBALS['dbTablePre']}member_admininfo SET last_ip='{$member_admin_info['finally_ip']}',finally_ip='{$online_ip}',real_lastvisit='{$lastactive}' WHERE uid='{$uid}'"; } else { $sql_ip = "INSERT INTO {$GLOBALS['dbTablePre']}member_admininfo SET finally_ip='{$online_ip}',uid='{$uid}',real_lastvisit='{$lastactive}'"; } $GLOBALS['_MooClass']['MooMySQL']->query($sql_ip); } } } //资料完善度 $all_len = 0; $user_arr = MooMembersData($uid); if ($uid) { $all_len = (int) (getUserinfo_per($user_arr) * 100); } $user['all_len'] = $all_len; $user['choice'] = MooGetData('members_choice', 'uid', $uid); if (MooGetphoto($user['uid'], 'com')) { $mainimg = MooGetphoto($user['uid'], 'com'); } $user_sha = $_MooClass['MooMySQL']->getOne("SELECT telphone from `{$dbTablePre}certification` where uid='{$userid}'"); if (empty($error)) { $user['telphonesha'] = isset($user_sha['telphone']) ? $user_sha['telphone'] : 0; $user['mainimg'] = $mainimg; $user['password'] = ''; $user['regip'] = ''; $user['qq'] = ''; $user['msn'] = ''; $user['telphone'] = ''; $user['username'] = ''; $user['numofvis'] = $shadow_numb; $ret_count1 = $_MooClass['MooMySQL']->getOne("SELECT count(s_uid) as c FROM {$dbTablePre}services WHERE s_uid = '{$userid}' and flag = '1' and s_uid_del='0' and s_status = '0' ", true); $total1 = $ret_count1['c']; //2009-11-22日修改(得到总数) $user['nummail'] = $total1; echo return_data($user, true); exit; // echo "<pre>$return</pre>";exit; } else { $error = "用户名或密码错误"; echo return_data($error, false); exit; } }
function space_viewpro() { global $_MooClass, $dbTablePre, $userid, $timestamp, $user_arr, $val_arr, $style_user_arr, $diamond, $_MooCookie, $memcached; //$val_arr统计资料完善度 // $uid = $GLOBALS ['style_uid']; $uid = $_GET['other_uid']; $is_only_show = true; $status = array(); //验证是否合法成功登陆 $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $userid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($userid) { $userid = $mem_uid = $memcached->get('uid_' . $userid); } $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = MooMembersData($userid); $user_oth = MooMembersData($uid); //note 判断被浏览的会员是否存在 $status = array_merge(MooMembersData($uid), MooGetData('members_login', 'uid', $uid)); $user_per_num = getUserinfo_per($user_arr); $error = array(); //*****************白名单******************* if ($uid != $userid) { $is_only_show = false; } //*****************白名单******************* if (empty($is_only_show)) { //if(MOOPHP_ALLOW_FASTDB && $status['is_lock'] != 1){//is_lock默认1不封锁用户,0则封锁 if ($status['is_lock'] != 1) { $error = "此会员已经找到真爱,关闭了个人资料"; echo return_data($error, false); exit; } if (!$status) { $error = "此会员已经找到真爱,关闭了个人资料"; echo return_data($error, false); exit; //note 判断被浏览的用户是否允许其他会员查看他的资料 } elseif (!$status['showinformation'] && $status['uid'] != $userid) { //showinformation默认1允许其他会员查看,0则不允许 switch ($status['showinformation_val']) { //showinformation_val用户关闭资料的理由 case 1: $error = "此会员已找到正在交往的对象,故资料未公开"; echo return_data($error, FALSE); exit; break; case 2: $error = "此会员已找到真爱,即将踏上红地毯,故资料未公开,转向我的真爱一生"; echo return_data($error, false); exit; break; case 3: $error = "此会员最近很忙,无法及时回复邮件,故资料未公开,转向我的真爱一生"; break; case 4: $error = "此会员资料未公开,原因可能是TA已经找到真爱了,转向我的真爱一生"; echo return_data($error, false); exit; break; } } } //note 浏览资料页面时候,写入谁浏览谁表,自己浏览自己的除外 if ($userid && $uid && $userid != $uid) { //note 不让屏蔽的会员查看 if (MooGetScreen($userid, $uid)) { $error = "由于特殊原因对方资料未公开,转向我的真爱一生"; echo return_data($error, false); exit; } if ($user_oth['gender'] != $user_arr['gender']) { //service_visitor 某某会员浏览某某会员记录表 $visitor = $_MooClass['MooMySQL']->getOne("SELECT vid FROM {$dbTablePre}service_visitor WHERE uid = '{$userid}' AND visitorid = '{$uid}'"); //note 再次浏览的,更新浏览时间 if ($visitor['vid']) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_visitor SET visitortime = '{$timestamp}' WHERE uid='{$userid}' AND visitorid = '{$uid}' limit 1"); } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_visitor SET uid = '{$userid}',visitorid='{$uid}',visitortime = '{$timestamp}'"); } if (MooUserIsOnline($uid)) { $browser = $_MooClass['MooMySQL']->getOne("SELECT id FROM {$dbTablePre}service_browser WHERE uid = '{$userid}' AND browserid = '{$uid}'"); //note 再次浏览的,更新浏览时间 if ($browser['id']) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}service_browser SET browsertime = '{$timestamp}' WHERE uid='{$userid}' AND browserid = '{$uid}' limit 1"); } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}service_browser SET uid = '{$userid}',browserid='{$uid}',browsertime = '{$timestamp}'"); } } } } //note 查看会员资料信息 $c = MooGetData('members_choice', 'uid', $uid) + MooGetData('members_introduce', 'uid', $uid); $user =& $status; /***创建浏览队列 ***/ if ($userid && $uid && $userid != $uid) { if ($user_oth['gender'] != $user_arr['gender'] && $user['uid'] != $userid) { if ($user['usertype'] == 3 && $user_arr['usertype'] != 3 && $user['showinformation'] == 1 && $user_arr['s_cid'] >= 40) { $iscan = $GLOBALS['fastdb']->get($userid . '_scan_space'); //浏览的全权会员列表 $iscan = empty($iscan) ? array() : json_decode($iscan, true); $iscan = in_array($uid, $iscan) ? $iscan : array_push($iscan, $uid); $GLOBALS['fastdb']->set($userid . '_scan_space', json_encode($iscan)); } if ($user['usertype'] != 3) { $scan_i = $GLOBALS['fastdb']->get('scan_space_' . $uid); //访问的记录列表 $scan_i = empty($scan_i) ? array() : json_decode($scan_i, true); if (!empty($scan_i)) { $scan_s = array(); foreach ($scan_i as $k => $scan) { $scan_s[$k] = $scan[0]; } if (in_array($userid, $scan_s)) { $scan_i[array_search($userid, $scan_s)] = array($userid, time()); } else { array_push($scan_i, array($userid, time())); } } else { array_push($scan_i, array($userid, time())); } $GLOBALS['fastdb']->set('scan_space_' . $uid, json_encode($scan_i)); } } } //note_显示相册中的普通照片 $user_pic = $_MooClass['MooMySQL']->getAll("SELECT imgurl,pic_date,pic_name FROM {$dbTablePre}pic WHERE syscheck=1 and isimage='0' and uid='{$uid}'"); $user['pic'] = $user_pic; $gender = $user_arr['gender'] == '0' ? '1' : '0'; //0为男,1为女 $agebegin = date("Y") - $user_arr['birthyear'] - 3; $ageend = date("Y") - $user_arr['birthyear'] + 3; $workprovince = $user_arr['province']; $workcity = $user_arr['city']; $search_url = MOOPHP_URL . "/index.php?n=search&h=quick&gender=" . $gender . "&age_start=" . $agebegin . "&age_end=" . $ageend . "&workprovince=" . $workprovince . "&workcity=" . $workcity . "&isphoto=1&imageField=&quick_search=搜索"; //note 您可能喜欢的人,匹配相同地区 $able_like = $userid ? youAbleLike(5) : array(); //note 获取会员认证证件 //note 当查看其他个人主页时,当前浏览的主页条件是否匹配 $user2 = false; if ($uid != "" && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) { $c2 = MooGetData('members_choice', 'uid', $userid); $user2 = MooMembersData($userid); } //note 获得用户资料的完整度,以百分比显示makui $all_len = 0; if ($uid == $user_arr['uid']) { $all_len = (int) (getUserinfo_per($user_arr) * 100); } $user['all_len'] = $all_len; //note 匹配指数分数得出 $mark = 0; if ($uid && $uid != $user_arr['uid'] && $user['gender'] != $user_arr['gender']) { $cho = MooGetData('members_choice', 'uid', $user_arr['uid']); $year = isset($cho['birthyear']) ? $cho['birthyear'] : $user_arr['birthyear']; if ($year - 5 <= $user['birthyear'] && $user['birthyear'] <= $year + 5) { $mark_age = 9; $mark += 9; } else { $mark_age = 6; $mark += 6; } if ($cho['height1'] <= $user['height'] && $user['height'] <= $cho['height2']) { $mark_height = 7; $mark += 7; } else { $mark_height = 5; $mark += 5; } if ($cho['weight1'] <= $user['weight'] && $user['weight'] <= $cho['weight2']) { $mark_weight = 5; $mark += 5; } else { $mark_weight = 3; $mark += 3; } if ($cho['workprovince'] == $user['province']) { $mark_workprovince = 8; $mark += 8; } else { $mark_workprovince = 6; $mark += 6; } if ($cho['workcity'] == $user['city']) { $mark_workcity = 16; $mark += 16; } else { $mark_workcity = 5; $mark += 10; } if ($cho['education'] == $user['education']) { $mark_education = 8; $mark += 8; } else { $mark_education = 5; $mark += 5; } if ($cho['salary'] == $user['salary']) { $mark_salary = 9; $mark += 9; } else { $mark_salary = 7; $mark += 7; } if ($cho['marriage'] == $user['marriage']) { $mark_marriage = 8; $mark += 8; } else { $mark_marriage = 5; $mark += 5; } if ($cho['children'] == $user['children']) { $mark_children = 8; $mark += 8; } else { $mark_children = 6; $mark += 6; } if ($cho['drinking'] == $user['drinking']) { $mark_drinking = 5; $mark += 5; } else { $mark_drinking = 3; $mark += 3; } if ($cho['smoking'] == $user['smoking']) { $mark_smoking = 5; $mark += 5; } else { $mark_smoking = 2; $mark += 2; } if ($cho['body'] == $user['body']) { $mark_body = 6; $mark += 12; } else { $mark_body = 4; $mark += 8; } } $returnurl = 'index.php?' . $_SERVER['QUERY_STRING']; //返回的url //note 检查绑定是否过期 if ($user['isbind'] == 1) { $user['isbind'] = check_bind($user['bind_id']); } $activity = $_MooClass['MooMySQL']->getOne("SELECT uid,username,regtime,channel FROM {$dbTablePre}ahtv_reguser where uid='{$uid}' and isattend=1"); //鲜花发送语 if ($user_arr['gender'] == 0) { //boy $sql = "SELECT id,content FROM {$dbTablePre}members_sendinfo where type=2 and isShow=1"; } else { //girl $sql = "SELECT id,content FROM {$dbTablePre}members_sendinfo where type=1 and isShow=1"; } $sendinfo = $_MooClass['MooMySQL']->getAll($sql); $users = array(); $mainimg = MooGetphoto($status['uid'], $style = "com"); $status['mainimg'] = $mainimg; $users['material'] = $status; $users['mating'] = $c; //资料完整度 $users['inte'] = $user_per_num * 100; $users['inte'] = round($users['inte']); $users['material']['password'] = ''; $users['material']['regip'] = ''; $users['material']['qq'] = ''; $users['material']['msn'] = ''; $users['material']['telphone'] = ''; $users['material']['username'] = ''; if (empty($error)) { echo return_data($users); exit; } else { echo return_data($error, false); exit; } }
echo IMG_SITE . $userphoto; } } if (empty($userphoto)) { echo $return['data']['to']['gender'] == 1 ? 'public/system/images/nopic_big_woman.gif' : 'public/system/images/nopic_big_man.gif'; } ?> " /></div> </div> <div class="my"> <div class="you_title"><span>我的形象</span></div> <div class="you_cen"><img style="width:136px; height:175px;" src="<?php $userphoto = ''; if ($return['data']['from']['images_ischeck'] == 1) { if (!($userphoto = MooGetphoto($return['data']['from']['uid']))) { $userphoto = MooGetphoto($return['data']['from']['uid'], 'index'); } if (!empty($userphoto)) { echo IMG_SITE . $userphoto; } } if (empty($userphoto)) { echo $return['data']['from']['gender'] == 1 ? 'public/system/images/nopic_big_woman.gif' : 'public/system/images/nopic_big_man.gif'; } ?> " /></div> </div> </div> </div> <div class="cen_bottom"></div> </div>
/** * 删除形象照缩略图 * */ function unlink_mainimg($userid) { //note 形象照缩略图删除(big,small,medium,mid) $thumb_big = MooGetphoto($userid, 'big'); file_exists($thumb_big) && unlink($thumb_big); $thumb_small = MooGetphoto($userid, 'small'); file_exists($thumb_small) && unlink($thumb_small); $thumb_medium = MooGetphoto($userid, 'medium'); file_exists($thumb_medium) && unlink($thumb_medium); $thumb_mid = MooGetphoto($userid, 'mid'); file_exists($thumb_mid) && unlink($thumb_mid); $thumb_page = MooGetphoto($userid, 'page'); file_exists($thumb_page) && unlink($thumb_page); $thumb_index = MooGetphoto($userid, 'index'); file_exists($thumb_index) && unlink($thumb_index); $thumb_com = MooGetphoto($userid, 'com'); file_exists($thumb_com) && unlink($thumb_com); }
/** * 疯狂粉丝会 */ function crazyfan() { $tb_pre = $GLOBALS['dbTablePre']; $db = $GLOBALS['_MooClass']['MooMySQL']; // $scid_list = array(10 => '铂金', 20 => '钻石', 30 => '高级', 40 => '普通', 50 => '红娘'); $index = MooGetGPC('index', 'integer', 'G'); // 标示 哪个标签被点击 需要加粗显示 $n = MooGetGPC('n', 'string', 'G'); $year = (int) date('Y'); $month = (int) date('m'); switch ($n) { case 'adduid': // 推荐 $adduid = MooGetGPC('adduid', 'integer', 'G'); $user = $db->getOne("select count(*) as count, sort, score from {$tb_pre}carcrazyfan where uid={$adduid} limit 1"); if ($user['count'] == 1) { // 已存在,更改标记 if ($user['sort'] == 0) { $score = unserialize($user['score']); $cur_score = $score[$year][$month]; if ($cur_score === null) { $cur_score = 0; $score[$year][$month] = 0; $score = addslashes(serialize($score)); $db->query("update {$tb_pre}carcrazyfan set sort=1, score='{$score}' where uid={$adduid}"); } else { $db->query("update {$tb_pre}carcrazyfan set sort=1 where uid={$adduid}"); } } else { exit('isadd'); } } else { // 不存在,添加新纪录 $userinfo = $db->getOne("select gender, is_lock, images_ischeck, nickname from {$tb_pre}members_search where uid={$adduid} limit 1"); if (empty($userinfo) || $userinfo['is_lock'] == 0) { exit('nouser'); } elseif ($userinfo['images_ischeck'] != 1) { exit('nopic'); } else { $time = time(); $cur_score = 0; $score = addslashes(serialize(array($year => array($month => 0)))); $db->query("insert into {$tb_pre}carcrazyfan(uid, gender,nickname, sort, recommend_time, score) values({$adduid}, {$userinfo['gender']}, '{$userinfo['nickname']}', 1, {$time}, '{$score}')"); } } break; case 'delete': // 取消推荐 $uid = MooGetGPC('uid', 'integer', 'G'); $db->query("update {$tb_pre}carcrazyfan set sort=0 where uid={$uid}"); break; case 'history': // 历史推荐会员列表 $ajaxp = ajaxpaging("select count(*) as count from {$tb_pre}carcrazyfan where sort=0"); $pages = $ajaxp[0]; $currenturl = "index.php?action=lovestation&h=crazyfan&n=history&ajax="; $user_list = $db->getAll("select id,uid,nickname,gender, score, recommend_time from {$tb_pre}carcrazyfan where sort = 0 order by recommend_time desc limit {$ajaxp[1]}"); foreach ($user_list as $k => $user) { $score = unserialize($user['score']); $score = $score[$year][$month]; $user_list[$k]['score'] = (int) $score; } break; case 'getimg': // 获取用户头像 $uid = MooGetGPC('uid', 'integer', 'G'); if ($uid > 0) { echo 'http://www.7651.com/' . MooGetphoto($uid); } exit; break; } if ($n != 'history') { $user_list = $db->getAll("select id,uid,nickname,score, gender,recommend_time from {$tb_pre}carcrazyfan where sort > 0 order by gender"); foreach ($user_list as $key => $user) { $score = unserialize($user['score']); $cur_score = $score[$year][$month]; if ($cur_score === null) { $cur_score = 0; $score[$year][$month] = 0; $score = addslashes(serialize($score)); $db->query("update {$tb_pre}carcrazyfan set score='{$score}' where uid={$user['uid']}"); } $user_list[$key]['score'] = $cur_score; } } require adminTemplate('lovestation_crazyfan'); exit; }
function getmyleers() { global $_MooClass, $dbTablePre, $userid, $pagesize, $user_arr, $memcached; $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } //分页 if ($userid) { $page_per = 10; $page_url = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $page_url = preg_replace("/(&page=\\d+)/", "", $page_url); $page_now = MooGetGPC('page', 'integer', 'G'); $temp = $_MooClass['MooMySQL']->getOne("select count(1) as num FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0"); $item_num = $temp['num']; $page_num = ceil($item_num / $page_per); // if( $page_now > $page_num ) $page_now = $page_num; // if( $page_now < 1 ) $page_now = 1; //读数据 $start = ($page_now - 1) * $page_per; $leer = $_MooClass['MooMySQL']->getAll("SELECT senduid,stat FROM {$dbTablePre}service_leer WHERE receiveuid = '{$userid}' and receive_del=0 ORDER BY receivetime desc LIMIT {$start},{$page_per}"); if (empty($leer)) { $errors = "empty"; echo return_data($errors); exit; } $sendid = array(); if (!empty($leer)) { foreach ($leer as $k => $v) { $sendid[] = $v['senduid']; } } $send_uid = implode(',', $sendid); $senduser = $_MooClass['MooMySQL']->getAll("select s.uid, s.nickname,s.birthyear,s.marriage,s.education,s.province,s.city,s.salary, b.mainimg,l.* from {$dbTablePre}members_search s left join {$dbTablePre}members_base b on s.uid=b.uid left join {$dbTablePre}service_leer l on s.uid=l.senduid where s.uid in({$send_uid}) and l.receiveuid = '{$userid}' and l.receive_del=0 ORDER BY l.receivetime desc"); foreach ($senduser as $k => $v) { $mainimg = MooGetphoto($v['uid'], $style = "com"); $v['mainimg'] = $mainimg; foreach ($leer as $val) { if ($v['uid'] == $val['senduid']) { $v['stat'] = $val['stat']; } } $send_users[] = $v; } foreach ($leer as $key => $val) { foreach ($send_users as $va) { if ($val['senduid'] == $va['uid']) { $send_sha[] = $va; } } } echo return_data($send_sha); exit; } }
<p> <?php if ($user['images_ischeck'] == '1' && $user['mainimg']) { ?> <img src=" <?php if (MooGetphoto($user['uid'], 'com')) { ?> <?php echo MooGetphoto($user['uid'], 'com'); ?> <?php } elseif (MooGetphoto($user['uid'], 'medium')) { ?> <?php echo MooGetphoto($user['uid'], 'medium'); ?> <?php } else { ?> <?php if ($user['gender'] == '1') { ?> public/system/images/woman.gif <?php } else { ?> public/system/images/man.gif <?php } ?>
function send_mms_commission($tel, $type, $uid) { global $_MooClass, $dbTablePre, $timestamp, $user_arr; include "ework/include/crontab_config.php"; $pic_path = "./data/upload/userimg/"; $file_path = "data/mmstmp/"; if ($type == 'rose') { $mes = "真爱一生网 ID为" . $uid . "的会员给您发送了鲜花,赶快访问www.zhenaiyisheng.cc 登录您的账户了解ta的详细信息吧,同时可以搜索您的意中人,给TA送出自己的鲜花,希望您在茫茫人海中早日找寻到属于自己的幸福。"; $title = "真爱一生网鲜花提醒"; } else { $mes = "真爱一生网 ID为" . $uid . "的会员给您发送了委托,赶快访问www.zhenaiyisheng.cc 登录您的账户了解ta的详细信息吧,同时可以搜索您的意中人,给TA送出自己的委托,希望您在茫茫人海中早日找寻到属于自己的幸福。"; $title = "真爱一生网委托提醒"; } $mes_gb = iconv("UTF-8", "gb2312", "{$mes}"); //$tel=$sendto_user_info['telphone']; $mkdirs = MooAutoLoad('MooFiles'); $image = MooAutoLoad('MooImage'); $sql = "SELECT pic_date,pic_name FROM {$GLOBALS['dbTablePre']}pic where uid='{$uid}' and isimage=0 and syscheck=1 limit 5"; $user_image_arr = $_MooClass['MooMySQL']->getAll($sql); $sql = "SELECT m.uid,m.nickname,m.province,m.city,m.gender,b.pic_name,m.birthyear,c.age1,c.age2,c.workprovince,c.workcity \n FROM {$GLOBALS['dbTablePre']}members_search m\n left join {$GLOBALS['dbTablePre']}members_base b on m.uid=b.uid \n left join {$GLOBALS['dbTablePre']}members_choice c on m.uid=c.uid WHERE m.uid='{$uid}'"; $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $file_name_smil = 'temp' . time() . rand(10000, 99999); $file_array = $file_path . $file_name_smil . ".smil," . $file_path . $file_name_smil . ".txt"; $file_name = 'temp' . time() . rand(10000, 99999); $nickname1 = "昵称:" . $userinfo['nickname']; $nickname = iconv("UTF-8", "gb2312", "{$nickname1}"); $txt = " ID:" . $userinfo['uid'] . "(" . (gmdate('Y', time()) - $userinfo['birthyear']) . "岁),居住在" . ($provice_list[$userinfo['province']] || $city_list[$userinfo['city']] ? $provice_list[$userinfo['province']] . $city_list[$userinfo['city']] : "未填") . "的" . ($userinfo['gender'] ? '女士' : '男士') . "寻找一位年龄在" . $userinfo['age1'] . "-" . $userinfo['age2'] . "岁,居住" . ($provice_list[$userinfo['workprovince']] || $city_list[$userinfo['workcity']] ? $provice_list[$userinfo['workprovince']] . $city_list[$userinfo['workcity']] : "未填") . "的" . ($userinfo['gender'] ? '男士' : '女士'); $txt1 = iconv("UTF-8", "gb2312", "{$txt}"); $txt = $nickname . $txt1; $mkdirs->fileWrite($file_path . $file_name . ".txt", $txt); $pic_name_old = MooGetphoto($userinfo['uid'], 'medium'); $pic_only_name = $userinfo['uid'] * 3 . "_medium.gif"; $pic_name_file = $file_path . '/' . $pic_only_name; $pic = 'http://www.zhenaiyisheng.cc/' . $pic_name_old; $pic = file_get_contents($pic); file_put_contents($pic_name_file, $pic); $image->config(array('thumbDir' => $file_path . '/', 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_only_name, 'waterMarkMinWidth' => '100', 'waterMarkMinHeight' => '125', 'waterMarkStatus' => 9)); $image->thumb('100', '125', $pic_name_old); //$pic_name_file=$file_path.'/'.$pic_only_name; //$pic_name="5226417_mid.jpg"; $par = '<par dur="50000ms"><img src="' . $pic_only_name . '" region="Image" /><text src="' . $file_name . '.txt" region="Text" /></par>'; $file_array = $file_array . "," . $file_path . $file_name . ".txt," . $pic_name_file; foreach ($user_image_arr as $key => $user_image_name) { $user_image = thumbImgPath("2", $user_image_name['pic_date'], $user_image_name['pic_name']); $image_name_arr = explode('.', $user_image_name['pic_name']); if (file_exists("." . $user_image) && $image_name_arr[1] != 'bmp') { $image_only_name = $file_name . $key . ".gif"; list($width, $height) = getimagesize('.' . $user_image); $d = $width / $height; $c = 85 / 100; if ($d < $c) { $thumb1_width = 85; $b = $width / $thumb1_width; $thumb1_height = $height / $b; } else { $thumb1_height = 100; $b = $height / $thumb1_height; $thumb1_width = $width / $b; } $image->config(array('thumbDir' => $file_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $image_only_name, 'waterMarkMinWidth' => '82', 'waterMarkMinHeight' => '114', 'waterMarkStatus' => 9)); $image->thumb($thumb1_height, $thumb1_width, '.' . $user_image); $need_product_img[] = $file_path . $image_only_name; $file_array = $file_array . "," . $file_path . $image_only_name; $par = $par . '<par dur="50000ms"><img src="' . $image_only_name . '" region="Image" /></par>'; } } $mkdirs->fileWrite($file_path . $file_name_smil . ".txt", $mes_gb); $smil = '<smil xmlns="http://www.w3.org/2000/SMIL20/CR/Language"><head><layout><root-layout width="208" height="176" /><region id="Image" left="0" top="0" width="128" height="128" fit="hidden" /><region id="Text" left="0" top="50" width="128" height="128" fit="hidden" /></layout></head><body><par dur="50000ms"><text src="' . $file_name_smil . '.txt" region="Text" /></par>' . $par . '</body></smil>'; $mkdirs->fileWrite($file_path . $file_name_smil . ".smil", $smil); require 'ework/include/pclzip_new.lib.php'; $archive = new PclZip($file_path . $file_name_smil . '.zip'); $v_list = $archive->create($file_array, PCLZIP_OPT_REMOVE_ALL_PATH); if ($v_list == 0) { die("Error : " . $archive->errorInfo(true)); } $ret = send_mms_yimei_up($title, $tel, $file_name_smil . '.zip'); $ret_ok = substr($ret, 0, 2); if ($ret_ok == "OK") { $dateline = time(); $sql = "INSERT INTO {$GLOBALS['dbTablePre']}mmslog(sid,uid,title,content,sendtime,id_list) VALUES('000','{$uid}','{$title}','system','{$dateline}','{$uid}')"; $sid = $GLOBALS['_MooClass']['MooMySQL']->query($sql); $result = "OK"; } else { $result = false; } $mkdirs->fileDelete($file_path . $file_name_smil . '.zip'); $mkdirs->fileDelete($file_path . $file_name_smil . '.txt'); $mkdirs->fileDelete($file_path . $file_name_smil . '.smil'); $mkdirs->fileDelete($file_path . $file_name . '.txt'); $mkdirs->fileDelete($pic_name_file); if ($need_product_img) { foreach ($need_product_img as $del_img) { $mkdirs->fileDelete($del_img); } } return $result; }
<?php } ?> <?php } else { ?> <?php if (isset($users['mainimg']) && $users['mainimg'] && isset($users['images_ischeck']) && $users['images_ischeck'] == 1) { ?> <img src="<?php if (MooGetphoto($users['uid'], 'mid')) { echo MooGetphoto($users['uid'], 'mid'); } elseif (MooGetphoto($users['uid'], 'medium')) { echo MooGetphoto($users['uid'], 'medium'); } elseif (MooGetphoto($users['uid'], 'index')) { echo MooGetphoto($users['uid'], 'index'); } elseif ($users['gender'] == '1') { echo 'public/system/images/se_woman.jpg'; } else { echo 'public/system/images/se_man.jpg'; } ?> " class="personalphoto fixphoto" /> <?php } else { ?> <img src="public/system/images/se_woman.jpg" /> <?php } ?> <?php