function adminTemplate($file) { $tplfile = './templates/' . $file . '.htm'; $objfile = './data/templates/default/' . $file . '.tpl.php'; if (!is_file($objfile) || @filemtime($tplfile) > @filemtime($objfile)) { //note 加载模板类文件 $T = MooAutoLoad('MooTemplate'); $T->complie($tplfile, $objfile); } //echo $tplfile; return $objfile; }
/** * 取得所有分类信息列表 * * @return array */ function getCateArray() { if (!$this->dbClass) { $this->dbClass = MooAutoLoad('MooMySQL'); } $cateArray = array(); $query = $this->dbClass->query("SELECT * FROM {$this->dbName}"); while ($category = $this->dbClass->fetchArray($query)) { $cateArray[$category['cateid']] = $category; } return $cateArray; }
function ajax_uploadfile() { global $_MooClass; //note 允许的文件后缀,增加允许文件后缀还要更改checkFileTitle函数里面的对应文件类型检测 $allow_ext = array("jpg", "gif", "rar", "png", "bmp", "wma", "wav", "mp3"); //$allow_ext = array("wma","wav","mp3"); if (isset($_FILES['upfile'])) { $attachment = $_FILES['upfile']; $filename = trim($attachment['name']); $filesize = $attachment['size']; if (!$filesize) { $filesize = 0; } $fileext = substr(strrchr($filename, '.'), 1); //note 根据文件后缀名判断这个文件类型 if (!in_array($fileext, $allow_ext)) { echo "<script>window.parent.notUpload('2','" . $fileext . "')</script>"; exit; } //note 根据文件二进制前两位标识判断这个文件类型 $check_ext = checkFileTitle($attachment['tmp_name']); if (!in_array($check_ext, $allow_ext) || $check_ext == 'unknown') { echo "<script>window.parent.notUpload('3','" . $filename . "')</script>"; exit; } //note 上传路径 $path = "./../data/upload/emailattachment/"; //note 调用文件操作类库,建立无限级目录 $mkdirs = MooAutoLoad('MooFiles'); !is_dir($path) && $mkdirs->fileMake($path, 0777); //note 生成文件名 $file_full_name = 'temp_' . date("Ymd") . '_' . time() . '_' . rand(10000, 99999) . '.' . $fileext; $file = $path . $file_full_name; while (file_exists($file)) { $file = $path . $file_full_name; } //note 移动文件 $is_ok = false; if (!move_uploaded_file($attachment['tmp_name'], $file)) { if (copy($attachment['tmp_name'], $file)) { $is_ok = true; } else { $is_ok = false; } } else { $is_ok = true; } if ($is_ok) { //写日志 serverlog(3, $GLOBALS['dbTablePre'] . 'service', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}在后台上传文件", $GLOBALS['adminid']); $filename = iconv("utf-8", "gb2312", $filename); echo "<script>window.parent.UpdateMsg('" . $filename . "','" . $file_full_name . "','" . $filesize . "')</script>"; exit; } } }
function login_code() { //验证码 ob_clean(); $img = MooAutoLoad('MooSeccode'); $img->outCodeImage(100, 20, 4); }
function site_story_edit() { global $story_sweet_process, $_MooClass, $dbTablePre, $memcached; $ispost = MooGetGPC('ispost', 'integer', 'P'); $imgpost = MooGetGPC('imgpost', 'integer', 'P'); //$MooImage = MooAutoLoad('MooImage'); if ($imgpost == '1') { $story_picname = MooGetGPC('imgUrl', 'string', 'P'); $sid = MooGetGPC('sid', 'integer', 'P'); $mid = MooGetGPC('mid', 'integer', 'P'); //重新生成小图 覆盖原来的首页照 $src = IMG_ROOT . $story_picname; $sidmd5 = $sid * 3; $size = getimagesize($src, $info); $width = $size['0']; $height = $size['1']; $sizearray = array(0 => array('width' => 280, 'height' => 168), 1 => array('width' => 252, 'height' => 151), 2 => array('width' => 150, 'height' => 90)); $namearray = array(0 => 'big', 1 => 'medium', 2 => 'small'); $newimages = changesize($src, '../data/upload/story', 0, 0, $width, $height, $sid, $sizearray, $namearray); $sql = "UPDATE {$GLOBALS['dbTablePre']}story SET is_index='{$mid}' WHERE sid='{$sid}'"; $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql); if ($res) { echo 1; } exit; } if ($ispost == '1') { $sid = trim(MooGetGPC('sid', 'integer', 'P')); $title = htmlspecialchars(trim(MooGetGPC('title', 'string', 'P'))); $content = htmlspecialchars(trim(MooGetGPC('content', 'string', 'P'))); $confirmtime = htmlspecialchars(MooGetGPC('confirmtime', 'string', 'P')); $story_date = ''; if ($confirmtime) { $story_date1 = htmlspecialchars(MooGetGPC('confirmtime', 'string', 'P')); $story_date = strtotime($story_date1); } else { $story_date1 = trim(MooGetGPC('date', 'string', 'P')); $story_date = strtotime($story_date1); } $name1 = trim(MooGetGPC('name1', 'string', 'P')); $name1 = htmlspecialchars($name1); $name2 = trim(MooGetGPC('name2', 'string', 'P')); $name2 = htmlspecialchars($name2); $state = trim(MooGetGPC('state', 'integer', 'P')); $syscheck = trim(MooGetGPC('pass', 'integer', 'P')); $recommand = trim(MooGetGPC('recommand', 'integer', 'P')); $hot = trim(MooGetGPC('clicknum', 'integer', 'P')); date_default_timezone_set('Asia/Shanghai'); $submit_date = time(); $imgtitle = trim(MooGetGPC('imgtitle', 'string', 'P')); $imgtitle = htmlspecialchars($imgtitle); //note 上传新图片 //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp'); $maxfilesize = 1024 * 1024; $filesize = $_FILES['img']['size']; if (!empty($filesize)) { foreach ($images as $v) { if (strpos($_FILES['img']['type'], $v) == true) { $flag = 1; } } if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessageAdmin($notice, 'index.php?action=site_story&h=edit&id=' . $sid, 0); exit; } if ($filesize > $maxfilesize) { $notice = "上传图片大小不得超过1M"; MooMessageAdmin($notice, 'index.php?action=site_story&h=edit&id=' . $sid, 0); exit; } //note 上传到指定目录,并且获得上传后的文件描述 global $upload; $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => IMG_ROOT, 'saveType' => '0')); $files = $upload->saveFiles('img'); $story_picname = $files[0]['name'] . "." . $files[0]['extension']; $filetype = explode('.', $story_picname); $filetype = array_pop($filetype); //生成小图 /* $src = IMG_ROOT.$story_picname; $sidmd5=$sid*3; $size = getimagesize($src,$info); $width = $size['0']; $height = $size['1']; $sizearray=array(0=>array('width'=>280,'height'=>168),1=>array('width'=>252,'height'=>151),2=>array('width'=>150,'height'=>90)); $namearray=array(0=>'big',1=>'medium',2=>'small'); $newimages=changesize($src,'../data/upload/story',0,0,$width,$height,$sid,$sizearray,$namearray); */ $res_in_pic = ''; if ($story_picname) { //note 插入story_pic表 $sql_in_spic = "INSERT INTO {$GLOBALS['dbTablePre']}story_pic SET sid='{$sid}',img='{$story_picname}',title='{$imgtitle}',submit_date='{$submit_date}',syscheck='{$syscheck}'"; $res_in_pic = $GLOBALS['_MooClass']['MooMySQL']->query($sql_in_spic); } } $sql = "UPDATE {$GLOBALS['dbTablePre']}story SET title='{$title}',content='{$content}',story_date='{$story_date}',name1='{$name1}',name2='{$name2}',state='{$state}',syscheck='{$syscheck}',recommand='{$recommand}',hot='{$hot}' WHERE sid='{$sid}' "; $sql_up_pic = "UPDATE {$GLOBALS['dbTablePre']}story_pic SET syscheck='{$syscheck}' WHERE sid='{$sid}'"; $res = $GLOBALS['_MooClass']['MooMySQL']->query($sql); $res_up_pic = $GLOBALS['_MooClass']['MooMySQL']->query($sql_up_pic); //note 更新缓存 $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 6/cachetime=86400"; $cachekey = md5($param); // $file = MOOPHP_DATA_DIR.'/block/story_'.$cachekey.'.data'; if ($memcached->get('story_' . $cachekey)) { $memcached->delete('story_' . $cachekey); } $_MooClass['MooCache']->getBlock($param); $story = $GLOBALS['_MooBlock']['story']; //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'story', '编辑成功故事', $GLOBALS['adminid']); salert("编辑成功", "index.php?action=site_story&h=edit&id=" . $sid); exit; } //note 编辑图片页面 $sid = MooGetGPC('id', 'integer', 'G'); $sid = intval($sid); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}story WHERE `sid` = '{$sid}'"; $sql_pic = "SELECT * FROM {$GLOBALS['dbTablePre']}story_pic WHERE `sid` = '{$sid}'"; $editStory = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $editPic = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql_pic); require adminTemplate('site_story_edit'); }
function code() { //验证码 $img = MooAutoLoad('MooSeccode'); $img->outCodeImage(125, 30, 4); }
/** * 加载模板 * @param string $path - 模板文件路径 (包含皮肤目录和文件名) 如: default/na * @param string $type - 模板类型 {module:module里模块模板;public:public下的公共模板;data:data下的用户定制模板} * @return string 返回编译后模板的系统绝对路径 */ function MooTemplate($path, $type) { switch ($type) { case 'module': $tpl_path = MOOPHP_TEMPLATE_DIR . '/' . $path . '.htm'; //aaa.htm break; case 'public': $tpl_path = 'public/' . $path . '.htm'; break; case 'data': $path = substr($GLOBALS['style_uid'], -1) . '/' . $GLOBALS['style_uid'] . '/' . $GLOBALS['style_uid'] . '_' . $path; $tpl_path = 'data/diamond/' . $path . '.htm'; if (!file_exists($tpl_path)) { MooMessage('您访问的页面不存在'); exit; } break; default: exit('$type error'); } $php_path = MOOPHP_DATA_DIR . '/templates/' . $type . '/' . $path . '.tpl.php'; if (!file_exists($php_path) || filemtime($tpl_path) > filemtime($php_path)) { //note 加载模板类文件 $T = MooAutoLoad('MooTemplate'); $T->complie($tpl_path, $php_path); } return $php_path; }
/** * 保存处理单个文件 * * @return string */ function saveFile(&$file) { $upFile = $imageFile = array(); $this->getSubDir(); $upFile['path'] = $this->targetDir; $upFile['filename'] = $file['name']; $upFile['name'] = date("YmdHis") . $this->random(10, 1); $upFile['extension'] = $this->getExtension($file['name']); $upFile['size'] = $file['size']; $upFile['isimage'] = 0; $imageFile['size'] = $file['size']; $destination = $upFile['path'] . $upFile['name'] . '.' . $upFile['extension']; if (move_uploaded_file($file['tmp_name'], $destination)) { if (in_array($upFile['extension'], array('jpg', 'jpeg', 'gif', 'png', 'swf', 'bmp')) && function_exists('getimagesize') && !@getimagesize($destination)) { unlink($destination); //uploadError('Not Expected Attachment!'); } elseif (in_array($upFile['extension'], array('jpg', 'jpeg', 'gif', 'png', 'bmp'))) { if ($this->thumbStatus || $this->waterMarkStatus) { if (!$this->imageClass) { $this->imageClass = MooAutoLoad('MooImage'); } $this->imageClass->image($destination, $imageFile); if (!$this->imageConfiged) { $this->imageClass->config($this->imageConfig); $this->imageConfiged = true; } $this->imageClass->thumbStatus && $this->imageClass->thumb(); $this->imageClass->waterMarkStatus && $this->imageClass->Watermark(); $upFile = array_merge($this->imageClass->upFile, $upFile); } $upFile['isimage'] = 1; } return $upFile; } }
function imagick_rotate() { global $_MooClass; $pic_path = MooGetGPC('pic_path', 'string', 'G'); //$id = MooGetGPC('id','integer','G'); //$uid = MooGetGPC('uid','integer','G'); $degrees = 90; $file = explode('.', $pic_path); $count = count($file); if ($count == 2) { $new_file = '../' . $file[0] . '.1.' . $file[1]; } elseif ($count == 3) { $new_file = '../' . $file[0] . '.' . ($file[1] + 1) % 4 . '.' . $file[2]; } $pic_path = '../' . $pic_path; $source = imagecreatefromjpeg($pic_path); $rotate = imagerotate($source, $degrees, 0); // var_dump($pic_path); list($imagewidth, $imageheight, $imageType) = getimagesize($pic_path); $imageType = image_type_to_mime_type($imageType); switch ($imageType) { case "image/gif": imagegif($rotate, $new_file, 100); break; case "image/pjpeg": case "image/jpeg": case "image/jpg": imagejpeg($rotate, $new_file, 100); break; case "image/png": case "image/x-png": imagepng($rotate, $new_file, 100); break; case "image/bmp": imagewbmp($rotate, $new_file, 100); break; } if ($count == 3) { $files = MooAutoLoad("MooFiles"); $files->fileDelete('../' . $file[0] . '.' . $file[1] % 4 . '.' . $file[2]); echo $file[1]; } else { echo 0; } }
function report($uid) { global $_MooClass, $dbTablePre, $userid, $user_arr, $timestamp; $serverid = Moo_is_kefu(); if ($serverid && $user_arr['usertype'] != 3) { MooMessage('对不起您不能模拟操作', 'javascript:history.go(-1);', '04'); exit; } //处理会员提交了数据 if (MooGetGPC('reportbutton', 'string', 'P')) { $u_id = safeFilter(MooGetGPC('uid', 'string', 'P')); $ruid = safeFilter(MooGetGPC('ruid', 'string', 'P')); $forwhy = MooGetGPC('forwhy', 'integer', 'P'); $umail = safeFilter(MooGetGPC('umail', 'string', 'P')); $content = safeFilter(MooGetGPC('content', 'string', 'P')); if ($forwhy == '0') { MooMessage('请选择您的举报原因', 'javascript:history.go(-1);'); exit; } if (rtrim($content) == '') { MooMessage('请选择您的举报内容', 'javascript:history.go(-1);'); exit; } //note 上传图片 if ($_FILES['pic']['size'] <= 5242880 && !empty($_FILES['pic']['size'])) { $extname = strtolower(substr($_FILES['pic']['name'], strrpos($_FILES['pic']['name'], '.') + 1)); //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP'); //foreach($images as $v) { //if(preg_match("/$v/",$_FILES['pic']['type'])) { $img_type = explode("/", $_FILES['pic']['type']); if (in_array($img_type[1], $images) && in_array($extname, $images)) { $flag = 1; } //} if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessage($notice, 'javascript:history.go(-1);'); exit; } //note 上传到指定目录,并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => REPORT_IMG_PATH, 'saveType' => '0')); $files = $upload->saveFiles('pic'); $report_picname = $files[0]['name'] . "." . $files[0]['extension']; //note 提交举报数据 $_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,pic,addtime) values ('{$u_id}','{$ruid}','{$forwhy}','{$umail}','{$content}','{$report_picname}','" . time() . "')"); //note 没有上传图片 } else { if ($_FILES['pic']['size'] > 5242880) { MooMessage('上传图片大小不能超过5M', 'javascript:history.go(-1);'); } else { MooMessage('必须上传图片作为举报证据', 'javascript:history.go(-1);'); } //note 提交举报数据 //$_MooClass['MooMySQL']->query("insert into {$dbTablePre}report (uid,ruid,forwhy,umail,content,addtime) values ('$u_id','$ruid','$forwhy','$umail','$content','".time()."')"); } //************提醒所属客服************** $sid = $user_arr['sid']; $title = '您的会员 ' . $user_arr['uid'] . ' 举报了 ' . $ruid; $awoketime = $timestamp + 3600; $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'"; $res = $_MooClass['MooMySQL']->query($sql_remark); MooMessage('举报成功', 'javascript:history.go(-2);'); exit; } //note 两天内对同一位会员投诉只限一次 $reportcount1 = $_MooClass['MooMySQL']->getOne("select id from {$dbTablePre}report where uid='{$userid}' and ruid='{$uid}' and addtime>" . mktime(0, 0, 0, date('m', time() - 86400), date('d', time() - 86400), date('Y', time() - 86400))); if ($reportcount1) { MooMessage('对不起,您两天内对同一位会员投诉只限一次', 'javascript:history.go(-1);', '02'); exit; } else { //note 第天只能投诉5位会员 $reportcount = $_MooClass['MooMySQL']->getOne("select count(*) from {$dbTablePre}report where uid='{$userid}' and addtime>" . mktime(0, 0, 0, date('m', time()), date('d', time()), date('Y', time()))); if ($reportcount['count(*)'] >= 5) { MooMessage('对不起,您每天只能对5位不同的会员进行投诉', 'javascript:history.go(-1);', '02'); exit; } } //被投诉人不可能是自己 if ($userid == $uid) { MooMessage('不可以举报自己', 'javascript:history.go(-1);', '03'); } //被投诉人信息 if (MOOPHP_ALLOW_FASTDB) { $userinfo = MooFastdbGet('members_search', 'uid', $uid); } else { $userinfo = $_MooClass['MooMySQL']->getOne("select * from {$dbTablePre}members_search as s left join {$dbTablePre}members_base as b on s.uid=b.uid where uid='{$uid}'"); } $sql = "select count(*) as c from {$dbTablePre}pic where uid='{$uid}' and isimage=0"; $pic_num = $_MooClass['MooMySQL']->getOne($sql); if (!$userinfo) { MooMessage('无此用户', 'javascript:history.go(-1);', '03'); exit; } include MooTemplate('public/profile_index', 'module'); }
tag_search($tagname, $sex, $tagid); } else { require MooTemplate('public/search_tag_more', 'module'); } break; case 'cityinline': //note if (!$GLOBALS['MooUid']) { header("Location:login.html"); exit; } if ($user_arr['s_cid'] == '30' || $user_arr['s_cid'] == '20' || $user_arr['s_cid'] == '10') { search_cityinline(); } else { MooMessage("对不起,您不是高级会员,请升级为高级会员!", "index.php?n=payment", '02'); } break; case 'test': //note 测试页面 $image = MooAutoLoad('MooImage'); //各个参数的意义可以看下面对应的说明 $image->config(array('waterMarkMinWidth' => '400', 'waterMarkMinHeight' => '300', 'waterMarkStatus' => 9)); $image->thumb(200, 100, '1.gif'); $image->waterMark(); break; default: basic_search(); break; } ?> <!--comment-->
function diamond_recommend() { $key = 'web_star'; $uid = MooGetGPC('uid', 'integer', 'G'); $fileClass = MooAutoLoad('MooFiles'); $file = '../data/cache/diamond_intro.php'; $fileClass->fileOpen($file, 'a+'); $fileClass->fileWrite($file, $uid . ',', 'a+'); echo "<script>alert('设置成功');location.href='index.php?action=site_diamond&h=intro';</script>"; }
/** * search类调用接口 * @param $index */ function searchApi($index) { static $sp = array(); if (empty($index)) { return null; } if (!isset($sp[$index]) || !is_object($sp[$index])) { $sp[$index] = MooAutoLoad("MooSearch"); $sp[$index]->setIndex($index); } return $sp[$index]; }
*/ error_reporting(0); $h = MooGetGPC('h', 'string'); //$h = in_array ( $h, array ('stepone', 'stepsix', 'validateemail', 'seccode', 'incenter', 'serverrule' ) ) ? $h : 'stepone'; $h = in_array($h, array('stepone')); // note 解密Cookies /* * if ($_MooCookie['auth']){ list($username, $password, $uid) = * MooAddslashes(explode("\t", MooAuthCode($_MooCookie['auth'], 'DECODE'))); } * //$uid = 14; $user = $_MooClass['MooMySQL']->getOne("SELECT * FROM * {$dbTablePre}members as m,web_memberfield as mf WHERE m.uid='$uid' AND * m.uid=mf.uid"); $c = $_MooClass['MooMySQL']->getOne("SELECT * FROM * {$dbTablePre}choice WHERE uid='$uid'"); //实例化数据验证类 */ $_MooCookie['auth'] = ''; $v = MooAutoLoad('MooValidation'); switch ($h) { case "stepone": global $_MooClass, $user_arr, $memcached, $_MooCookie; if ($_SERVER['REQUEST_METHOD'] == 'POST') { $error = array(); $istueiguang = MooGetGPC('istueiguang', 'string'); $friendprovince = ''; if (empty($istueiguang)) { } $username = MooGetGPC('username', 'string'); $password = MooGetGPC('password', 'string'); $password2 = MooGetGPC('password2', 'string'); $gender = MooGetGPC('gender', 'integer'); $telphone = MooGetGPC('telphone', 'string'); $birthyear = MooGetGPC('year', 'integer');
function material_imgactive() { header("Content-Type: text/plain"); $temp_path = 'data/upload/images/tmp/'; $dst_im = trim(MooGetGPC('dstim', 'string', 'G')); $src_im = trim(MooGetGPC('srcim', 'string', 'G')); $photo_img = base64_decode($dst_im); //原图片地址 $fileInfo = pathinfo($photo_img); //data/upload/images/photo/2009/11/27/orgin/2009112721102554032.JPG $temp_im = str_replace($temp_path, '', $dst_im); //list($base64_name, $img_ext) = preg_split("(\_\d\.)",$temp_im); $base64_name = $temp_im; $temp_img_1 = $temp_path . $dst_im . '_1.' . $fileInfo['extension']; $temp_img_2 = $temp_path . $dst_im . '_2.' . $fileInfo['extension']; $dst_im = $temp_img_1; //echo $temp_img_1; $action = trim(MooGetGPC('act', 'string', 'G')); $act_arr = array('composite', 'undo', 'redo', 'save'); if (!file_exists($temp_img_1) || !in_array($action, $act_arr)) { echo "{imageFound:false}"; exit; } switch ($action) { case 'composite': //合成 if (!file_exists($src_im)) { echo "{imageFound:false}"; exit; } $x1 = MooGetGPC('x1', 'integer', 'G'); $y1 = MooGetGPC('y1', 'integer', 'G'); $src_w = MooGetGPC('width', 'integer', 'G'); $src_h = MooGetGPC('height', 'integer', 'G'); $dst_im = new Imagick($dst_im); $src_im = new Imagick($src_im); $dw = new ImagickDraw(); //$dw->setGravity(Imagick::GRAVITY_SOUTHEAST);//设置位置 $dw->composite($src_im->getImageCompose(), $x1, $y1, $src_w, $src_h, $src_im); $dst_im->drawImage($dw); copy($temp_img_1, $temp_img_2); $dst_im->writeImage($temp_img_1); //保存图片 break; case 'undo': if (file_exists($temp_img_2)) { copy($temp_img_2, $temp_img_2 . '.tmp'); rename($temp_img_1, $temp_img_2); rename($temp_img_2 . '.tmp', $temp_img_1); } break; case 'redo': copy($temp_img_1, $temp_img_2); copy($photo_img, $temp_img_1); break; case 'save': //echo 'I am save';exit; list($width, $height) = getimagesize($photo_img); $temp = explode('/', $photo_img); $tmp_name = explode('.', array_pop($temp)); // 弹出数组最后一个单元(图片名称.扩展) array_pop($temp); // 弹出 orgin $path = implode('/', $temp) . '/'; if ($_GET['cover'] == 'no') { //不覆盖 $dt = substr($tmp_name[0], 0, 14); $pic_date = substr($dt, 0, 4) . '/' . substr($dt, 4, 2) . '/' . substr($dt, 6, 2); do { $tmp_name[0] = $dt . rand(1111111111, 9999999999.0); $tmp = $path . 'orgin/' . $tmp_name[0] . '.' . $tmp_name[1]; } while (file_exists($tmp)); global $_MooClass, $dbTablePre, $userid; //note 查询出来的总数 $total = $_MooClass['MooMySQL']->getOne("select count(*) as num from `{$dbTablePre}pic` where `uid` = '{$userid}' AND `isimage` = '0'", true); if ($total['num'] >= 20) { echo '{imageFound:false,errMsg:"您已经有20张照片了,请选择覆盖保存。"}'; exit; } copy($temp_img_1, $tmp); //另存为 $sql = "INSERT INTO {$dbTablePre}pic (uid,imgurl,pic_date,pic_name) \n\t\t\t\t\tvalues ('{$userid}','{$tmp}','{$pic_date}',\n\t\t\t\t\t\t\t'" . $tmp_name[0] . '.' . $tmp_name[1] . "')"; $_MooClass['MooMySQL']->query($sql); } else { copy($temp_img_1, $photo_img); //覆盖 } $thumb_name = md5($tmp_name[0]) . '.' . $tmp_name[1]; //缩略图片name $thumb1 = $path . '41_57/'; $thumb2 = $path . '139_189/'; $thumb3 = $path . '171_244/'; $MooImage = MooAutoLoad('MooImage'); $new_thumb_wh = get_thumb_HW($width, $height, 41, 57); $MooImage->config(array('thumbDir' => $thumb1, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_name)); $MooImage->thumb($new_thumb_wh['width'], $new_thumb_wh['height'], $temp_img_1); $new_thumb_wh = get_thumb_HW($width, $height, 139, 189); $MooImage->config(array('thumbDir' => $thumb2, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_name)); $MooImage->thumb($new_thumb_wh['width'], $new_thumb_wh['height'], $temp_img_1); $new_thumb_wh = get_thumb_HW($width, $height, 171, 244); $MooImage->config(array('thumbDir' => $thumb3, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_name)); $MooImage->thumb($new_thumb_wh['width'], $new_thumb_wh['height'], $temp_img_1); unlink($temp_img_1); file_exists($temp_img_2) && unlink($temp_img_2); break; } $temp = explode('_', $temp_img_1); $temp_img_1 = str_replace($temp_path, '', $temp[0]); echo '{imageFound:true,imageName:"' . $temp_img_1 . '"}'; exit; }
function story_upload() { global $_MooClass, $dbTablePre, $userid, $timestamp; global $user_arr; //note 获得那几个步骤 $story1 = MooGetGPC('story1', 'string'); $story2 = MooGetGPC('story2', 'string'); $pics = MooGetGPC('pics', 'string'); //note 提交第一步的变量赋值 if ($story1) { $name1 = safeFilter(MooGetGPC('name1', 'string')); $name2 = safeFilter(MooGetGPC('name2', 'string')); $state = MooGetGPC('state', 'integer'); $year = MooGetGPC('year', 'integer'); $month = MooGetGPC('month', 'integer'); $day = MooGetGPC('day', 'integer'); } //note 提交第二步变量赋值 if ($story2 || $pics) { $title = safeFilter(MooGetGPC('subject', 'string')); $content = safeFilter(MooGetGPC('content', 'string')); $insert_id = MooGetGPC('insertId', 'integer'); $img_title = safeFilter(MooGetGPC('imgTitle', 'string')); } //note 如果已经提交故事就显示标题和内容,爱情进程,时间 $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); //note 提交故事第一步 if ($story1 && $name1 && $name2 && $state && $year && $month && $day) { //note 如果没有选择甜蜜进程就退出 $storybasic = $_COOKIE['storybasic']; $state == '-1' && exit; $story_date = mktime(0, 0, 0, $month, $day, $year); //note 已经写故事了,就更新已有的故事 //判断是否更新 $str = $name1 . $name2 . $state . $story_date; $md5str = md5($str); if ($love_story['sid']) { if ($md5str != $storybasic) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET name1 = '{$name1}',name2 = '{$name2}',state = '{$state}',story_date = '{$story_date}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$love_story['sid']}'"); } $insert_id = $love_story['sid']; } else { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story (uid,name1,name2,state,story_date,submit_date) values ('{$userid}','{$name1}','{$name2}','{$state}','{$story_date}','{$timestamp}')"); $insert_id = $_MooClass['MooMySQL']->insertId(); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); require MooTemplate('public/story_upload2', 'module'); //note 更新提交故事第二步 } else { if ($story2 && $insert_id) { $storycontent = isset($_COOKIE['storycontent']) ? $_COOKIE['storycontent'] : ''; $md5content = md5($title . $content); if ($md5content != $storycontent) { $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}', syscheck = '0' WHERE sid = '{$insert_id}'"); $lsql = "UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}', syscheck = '0' WHERE sid = '{$insert_id}'"; } //提示消息 MooMessage("您的爱情故事已上传成功,感谢您和我们分享您的幸福。", "index.php?n=story", '05'); //note 上传相册中的照片的时候 } else { if ($pics && $insert_id) { $album = $_MooClass['MooMySQL']->getAll("SELECT count(1) as count FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); //note 如果上传照片超过30个图片,不允许上传 if ($album['count'] > '30') { MooMessage("您上传的图片已满30张!不可以在上传新的图片了", "index.php?n=story", '03'); } //note 判断上传的文件类型 $flag = ''; $images = array('jpg', 'jpeg', 'gif', 'png', 'bmp', 'JPG', 'JPEG', 'GIF', 'PNG', 'BMP'); $maxfilesize = 1024 * 1024; $filesize = $_FILES['pic']['size']; foreach ($images as $v) { if (eregi($v, $_FILES['pic']['type'])) { $file_content = file_get_contents($_FILES['pic']['tmp_name']); $low_file_content = strtolower($file_content); $pos = strpos($low_file_content, '<?php'); if ($pos) { $notice = "照片中含有不安全信息请重新上传"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } else { $flag = 1; } } } if ($flag != 1) { $notice = "照片必须为BMP,JPG,PNG或GIF格式"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } if ($filesize > $maxfilesize) { $notice = "上传图片大小不得大于1M"; MooMessage($notice, 'index.php?n=story&h=upload'); exit; } //note 上传到指定目录,并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => STORY_IMG_PATH, 'saveType' => '0')); $files = $upload->saveFiles('pic'); $story_picname = $files[0]['name'] . "." . $files[0]['extension']; $_MooClass['MooMySQL']->query("UPDATE {$dbTablePre}story SET title = '{$title}',content = '{$content}',submit_date = '{$timestamp}' WHERE sid = '{$insert_id}'"); if ($story_picname) { $_MooClass['MooMySQL']->query("INSERT INTO {$dbTablePre}story_pic (img,sid,uid,submit_date,title) values ('{$story_picname}','{$insert_id}','{$userid}','{$timestamp}','{$img_title}')"); } //note 查询出相册 $album = $_MooClass['MooMySQL']->getAll("SELECT * FROM {$dbTablePre}story_pic WHERE uid = '{$userid}'"); $love_story = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}story WHERE uid = '{$userid}'"); $prompt = '<script>alert("上传成功,您可以继续上传")</script>'; include MooTemplate('public/story_upload2', 'module'); } else { //note 故事日期 $story_date = $love_story['story_date']; $show_year = date("Y", $story_date); $show_month = date("n", $story_date); $show_date = date("j", $story_date); $md5str = $love_story['name1'] . $love_story['name2'] . $love_story['state'] . $love_story['story_date']; $md5basic = md5($md5str); setcookie("storybasic", $md5basic); include MooTemplate('public/story_upload1', 'module'); } } } }
function 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; } }
function material_photo_upload() { global $_MooClass, $dbTablePre, $userid, $user, $pic_size_arr, $user_arr, $memcached; $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = $user = MooMembersData($userid); $user_rank_id = get_userrank($userid); if (MOOPHP_ALLOW_FASTDB) { $usercer = MooFastdbGet('certification', 'uid', $userid); } else { $usercer = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid='{$userid}' LIMIT 1 ", true); } if ($_POST['isupload'] == '1') { //note 设定用户id $memberid = $userid; //note 设定用户上传图片大小限制 最小10240字节 = 10k 最大419430字节 = 400K $minfilesize = 20480; $maxfilesize = 1024000; $filesize = $_FILES['userfile']['size']; if ($filesize > $maxfilesize) { $notice = "请上传小于1000KB的照片。"; echo return_data($notice); exit; } if ($filesize < $minfilesize) { $notice = "请上传大于20KB的照片。"; echo return_data($notice); exit; } //note 判断文件类型 $flag = ''; $true_type = file_type($_FILES['userfile']['tmp_name']); $extname = strtolower(substr($_FILES['userfile']['name'], strrpos($_FILES['userfile']['name'], '.') + 1)); $images = array('/jpg/', '/jpeg/', '/gif/', '/png/', '/JPG/', '/JPEG/', '/GIF/', '/PNG/'); if (in_array('/' . $extname . '/', $images)) { foreach ($images as $v) { //note http://ask.wangmeng.cn/question/76 if (preg_match($v, $_FILES['userfile']['type']) && ('image/' . $true_type == $_FILES['userfile']['type'] || 'image/p' . $true_type == $_FILES['userfile']['type'] || 'image/x-' . $true_type == $_FILES['userfile']['type'])) { $file_content = file_get_contents($_FILES['userfile']['tmp_name']); $low_file_content = strtolower($file_content); $pos = strpos($low_file_content, '<?php'); if ($pos) { $notice = "照片中含有不安全信息请重新上传"; echo return_data($notice); exit; } else { $flag = 1; } } } } //echo $true_type,'_',$flag,'_',$_FILES['userfile']['type'];exit; if ($flag != 1) { $notice = "请上传JPEG,JPG,PNG或GIF格式"; echo return_data($notice); exit; } //note 设定该用户最多上传20张图片(形象照除外) $maxuploadnum = 20; //note 查询出来的总数 $query = $_MooClass['MooMySQL']->getOne("select count(1) as num from `{$dbTablePre}pic` where `uid` = '{$memberid}' AND `isimage` = '0'", true); $total = $query['num']; //note 还可以上传多少张 $leave_num = $maxuploadnum - $total; if ($leave_num <= 0) { $notice = '您已经有' . $maxuploadnum . '张照片了,'; if ($user_arr['mainimg']) { $notice .= '不可以再上传了。'; } else { $notice .= '请在相册中选一张作为形象照。'; } echo return_data($notice); exit; } //note 设定相册名 $album = ''; //note 设定全局路径 $orgin = "orgin"; //note 原图文件夹名 $thumb_path = PIC_PATH; //图片路径 $timestat = time(); $thumb_datedir = date("Y", $timestat) . "/" . date("m", $timestat) . "/" . date("d", $timestat); //原图路径 $main_img_path = $thumb_path . "/" . $thumb_datedir . "/" . $orgin . "/"; //note 调用文件操作类库,建立无限级目录 $mkdirs = MooAutoLoad('MooFiles'); !is_dir($main_img_path) && $mkdirs->fileMake($main_img_path, 0777); //note 上传到指定目录(原图),并且获得上传后的文件描述 $upload = MooAutoLoad('MooUpload'); $upload->config(array('targetDir' => $main_img_path, 'saveType' => '0')); $files = $upload->saveFiles('userfile'); //note 获得图片路径和缩略图的路径 $imgurl = $files[0]['path'] . $files[0]['name'] . "." . $files[0]['extension']; if ($files[0]['extension'] == 'gif') { $output = imagecreatefromgif($imgurl); imagegif($output, $imgurl, 100); imagedestroy($output); } $imgurl2 = $files[0]['path'] . $files[0]['name'] . "_nowater." . $files[0]['extension']; @copy($imgurl, $imgurl2); //拷贝一张无水印图片(用于形象照) $pic_name = $files[0]['name'] . "." . $files[0]['extension']; $pic_name2 = $files[0]['name'] . "_nowater." . $files[0]['extension']; $first = new Imagick($imgurl); //写入水印 $second = new Imagick('public/system/images/logo_original.png'); //$second->setImageOpacity (0.4);//设置透明度 $dw = new ImagickDraw(); $dw->setGravity(Imagick::GRAVITY_SOUTHEAST); //设置位置 //$dw->setGravity(Imagick::GRAVITY_SOUTH);//设置位置 $dw->composite($second->getImageCompose(), 0, 0, 50, 0, $second); $first->drawImage($dw); $first->writeImage($imgurl); //将第一张图片的大小控制成我们需要的大小 list($width, $height) = getimagesize($imgurl); $d = $width / $height; $off_wh = off_WH($width, $height); $new_width = $off_wh['width']; $new_height = $off_wh['height']; unset($off_wh); $big_path = $files[0]['path']; $big_name = $files[0]['name'] . '.' . $files[0]['extension']; $image = MooAutoLoad('MooImage'); $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9)); $image->thumb($new_width, $new_height, $imgurl); $image->waterMark(); //note 缩略无水印图片 $image->config(array('thumbDir' => $big_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $pic_name2, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9)); $image->thumb($new_width, $new_height, $imgurl2); $image->waterMark(); $thumb1_width = $pic_size_arr["1"]["width"]; $thumb1_height = $pic_size_arr["1"]["height"]; $thumb2_width = $pic_size_arr["2"]["width"]; $thumb2_height = $pic_size_arr["2"]["height"]; $thumb3_width = $pic_size_arr["3"]["width"]; $thumb3_height = $pic_size_arr["3"]["height"]; //note 生成日期目录 $thumb1_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb1_width . "_" . $thumb1_height . "/"; $thumb2_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb2_width . "_" . $thumb2_height . "/"; $thumb3_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb3_width . "_" . $thumb3_height . "/"; !is_dir($thumb1_path) && $mkdirs->fileMake($thumb1_path, 0777); !is_dir($thumb2_path) && $mkdirs->fileMake($thumb2_path, 0777); !is_dir($thumb3_path) && $mkdirs->fileMake($thumb3_path, 0777); //note 缩略图文件名 $thumb_filename = md5($files[0]['name']) . "." . $files[0]['extension']; $c = 41 / 57; if ($d > $c) { $thumb1_width = 41; $b = $width / $thumb1_width; $thumb1_height = $height / $b; } else { $thumb1_height = 57; $b = $height / $thumb1_height; $thumb1_width = $width / $b; } $image->config(array('thumbDir' => $thumb1_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9)); $image->thumb($thumb1_width, $thumb1_height, $imgurl); $image->waterMark(); $c = 139 / 189; if ($d > $c) { $thumb2_width = 139; $b = $width / $thumb2_width; $thumb2_height = $height / $b; } else { $thumb2_height = 189; $b = $height / $thumb2_height; $thumb2_width = $width / $b; } $image->config(array('thumbDir' => $thumb2_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '139', 'waterMarkMinHeight' => '189', 'waterMarkStatus' => 9)); $image->thumb($thumb2_width, $thumb2_height, $imgurl); $image->waterMark(); $c = 171 / 244; if ($d > $c) { $thumb3_width = 171; $b = $width / $thumb3_width; $thumb3_height = $height / $b; } else { $thumb3_height = 244; $b = $height / $thumb3_height; $thumb3_width = $width / $b; } $image->config(array('thumbDir' => $thumb3_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '171', 'waterMarkMinHeight' => '244', 'waterMarkStatus' => 9)); $image->thumb($thumb3_width, $thumb3_height, $imgurl); $image->waterMark(); //note 设定是否是形象照 1为形象照,0为普通照 $isimage = (int) $_POST['isimage']; $updatetime = time(); if ($isimage === 1) { $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_base` set `mainimg`='{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}' where `uid` = '{$memberid}'"); $_MooClass['MooMySQL']->query("update `{$dbTablePre}members_search` set images_ischeck='2' where `uid` = '{$memberid}'"); if (MOOPHP_ALLOW_FASTDB) { $image_arr = array(); $image_arr['mainimg'] = $imgurl; $image_arr['pic_date'] = $thumb_datedir; $image_arr['pic_name'] = $pic_name; $members_search['images_ischeck'] = '2'; MooFastdbUpdate('members_base', 'uid', $memberid, $image_arr); MooFastdbUpdate('members_search', 'uid', $memberid, $members_search); } searchApi("members_man members_women")->updateAttr(array('images_ischeck'), array($memberid => array(0))); UpdateMembersSNS($userid, '修改了形象照'); } //note 写入相册表 $isimage = 0; //web_members.mainimg == web_pic.imgurl 即形象照 $_MooClass['MooMySQL']->query("insert into `{$dbTablePre}pic` set `uid` = '{$memberid}',`isimage` = '{$isimage}',`album` = '{$album}',`imgurl` = '{$imgurl}',`pic_date` = '{$thumb_datedir}',`pic_name` = '{$pic_name}'"); //提交会员动态makui UpdateMembersSNS($userid, '修改了相册'); $notice = "成功"; echo return_data($notice); exit; } else { $user1 = $user_arr; } }
function material_upinfo_submit() { global $_MooClass, $dbTablePre, $userid, $user_arr, $memcached; $and_uuid = isset($_GET['uuid']) ? $_GET['uuid'] : ''; $uid = $_GET['uid'] = isset($_GET['uid']) ? $_GET['uid'] : ''; if ($uid) { $userid = $mem_uid = $memcached->get('uid_' . $uid); } $checkuuid = check_uuid($and_uuid, $userid); if (!$checkuuid) { $error = "uuid_error"; echo return_data($error, false); exit; } $user_arr = MooMembersData($userid); //checkAuthMod('index.php?n=material');//客服模拟登录操作没有修改权限 $validation = MooAutoLoad('MooValidation'); $uid = $userid; //$user_rank_id=get_userrank($userid); //var_dump($user_rank_id); //$update1_arr = $update2_arr = $update3_arr = array(); //note members表字段 $members_search = array(); $members_base = array(); $members_choice = array(); $members_introduce = array(); $birthyear = MooGetGPC('year', 'string', 'P'); $members_search['birthyear'] = $birthyear; $birthmonth = MooGetGPC('month', 'string', 'P'); $birthday = MooGetGPC('days', 'string', 'P'); $members_search['updatetime'] = time(); $members_search['nickname'] = safeFilter(MoogetGPC('nickname', 'string', 'P')); $members_search['telphone'] = MoogetGPC('telphone', 'string', 'P'); $members_search['marriage'] = MoogetGPC('marriage1', 'integer', 'P'); $members_search['height'] = MoogetGPC('height', 'integer', 'P'); $members_search['salary'] = MoogetGPC('salary', 'integer', 'P'); $members_search['education'] = MoogetGPC('education1', 'integer', 'P'); $members_search['children'] = MoogetGPC('children1', 'integer', 'P'); $members_search['house'] = MoogetGPC('house', 'integer', 'P'); $members_base['oldsex'] = MoogetGPC('oldsex', 'integer', 'P'); $members_search['province'] = MoogetGPC('province', 'integer', 'P'); $members_search['city'] = MoogetGPC('city', 'integer', 'P'); if (in_array($members_search['province'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_search['city'] = $members_search['province']; $members_search['province'] = 10101000; } //note choice表字段 $gender = $_MooClass['MooMySQL']->getOne("select gender from {$dbTablePre}members_search WHERE uid='{$uid}'", true); if ($gender['gender'] == 0) { $members_choice['gender'] = 1; } else { $members_choice['gender'] = 0; } //$update2_arr['sex'] = MoogetGpc('sex','integer','p'); $members_choice['age1'] = MoogetGPC('age1', 'integer', 'P'); $members_choice['age2'] = MoogetGPC('age2', 'integer', 'P'); $members_choice['workprovince'] = MoogetGPC('workProvince', 'integer', 'P'); $members_choice['workcity'] = MoogetGPC('workCity', 'integer', 'P'); if (in_array($members_choice['workprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['workcity'] = $members_choice['workprovince']; $members_choice['workprovince'] = 10101000; } $members_choice['marriage'] = MoogetGPC('marriage2', 'integer', 'P'); $members_choice['education'] = MoogetGPC('education2', 'integer', 'P'); $members_choice['children'] = MoogetGPC('children2', 'integer', 'P'); $members_choice['salary'] = MoogetGPC('salary1', 'integer', 'P'); $members_choice['height1'] = MoogetGPC('height1', 'integer', 'P'); $members_choice['height2'] = MoogetGPC('height2', 'integer', 'P'); $members_choice['hasphoto'] = MoogetGPC('hasphoto', 'integer', 'P'); $members_choice['nature'] = MoogetGPC('nature2', 'integer', 'P'); $members_choice['body'] = MoogetGPC('body2', 'integer', 'P'); $members_choice['weight1'] = MoogetGPC('weight1', 'integer', 'P'); $members_choice['weight2'] = MoogetGPC('weight2', 'integer', 'P'); $members_choice['occupation'] = MoogetGPC('occupation2', 'integer', 'P'); $members_choice['nation'] = MoogetGPC('stock2', 'integer', 'P'); $members_choice['hometownprovince'] = MoogetGPC('hometownProvince2', 'integer', 'P'); $members_choice['hometowncity'] = MoogetGPC('hometownCity2', 'integer', 'P'); if (in_array($members_choice['hometownprovince'], array(10101201, 10101002))) { //note 修正广东省深圳和广州的区域查询 2010-09-04 $members_choice['hometowncity'] = $members_choice['hometownProvince']; $members_choice['hometownprovince'] = 10101000; } $members_choice['wantchildren'] = MoogetGPC('wantchildren2', 'integer', 'P'); $members_choice['smoking'] = MoogetGPC('issmoking', 'integer', 'P'); $members_choice['drinking'] = MoogetGPC('isdrinking', 'integer', 'P'); $members_introduce['introduce_check'] = safeFilter(trim(MoogetGPC('introduce', 'string', 'P'))); $rs = $user_arr; //note 验证状态 if (MOOPHP_ALLOW_FASTDB) { $sta = MooFastdbGet('certification', 'uid', $uid); } else { $sta = $_MooClass['MooMySQL']->getOne("select telphone from {$dbTablePre}certification WHERE uid='{$uid}'", true); } $where_arr = array('uid' => $uid); foreach ($members_search as $key => $val) { //无手机号吗 if ($key == 'telphone' && $val == '') { continue; } $memberssearch[$key] = $val; } // foreach ($members_base as $key=>$val){ // $membersbase[$key]=$val; // } if (count($members_base) >= 1 || count($memberssearch) >= 1) { $members_search['updatetime'] = time(); if (!rtrim($members_search['nickname'])) { $error = "昵称必填"; echo return_data($error, false); exit; } if (preg_match('/^(1[345]\\d{9})|(18[024-9]\\d{8})|(010-?\\d{8})|(02)[012345789]-?\\d{8}|(0[3-9]\\d{2,2}-?\\d{7,8})|(.*@.*)$/', $members_search['nickname'])) { //MooMessage("昵称不符合规范!", "javascript:history.go(-1)"); $error = "昵称不符合规范!"; echo return_data($error, false); exit; } //echo 'sss';exit; str_length($members_search['nickname']); //note 昵称截取 $members_search['nickname'] = MooCutstr($members_search['nickname'], 18, $dot = ''); if ($members_search['telphone'] && !preg_match('/^((1[345]\\d{9})|(18[0-9]\\d{8}))$/', $members_search['telphone'])) { //MooMessage('请输入正确的手机号码','javascript:history.go(-1)'); $error = "请输入正确的手机号码"; echo return_data($error, false); exit; } //$birth=strtotime("$birthyear/$birthmonth/$birthday"); $birth = "{$birthyear}-{$birthmonth}-{$birthday}"; $members_base['birth'] = $birth; updatetable('members_base', $members_base, $where_arr); updatetable('members_search', $memberssearch, $where_arr); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $members_base); MooFastdbUpdate('members_search', 'uid', $uid, $memberssearch); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_search)); } //提交会员动态makui UpdateMembersSNS($uid, '修改了资料'); //内心独白必填 //if(rtrim($update2_arr['introduce_check'] != '')){ $members_introduce['introduce'] = ''; $members_introduce['introduce_pass'] = '******'; //if(isset($members_choice)){ $members_choice['updatetime'] = time(); updatetable('members_choice', $members_choice, $where_arr); //} updatetable('members_introduce', $members_introduce, $where_arr); if (MOOPHP_ALLOW_FASTDB) { $members_choice['uid'] = $uid; $members_introduce['uid'] = $uid; //print_r($update2_arr);exit; if (isset($members_choice)) { $members_choice['updatetime'] = time(); MooFastdbUpdate('members_choice', 'uid', $uid, $members_choice); } MooFastdbUpdate('members_introduce', 'uid', $uid, $members_introduce); } //searchApi("members_man members_women")->UpdateAttributes(array($uid=>$members_choice)); if (MOOPHP_ALLOW_FASTDB) { $userchoice = MooFastdbGet('members_choice', 'uid', $uid); $introduce = MooFastdbGet('members_introduce', 'uid', $uid); $userchoice = array_merge($userchoice, $introduce); } else { $userchoice = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}members_choice mc left join {$dbTablePre}members_introduce mi WHERE mc.uid=mi.uid AND uid = '{$uid}'", true); } //}else{ // MooMessage("内心独白必填!", "index.php?n=material&h=upinfo"); //} /* //低质量会员自动分配 if($user_rank_id == 0){ //以下信息都没选,都规为垃圾会员,自动分配给普通客服 if($update1_arr['height']=='-1' || $update1_arr['salary']=='-1' || $update1_arr['children']=='-1' || $update1_arr['oldsex']=='-1' || $update2_arr['age1']=='-1' || $update2_arr['age2']=='-1' || $update2_arr['marriage'] == '-1' || $update2_arr['children'] == '-1' || $update2_arr['body'] == '-1'){ invalid_user_allotserver($uid); } } */ if ($rs['telphone'] == $members_search['telphone'] || $sta['telphone'] == '' || $members_search['telphone'] == '') { $error = "修改成功"; echo return_data($error, true); exit; } else { //重新手机认证 $sql = "update {$dbTablePre}certification set telphone='' where uid='{$uid}'"; $_MooClass['MooMySQL']->query($sql); $certif_arr['telphone'] = ''; MooFastdbUpdate('certification', 'uid', $uid, $certif_arr); if (MOOPHP_ALLOW_FASTDB) { if (MOOPHP_ALLOW_FASTDB) { $certification_1 = MooFastdbGet('certification', 'uid', $userid); } else { $certification_1 = $_MooClass['MooMySQL']->getOne("SELECT * FROM {$dbTablePre}certification WHERE uid = '{$userid}'", true); } } //Message("您的手机信息有变动请再次通过我们的验证",'index.php?n=myaccount&h=telphone'); $error = "您的手机信息有变动请再次通过我们的验证"; echo return_data($error, true); exit; } //note 快速常用搜索表更新 //fastsearch_update($userid,'1'); //note 快速高级搜索表更新 //fastsearch_update($userid,'2'); }
function check_storyimage() { global $_MooClass, $adminid; $sid = $GLOBALS['adminid']; $type = MooGetGPC('type', 'string') == '' ? 'list' : MooGetGPC('type', 'string'); $usersid = MooGetGPC('usersid', 'string', 'G'); //makui $lei = "故事图片审核"; $uid = MooGetGPC('uid', 'integer'); $id = MooGetGPC('id', 'integer'); $checkArr = array(1 => '审核通过', 0 => '未审核'); switch ($type) { case 'list': $pass = MooGetGPC('pass', 'integer', 'G'); //note 获得当前url $currenturl = "index.php?action=check&h=storyimage"; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl2 = preg_replace("/(&pass=\\d+)/", "", $currenturl2) . "&pass={$pass}"; $currenturl2 = preg_replace("/(&usersid=\\d+)/", '', $currenturl2); $page = get_page(); $prepage = 20; $start = ($page - 1) * $prepage; if (isset($_GET['usersid']) && MooGetGPC('usersid', 'string', 'G') == 0) { salert("无所属客服"); } //所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist)) { $sql_where = " m.sid IN({$GLOBALS['adminid']}) AND "; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 if (isset($_GET['usersid'])) { $sql_where = " m.sid='{$usersid}' AND"; } //查看某一客服的会员 } else { $sql_where = " m.sid IN({$myservice_idlist}) AND "; if (isset($_GET['usersid'])) { $sql_where .= " m.sid='{$usersid}' AND"; } //查看某一客服的会员 } if ($uid > 0) { $sql_where .= ' m.uid=' . $uid . ' AND '; } else { $sql_where .= ' p.syscheck=' . $pass . ' AND '; } $sql1 = "select count(1) as c from web_story_pic as p inner join web_members as m on (p.uid = m.uid) where {$sql_where} p.mid != (select is_index from web_story as s where p.sid = s.sid)"; $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql1); $total = $total_count['c']; $sql = "select p.uid,p.mid as id,p.syscheck,m.nickname,m.birthyear,m.sid,m.gender,m.lastvisit from web_story_pic as p inner join web_members as m on (p.uid = m.uid) where {$sql_where} p.mid != (select is_index from web_story as s where p.sid = s.sid) order by p.syscheck,p.submit_date desc limit {$start},{$prepage}"; $list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require adminTemplate("check_list"); break; case 'show': $pass = MooGetGPC('pass', 'integer', 'G'); //查询出该会员的所有待审核照片222 $storyimages = array(); if ($_COOKIE['storyimages']) { $storydata_dir = MOOPHP_DATA_DIR . '/block/' . 'story' . $adminid . '.data'; if (file_exists($storydata_dir)) { $storyimages = unserialize(file_get_contents($storydata_dir)); } } if (!$storyimages) { $storyimages = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.birthyear,b.gender, a.mid FROM {$GLOBALS['dbTablePre']}story_pic as a inner join {$GLOBALS['dbTablePre']}members as b WHERE a.uid=b.uid and a.uid={$uid} and a.syscheck={$pass}"); } if ($id && $storyimages) { //数组重排 $sortarr = array(); foreach ($storyimages as $img) { if ($img['mid'] == $id) { $sortarr[] = -1; } else { $sortarr[] = $img['mid']; } } array_multisort($sortarr, SORT_ASC, $storyimages); } //取出待审核照片 $storyimage = $storyimages[0]; $_MooClass['MooCache']->setBlockCache('story' . $adminid, $storyimages); $id = $storyimage['mid']; serverlog(1, $dbTablePre . $GLOBALS['username'] . "story_pic", "查询会员爱情故事图片", $GLOBALS['adminid']); require adminTemplate("check_show"); break; case 'submit': $is_pass = MooGetGPC('pass', 'string'); $is_onpass = MooGetGPC('nopass', 'string'); if ($is_onpass) { $storyimagessrc = MooGetGPC('storyimagessrc', 'string'); $GLOBALS['_MooClass']['MooMySQL']->query("DELETE FROM {$GLOBALS['dbTablePre']}story_pic WHERE `mid`='{$id}'"); $files = MooAutoLoad('MooFiles'); $files->fileDelete($storyimagessrc); serverlog(2, $dbTablePre . "story_pic", $GLOBALS['username'] . "未通过用户的故事图片" . $id, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的成功故事图片不符合图片要求,已被红娘删除,请您按要求进行操作", "成功故事图片审核"); //salert('成功删除故事图片!'); $alert = '成功删除故事图片'; } elseif ($is_pass) { $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}story_pic SET `syscheck`=1 WHERE `mid`='{$id}'"); serverlog(3, $dbTablePre . "story_pic", $GLOBALS['username'] . "通过用户的故事图片" . $id, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的成功故事图片已经过红娘的审核,希望您和您的另一半白头偕老,同时也感谢您对红娘的支持", "成功故事图片审核"); //salert('审核成功故事图片成功'); $alert = '审核成功故事图片成功'; } $storydata_dir = MOOPHP_DATA_DIR . '/block/' . 'story' . $adminid . '.data'; $storyimages = array(); if (file_exists($storydata_dir)) { $storyimages = unserialize(file_get_contents($storydata_dir)); } $sotryimage = array_shift($storyimages); $_MooClass['MooCache']->setBlockCache('story' . $adminid, $storyimages); if ($storyimages) { $url = 'index.php?action=check&h=storyimage&type=show&id=' . $sotryimage['mid']; } else { $url = 'index.php?action=check&h=storyimage'; } $storykey = $storyimages ? 1 : 0; setcookie('storyimages', $storykey); salert($alert, $url); break; } }
function voice_upload() { global $dbTablePre, $_MooClass, $userid; $vals = MooGetGPC('vals', 'integer', 'G'); //echo $vals;exit; $url_1 = substr($userid, -1, 1); $url_2 = substr($userid, -2, 1); $url_3 = substr($userid, -3, 1); //note 调用文件操作类库,建立无限级目录 $mkdirs = MooAutoLoad('MooFiles'); //录制时候存储路径 $url_s = 'data/userecord_tmp/vol_' . $userid . '.flv'; if ($vals) { if (file_exists($url_s)) { //最终存储路径 $url = 'data/uservoi/' . $url_1 . '/' . $url_2 . '/' . $url_3; if (!file_exists($url)) { $mkdirs->fileMake_news($url); } if (copy($url_s, $url . '/voi_' . $userid . '.flv')) { $toshoot_voice_time = strtotime(date('Y-m-d')); //录制视频的时间 $own_uid = $_MooClass['MooMySQL']->getOne("select uid from {$dbTablePre}certification where uid='{$userid}'"); if ($own_uid) { $sql = "update {$dbTablePre}certification set toshoot_voice_time='{$toshoot_voice_time}',toshoot_voice_url='{$url}',toshoot_voice_check=1 where uid='{$userid}'"; } else { $sql = "insert into {$dbTablePre}certification(uid,toshoot_voice_check,toshoot_voice_time,toshoot_voice_url) values('{$userid}',1,'{$toshoot_video_time}','{$url}')"; } $_MooClass['MooMySQL']->query($sql); unlink($url_s); echo 'ok'; } else { echo 'error'; } } else { echo 'error2'; } } }
function allmember_edit_info() { global $fastdb; if ($_POST) { $uid = MooGetGPC('uid', 'integer', 'P'); if (empty($uid)) { salert('参数不正确'); exit; } $validation = MooAutoLoad('MooValidation'); //search $search1 = array("nickname" => "昵称", "username" => "Email", "truename" => "姓名", "telphone" => "电话", "marriage" => "婚姻", "height" => "身高", "salary" => "收入", "education" => "学历", "children" => "小孩", "house" => "住房", "province" => "工作身份", "city" => "工作城市", "hometownProvince" => "籍贯省份", "hometownCity" => "籍贯城市", "corptype" => "公司类别", "is_lock" => "封锁", "city_star" => "城市之星", "usertype" => "会员类型", "s_cid" => "会员级别", "gender" => "性别", "occupation" => "职业", "nation" => "民族", "smoking" => "吸烟", "drinking" => "喝酒", "body" => "体形", "weight" => "体重", "nature" => "性格", "family" => "兄弟姐妹"); $search2 = array(array("marriage" => array("0" => "不限", "1" => "未婚", "3" => "离异", "4" => "丧偶")), 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元以上")), array("education" => array("0" => "不限", "3" => "高中及以下", "4" => "大专", "5" => "大学本科", "6" => "硕士", "7" => "博士")), array("children" => array("0" => "不限", "1" => "没有", "3" => "有,我们住在一起", "4" => "有,我们偶尔一起住", "5" => "有,但不在身边", "2" => "保密")), array("house" => array("0" => "不限", "1" => "和父母家人同住", "2" => "自有物业", "3" => "租房", "4" => "婚后有房", "5" => "保密")), array("province" => array("0" => "不限", "10102000" => "北京", "10103000" => "上海", "10101201" => "深圳", "10101002" => "广州", "10101000" => "广东", "10104000" => "天津", "10105000" => "重庆", "10106000" => "安徽", "10107000" => "福建", "10108000" => "甘肃", "10109000" => "广西", "10110000" => "贵州", "10111000" => "海南", "10112000" => "河北", "10113000" => "河南", "10114000" => "黑龙江", "10115000" => "湖北", "10116000" => "湖南", "10117000" => "吉林", "10118000" => "江苏", "10119000" => "江西", "10120000" => "辽宁", "10121000" => "内蒙古", "10122000" => "宁夏", "10123000" => "青海", "10124000" => "山东", "10125000" => "山西", "10126000" => "陕西", "10127000" => "四川", "10128000" => "西藏", "10129000" => "新疆", "10130000" => "云南", "10131000" => "浙江", "10132000" => "澳门", "10133000" => "香港", "10134000" => "台湾", "2" => "国外")), array("hometownProvince" => array("0" => "不限", "10102000" => "北京", "10103000" => "上海", "10101201" => "深圳", "10101002" => "广州", "10101000" => "广东", "10104000" => "天津", "10105000" => "重庆", "10106000" => "安徽", "10107000" => "福建", "10108000" => "甘肃", "10109000" => "广西", "10110000" => "贵州", "10111000" => "海南", "10112000" => "河北", "10113000" => "河南", "10114000" => "黑龙江", "10115000" => "湖北", "10116000" => "湖南", "10117000" => "吉林", "10118000" => "江苏", "10119000" => "江西", "10120000" => "辽宁", "10121000" => "内蒙古", "10122000" => "宁夏", "10123000" => "青海", "10124000" => "山东", "10125000" => "山西", "10126000" => "陕西", "10127000" => "四川", "10128000" => "西藏", "10129000" => "新疆", "10130000" => "云南", "10131000" => "浙江", "10132000" => "澳门", "10133000" => "香港", "10134000" => "台湾", "2" => "国外")), array("city" => array("0" => "不限", "10101201" => "深圳", "10101002" => "广州", "10101003" => "佛山", "10101004" => "湛江", "10101005" => "珠海", "10101006" => "肇庆", "10101007" => "东莞", "10101008" => "惠州", "10101011" => "中山", "10101012" => "茂名", "10101013" => "汕头", "10101014" => "梅州", "10101015" => "韶关", "10101016" => "江门", "10101018" => "清远", "10101020" => "潮州", "10101022" => "阳江", "10101023" => "河源", "10101026" => "揭阳", "10101028" => "汕尾", "10101068" => "云浮", "10105001" => "重庆", "10106001" => "合肥", "10106002" => "淮南", "10106003" => "蚌埠", "10106004" => "宿州", "10106005" => "阜阳", "10106006" => "六安", "10106007" => "巢湖", "10106008" => "滁州", "10106009" => "芜湖", "10106011" => "安庆", "10106012" => "黄山", "10106013" => "铜陵", "10106027" => "贵池", "10106042" => "淮北", "10106030" => "桐城", "10106038" => "明光", "10106075" => "马鞍山", "10106078" => "天长", "10106079" => "池州", "10106080" => "宣城", "10106099" => "亳州", "10107001" => "福州", "10107002" => "厦门", "10107010" => "莆田", "10107003" => "泉州", "10107013" => "宁德", "10107004" => "南平", "10107007" => "漳州", "10107008" => "龙岩", "10107009" => "三明", "10108001" => "兰州", "10108002" => "张掖", "10108003" => "武威", "10108004" => "酒泉", "10108006" => "金昌", "10108022" => "临夏", "10108007" => "天水", "10108008" => "定西", "10108012" => "甘南", "10108009" => "平凉", "10108023" => "嘉峪关", "10108064" => "庆阳", "10108078" => "白银", "10108084" => "陇南", "10109001" => "南宁", "10109002" => "柳州", "10109003" => "钦州", "10109004" => "百色", "10109005" => "玉林", "10109006" => "防城港", "10109007" => "桂林", "10109008" => "梧州", "10109083" => "崇左", "10109009" => "河池", "10109010" => "北海", "10109014" => "贵港", "10109018" => "来宾", "10109089" => "贺州", "10110001" => "贵阳", "10110002" => "六盘水", "10110004" => "凯里", "10110005" => "都匀", "10110006" => "安顺", "10110007" => "遵义", "10110021" => "毕节", "10110026" => "兴义", "10110055" => "铜仁", "10110082" => "黔西南", "10110083" => "黔东南", "10110084" => "黔南", "10111001" => "海口", "10111002" => "三亚", "10111006" => "文昌", "10111007" => "琼海", "10111020" => "儋州", "10111021" => "五指山", "10112001" => "石家庄", "10112002" => "衡水", "10112003" => "邢台", "10112004" => "邯郸", "10112005" => "沧州", "10112006" => "唐山", "10112007" => "廊坊", "10112008" => "秦皇岛", "10112009" => "承德", "10112010" => "保定", "10112011" => "张家口", "10113001" => "郑州", "10113002" => "新乡", "10113003" => "安阳", "10113004" => "许昌", "10113005" => "驻马店", "10113006" => "漯河", "10113007" => "信阳", "10113008" => "周口", "10113009" => "洛阳", "10113099" => "济源", "10113010" => "平顶山", "10113011" => "三门峡", "10113012" => "南阳", "10113013" => "开封", "10113014" => "商丘", "10113015" => "鹤壁", "10113016" => "濮阳", "10113017" => "焦作", "10114001" => "哈尔滨", "10114002" => "绥化", "10114053" => "黑河", "10114003" => "佳木斯", "10114004" => "牡丹江", "10114005" => "齐齐哈尔", "10114007" => "大庆", "10114067" => "七台河", "10114008" => "大兴安岭", "10114009" => "鸡西", "10114042" => "伊春", "10114020" => "鹤岗", "10114024" => "双鸭山", "10115001" => "武汉", "10115002" => "黄石", "10115004" => "鄂州", "10115005" => "襄樊", "10115006" => "咸宁", "10115007" => "十堰", "10115008" => "宜昌", "10115009" => "恩施", "10115010" => "荆州", "10115011" => "黄冈", "10115012" => "荆门", "10115013" => "孝感", "10115016" => "神农架林区", "10115034" => "天门", "10115062" => "随州", "10115066" => "仙桃", "10116001" => "长沙", "10116002" => "株洲", "10116003" => "益阳", "10116004" => "岳阳", "10116005" => "常德", "10116007" => "娄底", "10116008" => "怀化", "10116009" => "衡阳", "10116010" => "邵阳", "10116011" => "郴州", "10116013" => "张家界", "10116014" => "湘潭", "10116075" => "永州", "10116097" => "湘西", "10117001" => "长春", "10117002" => "吉林", "10117003" => "延吉", "10117042" => "长白", "10117004" => "通化", "10117006" => "四平", "10117007" => "白城", "10117008" => "松原", "10117028" => "辽源", "10117049" => "延边", "10118001" => "南京", "10118002" => "苏州", "10118003" => "无锡", "10118004" => "徐州", "10118005" => "常州", "10118006" => "镇江", "10118051" => "泰州", "10118007" => "连云港", "10118008" => "淮安", "10118009" => "盐城", "10118010" => "扬州", "10118011" => "南通", "10118017" => "常熟", "10118063" => "宿迁", "10119001" => "南昌", "10119002" => "九江", "10119003" => "景德镇", "10119004" => "上饶", "10119005" => "鹰潭", "10119006" => "宜春", "10119007" => "萍乡", "10119008" => "赣州", "10119009" => "吉安", "10119010" => "抚州", "10119040" => "新余", "10119042" => "井岗山", "10120001" => "沈阳", "10120002" => "铁岭", "10120003" => "抚顺", "10120004" => "鞍山", "10120005" => "营口", "10120006" => "大连", "10120007" => "本溪", "10120008" => "丹东", "10120009" => "锦州", "10120010" => "朝阳", "10120011" => "阜新", "10120012" => "盘锦", "10120013" => "辽阳", "10120014" => "葫芦岛", "10121001" => "呼和浩特", "10121002" => "集宁", "10121003" => "包头", "10121004" => "临河", "10121005" => "乌海", "10121007" => "海拉尔", "10121008" => "赤峰", "10121009" => "锡林浩特", "10121011" => "通辽", "10121024" => "乌兰浩特", "10121089" => "锡林郭勒盟", "10121090" => "阿拉善盟", "10121091" => "兴安", "10121092" => "鄂尔多斯", "10121093" => "呼伦贝尔", "10121094" => "巴彦淖尔", "10121095" => "乌兰察布", "10122001" => "银川", "10122002" => "石嘴山", "10122003" => "固原", "10122010" => "吴忠", "10122011" => "中卫", "10123001" => "西宁", "10123002" => "果洛", "10123003" => "玉树", "10123004" => "格尔木", "10123005" => "海西", "10123045" => "海东", "10123046" => "海北", "10123047" => "黄南", "10123048" => "海南藏族自治州", "10124001" => "青岛", "10124002" => "威海", "10124003" => "济南", "10124004" => "淄博", "10124005" => "聊城", "10124006" => "德州", "10124007" => "东营", "10124008" => "潍坊", "10124009" => "烟台", "10124011" => "泰安", "10124012" => "菏泽", "10124013" => "临沂", "10124014" => "枣庄", "10124015" => "济宁", "10124016" => "日照", "10124068" => "莱芜", "10124018" => "滨州", "10125001" => "太原", "10125003" => "忻州", "10125005" => "大同", "10125006" => "临汾", "10125008" => "运城", "10125009" => "阳泉", "10125010" => "长治", "10125011" => "晋城", "10125107" => "晋中", "10125108" => "吕梁", "10126001" => "西安", "10126002" => "渭南", "10126003" => "延安", "10126005" => "榆林", "10126006" => "宝鸡", "10126007" => "安康", "10126008" => "汉中", "10126010" => "铜川", "10126011" => "咸阳", "10127001" => "成都", "10127125" => "巴中", "10127002" => "乐山", "10127003" => "凉山", "10127005" => "绵阳", "10127007" => "阿坝", "10127008" => "雅安", "10127009" => "甘孜", "10127010" => "广元", "10127117" => "遂宁", "10127011" => "南充", "10127013" => "内江", "10127014" => "自贡", "10127015" => "宜宾", "10127016" => "泸州", "10127017" => "攀枝花", "10127018" => "德阳", "10127056" => "眉山", "10127070" => "广安", "10127137" => "达州", "10128001" => "拉萨", "10128002" => "那曲", "10128003" => "昌都", "10128004" => "山南", "10128005" => "日喀则", "10128006" => "阿里", "10128007" => "林芝", "10129001" => "乌鲁木齐", "10129002" => "石河子", "10129003" => "乌苏", "10129004" => "克拉玛依", "10129006" => "阿勒泰", "10129007" => "巴音郭楞", "10129008" => "哈密", "10129009" => "吐鲁番", "10129010" => "阿克苏", "10129011" => "喀什", "10129012" => "和田", "10129013" => "图木舒克", "10129014" => "五家渠", "10129081" => "奎屯", "10129086" => "塔城", "10129088" => "克孜勒苏", "10129089" => "博尔塔拉", "10129017" => "昌吉", "10129090" => "伊犁", "10130001" => "昆明", "10130002" => "曲靖", "10130003" => "昭通", "10130005" => "文山", "10130007" => "大理", "10130008" => "楚雄", "10130098" => "红河", "10130009" => "临沧", "10130010" => "保山", "10130011" => "玉溪", "10130030" => "丽江", "10130052" => "普洱", "10130127" => "西双版纳", "10130128" => "德宏", "10130129" => "怒江", "10130130" => "迪庆", "10131001" => "杭州", "10131002" => "温州", "10131003" => "宁波", "10131004" => "绍兴", "10131005" => "湖州", "10131006" => "嘉兴", "10131009" => "金华", "10131010" => "丽水", "10131011" => "衢州", "10131012" => "台州", "10131013" => "义乌", "10131014" => "温岭", "10131015" => "舟山", "10132001" => "澳门", "10133001" => "香港", "10134001" => "台湾", "10500000" => "美国", "10600000" => "加拿大", "10700000" => "日本", "10800000" => "澳大利亚", "10900000" => "英国", "11000000" => "法国", "11100000" => "德国", "11200000" => "俄罗斯", "11300000" => "新西兰", "11400000" => "泰国", "11500000" => "马来西亚", "11600000" => "印度尼西亚", "11700000" => "菲律宾", "11800000" => "新加坡", "11900000" => "韩国", "12000000" => "缅甸", "12100000" => "越南", "12200000" => "柬埔寨", "12300000" => "老挝", "12400000" => "印度", "12500000" => "文莱", "12600000" => "巴基斯坦", "12700000" => "朝鲜", "12800000" => "尼泊尔", "12900000" => "斯里兰卡", "13000000" => "土耳其", "13100000" => "乌克兰", "13200000" => "意大利", "13300000" => "芬兰", "13400000" => "荷兰", "13500000" => "挪威", "13600000" => "葡萄牙", "13700000" => "西班牙", "13800000" => "瑞典", "13900000" => "瑞士", "14000000" => "阿根廷", "14100000" => "巴西", "14200000" => "智利", "14300000" => "墨西哥", "14400000" => "秘鲁", "14500000" => "奥地利", "14600000" => "比利时", "14700000" => "丹麦", "14800000" => "希腊", "14900000" => "匈牙利", "15000000" => "哥伦比亚", "15100000" => "委内瑞拉", "15200000" => "爱尔兰", "15300000" => "保加利亚", "15400000" => "冰岛", "15500000" => "卢森堡", "15600000" => "罗马尼亚", "15700000" => "以色列", "15800000" => "埃及", "15900000" => "南非", "16000000" => "奥克兰", "16100000" => "喀麦隆", "16200000" => "毛里求斯", "16300000" => "马达加斯加", "16400000" => "其它地区")), array("hometownCity" => array("0" => "不限", "10101201" => "深圳", "10101002" => "广州", "10101003" => "佛山", "10101004" => "湛江", "10101005" => "珠海", "10101006" => "肇庆", "10101007" => "东莞", "10101008" => "惠州", "10101011" => "中山", "10101012" => "茂名", "10101013" => "汕头", "10101014" => "梅州", "10101015" => "韶关", "10101016" => "江门", "10101018" => "清远", "10101020" => "潮州", "10101022" => "阳江", "10101023" => "河源", "10101026" => "揭阳", "10101028" => "汕尾", "10101068" => "云浮", "10105001" => "重庆", "10106001" => "合肥", "10106002" => "淮南", "10106003" => "蚌埠", "10106004" => "宿州", "10106005" => "阜阳", "10106006" => "六安", "10106007" => "巢湖", "10106008" => "滁州", "10106009" => "芜湖", "10106011" => "安庆", "10106012" => "黄山", "10106013" => "铜陵", "10106027" => "贵池", "10106042" => "淮北", "10106030" => "桐城", "10106038" => "明光", "10106075" => "马鞍山", "10106078" => "天长", "10106079" => "池州", "10106080" => "宣城", "10106099" => "亳州", "10107001" => "福州", "10107002" => "厦门", "10107010" => "莆田", "10107003" => "泉州", "10107013" => "宁德", "10107004" => "南平", "10107007" => "漳州", "10107008" => "龙岩", "10107009" => "三明", "10108001" => "兰州", "10108002" => "张掖", "10108003" => "武威", "10108004" => "酒泉", "10108006" => "金昌", "10108022" => "临夏", "10108007" => "天水", "10108008" => "定西", "10108012" => "甘南", "10108009" => "平凉", "10108023" => "嘉峪关", "10108064" => "庆阳", "10108078" => "白银", "10108084" => "陇南", "10109001" => "南宁", "10109002" => "柳州", "10109003" => "钦州", "10109004" => "百色", "10109005" => "玉林", "10109006" => "防城港", "10109007" => "桂林", "10109008" => "梧州", "10109083" => "崇左", "10109009" => "河池", "10109010" => "北海", "10109014" => "贵港", "10109018" => "来宾", "10109089" => "贺州", "10110001" => "贵阳", "10110002" => "六盘水", "10110004" => "凯里", "10110005" => "都匀", "10110006" => "安顺", "10110007" => "遵义", "10110021" => "毕节", "10110026" => "兴义", "10110055" => "铜仁", "10110082" => "黔西南", "10110083" => "黔东南", "10110084" => "黔南", "10111001" => "海口", "10111002" => "三亚", "10111006" => "文昌", "10111007" => "琼海", "10111020" => "儋州", "10111021" => "五指山", "10112001" => "石家庄", "10112002" => "衡水", "10112003" => "邢台", "10112004" => "邯郸", "10112005" => "沧州", "10112006" => "唐山", "10112007" => "廊坊", "10112008" => "秦皇岛", "10112009" => "承德", "10112010" => "保定", "10112011" => "张家口", "10113001" => "郑州", "10113002" => "新乡", "10113003" => "安阳", "10113004" => "许昌", "10113005" => "驻马店", "10113006" => "漯河", "10113007" => "信阳", "10113008" => "周口", "10113009" => "洛阳", "10113099" => "济源", "10113010" => "平顶山", "10113011" => "三门峡", "10113012" => "南阳", "10113013" => "开封", "10113014" => "商丘", "10113015" => "鹤壁", "10113016" => "濮阳", "10113017" => "焦作", "10114001" => "哈尔滨", "10114002" => "绥化", "10114053" => "黑河", "10114003" => "佳木斯", "10114004" => "牡丹江", "10114005" => "齐齐哈尔", "10114007" => "大庆", "10114067" => "七台河", "10114008" => "大兴安岭", "10114009" => "鸡西", "10114042" => "伊春", "10114020" => "鹤岗", "10114024" => "双鸭山", "10115001" => "武汉", "10115002" => "黄石", "10115004" => "鄂州", "10115005" => "襄樊", "10115006" => "咸宁", "10115007" => "十堰", "10115008" => "宜昌", "10115009" => "恩施", "10115010" => "荆州", "10115011" => "黄冈", "10115012" => "荆门", "10115013" => "孝感", "10115016" => "神农架林区", "10115034" => "天门", "10115062" => "随州", "10115066" => "仙桃", "10116001" => "长沙", "10116002" => "株洲", "10116003" => "益阳", "10116004" => "岳阳", "10116005" => "常德", "10116007" => "娄底", "10116008" => "怀化", "10116009" => "衡阳", "10116010" => "邵阳", "10116011" => "郴州", "10116013" => "张家界", "10116014" => "湘潭", "10116075" => "永州", "10116097" => "湘西", "10117001" => "长春", "10117002" => "吉林", "10117003" => "延吉", "10117042" => "长白", "10117004" => "通化", "10117006" => "四平", "10117007" => "白城", "10117008" => "松原", "10117028" => "辽源", "10117049" => "延边", "10118001" => "南京", "10118002" => "苏州", "10118003" => "无锡", "10118004" => "徐州", "10118005" => "常州", "10118006" => "镇江", "10118051" => "泰州", "10118007" => "连云港", "10118008" => "淮安", "10118009" => "盐城", "10118010" => "扬州", "10118011" => "南通", "10118017" => "常熟", "10118063" => "宿迁", "10119001" => "南昌", "10119002" => "九江", "10119003" => "景德镇", "10119004" => "上饶", "10119005" => "鹰潭", "10119006" => "宜春", "10119007" => "萍乡", "10119008" => "赣州", "10119009" => "吉安", "10119010" => "抚州", "10119040" => "新余", "10119042" => "井岗山", "10120001" => "沈阳", "10120002" => "铁岭", "10120003" => "抚顺", "10120004" => "鞍山", "10120005" => "营口", "10120006" => "大连", "10120007" => "本溪", "10120008" => "丹东", "10120009" => "锦州", "10120010" => "朝阳", "10120011" => "阜新", "10120012" => "盘锦", "10120013" => "辽阳", "10120014" => "葫芦岛", "10121001" => "呼和浩特", "10121002" => "集宁", "10121003" => "包头", "10121004" => "临河", "10121005" => "乌海", "10121007" => "海拉尔", "10121008" => "赤峰", "10121009" => "锡林浩特", "10121011" => "通辽", "10121024" => "乌兰浩特", "10121089" => "锡林郭勒盟", "10121090" => "阿拉善盟", "10121091" => "兴安", "10121092" => "鄂尔多斯", "10121093" => "呼伦贝尔", "10121094" => "巴彦淖尔", "10121095" => "乌兰察布", "10122001" => "银川", "10122002" => "石嘴山", "10122003" => "固原", "10122010" => "吴忠", "10122011" => "中卫", "10123001" => "西宁", "10123002" => "果洛", "10123003" => "玉树", "10123004" => "格尔木", "10123005" => "海西", "10123045" => "海东", "10123046" => "海北", "10123047" => "黄南", "10123048" => "海南藏族自治州", "10124001" => "青岛", "10124002" => "威海", "10124003" => "济南", "10124004" => "淄博", "10124005" => "聊城", "10124006" => "德州", "10124007" => "东营", "10124008" => "潍坊", "10124009" => "烟台", "10124011" => "泰安", "10124012" => "菏泽", "10124013" => "临沂", "10124014" => "枣庄", "10124015" => "济宁", "10124016" => "日照", "10124068" => "莱芜", "10124018" => "滨州", "10125001" => "太原", "10125003" => "忻州", "10125005" => "大同", "10125006" => "临汾", "10125008" => "运城", "10125009" => "阳泉", "10125010" => "长治", "10125011" => "晋城", "10125107" => "晋中", "10125108" => "吕梁", "10126001" => "西安", "10126002" => "渭南", "10126003" => "延安", "10126005" => "榆林", "10126006" => "宝鸡", "10126007" => "安康", "10126008" => "汉中", "10126010" => "铜川", "10126011" => "咸阳", "10127001" => "成都", "10127125" => "巴中", "10127002" => "乐山", "10127003" => "凉山", "10127005" => "绵阳", "10127007" => "阿坝", "10127008" => "雅安", "10127009" => "甘孜", "10127010" => "广元", "10127117" => "遂宁", "10127011" => "南充", "10127013" => "内江", "10127014" => "自贡", "10127015" => "宜宾", "10127016" => "泸州", "10127017" => "攀枝花", "10127018" => "德阳", "10127056" => "眉山", "10127070" => "广安", "10127137" => "达州", "10128001" => "拉萨", "10128002" => "那曲", "10128003" => "昌都", "10128004" => "山南", "10128005" => "日喀则", "10128006" => "阿里", "10128007" => "林芝", "10129001" => "乌鲁木齐", "10129002" => "石河子", "10129003" => "乌苏", "10129004" => "克拉玛依", "10129006" => "阿勒泰", "10129007" => "巴音郭楞", "10129008" => "哈密", "10129009" => "吐鲁番", "10129010" => "阿克苏", "10129011" => "喀什", "10129012" => "和田", "10129013" => "图木舒克", "10129014" => "五家渠", "10129081" => "奎屯", "10129086" => "塔城", "10129088" => "克孜勒苏", "10129089" => "博尔塔拉", "10129017" => "昌吉", "10129090" => "伊犁", "10130001" => "昆明", "10130002" => "曲靖", "10130003" => "昭通", "10130005" => "文山", "10130007" => "大理", "10130008" => "楚雄", "10130098" => "红河", "10130009" => "临沧", "10130010" => "保山", "10130011" => "玉溪", "10130030" => "丽江", "10130052" => "普洱", "10130127" => "西双版纳", "10130128" => "德宏", "10130129" => "怒江", "10130130" => "迪庆", "10131001" => "杭州", "10131002" => "温州", "10131003" => "宁波", "10131004" => "绍兴", "10131005" => "湖州", "10131006" => "嘉兴", "10131009" => "金华", "10131010" => "丽水", "10131011" => "衢州", "10131012" => "台州", "10131013" => "义乌", "10131014" => "温岭", "10131015" => "舟山", "10132001" => "澳门", "10133001" => "香港", "10134001" => "台湾", "10500000" => "美国", "10600000" => "加拿大", "10700000" => "日本", "10800000" => "澳大利亚", "10900000" => "英国", "11000000" => "法国", "11100000" => "德国", "11200000" => "俄罗斯", "11300000" => "新西兰", "11400000" => "泰国", "11500000" => "马来西亚", "11600000" => "印度尼西亚", "11700000" => "菲律宾", "11800000" => "新加坡", "11900000" => "韩国", "12000000" => "缅甸", "12100000" => "越南", "12200000" => "柬埔寨", "12300000" => "老挝", "12400000" => "印度", "12500000" => "文莱", "12600000" => "巴基斯坦", "12700000" => "朝鲜", "12800000" => "尼泊尔", "12900000" => "斯里兰卡", "13000000" => "土耳其", "13100000" => "乌克兰", "13200000" => "意大利", "13300000" => "芬兰", "13400000" => "荷兰", "13500000" => "挪威", "13600000" => "葡萄牙", "13700000" => "西班牙", "13800000" => "瑞典", "13900000" => "瑞士", "14000000" => "阿根廷", "14100000" => "巴西", "14200000" => "智利", "14300000" => "墨西哥", "14400000" => "秘鲁", "14500000" => "奥地利", "14600000" => "比利时", "14700000" => "丹麦", "14800000" => "希腊", "14900000" => "匈牙利", "15000000" => "哥伦比亚", "15100000" => "委内瑞拉", "15200000" => "爱尔兰", "15300000" => "保加利亚", "15400000" => "冰岛", "15500000" => "卢森堡", "15600000" => "罗马尼亚", "15700000" => "以色列", "15800000" => "埃及", "15900000" => "南非", "16000000" => "奥克兰", "16100000" => "喀麦隆", "16200000" => "毛里求斯", "16300000" => "马达加斯加", "16400000" => "其它地区")), array("corptype" => array("0" => "不限", "1" => "政府机关", "2" => "事业单位", "3" => "世界500强", "4" => "外资企业", "5" => "上市公司", "6" => "国营企业", "7" => "私营企业", "8" => "自有公司")), array("is_lock" => array("0" => "是", "1" => "否")), array("usertype" => array("1" => "本站", "2" => "外站", "3" => "全权", "4" => "内部")), array("s_cid" => array("10" => "铂金", "20" => "钻石", "30" => "高级", "40" => "普通")), array("gender" => array("0" => "男", "1" => "女")), array("occupation" => array("0" => "请选择", "1" => "金融业", "2" => "计算机业", "3" => "商业", "4" => "服务行业", "5" => "教育业", "6" => "工程师", "7" => "主管,经理", "8" => "政" + "府部门", "9" => "制造业", "10" => "销售/广告/市场", "11" => "资讯业", "12" => "自由业", "13" => "农渔牧", "14" => "医生", "15" => "律师", "16" => "教师", "17" => "幼师", "18" => "会计师", "19" => "设计师", "20" => "空姐", "21" => "护士", "22" => "记者", "23" => "学者", "24" => "公务员", "26" => "职业经理人", "27" => "秘书", "28" => "音乐家", "29" => "画家", "30" => "咨询师", "31" => "审计师", "32" => "注册会计师", "33" => "军人", "34" => "警察", "35" => "学生", "36" => "待业中", "37" => "消防员", "38" => "经纪人", "39" => "模特", "40" => "教授", "41" => "IT工程师", "42" => "摄影师", "43" => "企业高管", "44" => "作家", "99" => "其他行业")), array("nation" => array("0" => "不限", "1" => "汉族", "2" => "藏族", "3" => "朝鲜族", "4" => "蒙古族", "5" => "回族", "6" => "满族", "7" => "维吾尔族", "8" => "壮族", "9" => "彝族", "10" => "苗族", "11" => "侗族", "12" => "瑶族", "13" => "白族", "14" => "布依族", "15" => "傣族", "16" => "京族", "17" => "黎族", "18" => "羌族", "19" => "怒族", "20" => "佤族", "21" => "水族", "22" => "畲族", "23" => "土族", "24" => "阿昌族", "25" => "哈尼族", "26" => "高山族", "27" => "景颇族", "28" => "珞巴族", "29" => "锡伯族", "30" => "德昂(崩龙)族", "31" => "保安族", "32" => "基诺族", "33" => "门巴族", "34" => "毛南族", "35" => "赫哲族", "36" => "裕固族", "37" => "撒拉族", "38" => "独龙族", "39" => "普米族", "40" => "仫佬族", "41" => "仡佬族", "42" => "东乡族", "43" => "拉祜族", "44" => "土家族", "45" => "纳西族", "46" => "傈僳族", "47" => "布朗族", "48" => "哈萨克族", "49" => "达斡尔族", "50" => "鄂伦春族", "51" => "鄂温克族", "52" => "俄罗斯族", "53" => "塔塔尔族", "54" => "塔吉克族", "55" => "柯尔克孜族", "56" => "乌兹别克族", "57" => "国外")), array("smoking" => array("-1,不限", "0,都可以", "1,在意")), array("drinking" => array("0" => "请选择", "1" => "不喝酒", "2" => "稍微喝一点/社交场合喝", "3" => "喝的很凶", "5" => "保密")), array("body" => array("0" => "请选择", "1" => "一般", "2" => "瘦长", "3" => "运动员型", "4" => "比较胖", "5" => "体格魁梧", "6" => "苗条", "7" => "高大美丽", "8" => "丰满", "9" => "富线条美", "10" => "矮壮结实", "11" => "皮肤白皙", "12" => "长发飘飘", "13" => "时尚卷发", "14" => "干练短发", "15" => "黝黑健康", "16" => "眉清目秀", "17" => "浓眉大眼", "0" => "保密"))); $sql = 'select nickname,username,truename,telphone,marriage,height,salary,education,children,house,province,city,corptype,is_lock,city_star,usertype,s_cid,bgtime,endtime,gender,birthyear,password,occupation,nation,hometownProvince,hometownCity,smoking,drinking,body,weight,family from `' . $GLOBALS['dbTablePre'] . 'members_search` where `uid`=' . $uid; $userInfo = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); $update1_arr = $update2_arr = $update3_arr = array(); //note members表字段 if (isset($_POST['nickname'])) { $update1_arr['nickname'] = MooGetGPC('nickname', 'string', 'P'); } if (isset($_POST['username'])) { $update1_arr['username'] = MooGetGPC('username', 'string', 'P'); } if (isset($_POST['truename'])) { $update1_arr['truename'] = MooGetGPC('truename', 'string', 'P'); } if (isset($_POST['telphone'])) { $update1_arr['telphone'] = MooGetGPC('telphone', 'string', 'P'); } if (isset($_POST['marriage1'])) { $update1_arr['marriage'] = MooGetGPC('marriage1', 'integer', 'P'); } if (isset($_POST['height'])) { $update1_arr['height'] = MooGetGPC('height', 'integer', 'P'); } if (isset($_POST['salary'])) { $update1_arr['salary'] = MooGetGPC('salary', 'integer', 'P'); } if (isset($_POST['education1'])) { $update1_arr['education'] = MooGetGPC('education1', 'integer', 'P'); } if (isset($_POST['children1'])) { $update1_arr['children'] = MooGetGPC('children1', 'integer', 'P'); } if (isset($_POST['house'])) { $update1_arr['house'] = MooGetGPC('house', 'integer', 'P'); } if (isset($_POST['workprovince'])) { $update1_arr['province'] = MooGetGPC('workprovince', 'integer', 'P'); } if (isset($_POST['workCity'])) { $update1_arr['city'] = MooGetGPC('workCity', 'integer', 'P'); } if (isset($_POST['corptype'])) { $update1_arr['corptype'] = MooGetGPC('corptype', 'integer', 'P'); } if (isset($_POST['family'])) { $update1_arr['family'] = MooGetGPC('family', 'integer', 'P'); } //$update1_arr['sid'] = MooGetGPC('sid','integer'); if (isset($_POST['is_lock'])) { $update1_arr['is_lock'] = MooGetGPC('is_lock', 'integer', 'P'); } $update1_arr['city_star'] = MooGetGPC('city_star', 'integer', 'P'); if (!empty($update1_arr['city_star'])) { $city_star = $GLOBALS['_MooClass']['MooMySQL']->getOne('select `city_star` from `' . $GLOBALS['dbTablePre'] . 'members_search` where `uid`=' . $uid, true); $now_t = time(); if ($city_star['city_star'] < $now_t) { $update1_arr['city_star'] = 3600 * 24 * 31 + $now_t; } } if (isset($_POST['usertype'])) { $update1_arr['usertype'] = MooGetGPC('usertype', 'integer', 'P'); if ($update1_arr['usertype'] == 5) { $update1_arr['sid'] = 600; } //内部会员直接 设定 客服60号 } if (isset($_POST['s_cid'])) { $update1_arr['s_cid'] = MooGetGPC('s_cid', 'integer', 'P'); } if (isset($_POST['bgtime']) && !empty($_POST['bgtime'])) { $update1_arr['bgtime'] = strtotime(MooGetGPC('bgtime', 'string', 'P')); } if (isset($_POST['endtime']) && !empty($_POST['endtime'])) { $update1_arr['endtime'] = strtotime(MooGetGPC('endtime', 'string', 'P')); } if (isset($_POST['gender'])) { $update1_arr['gender'] = MooGetGPC('gender', 'integer', 'P'); } if (isset($_POST['presex'])) { $presex = MooGetGPC('presex', 'integer', 'P'); } //if(isset($_POST['year']))$update1_arr['birthyear'] = MooGetGPC('year','integer','P'); //if(isset($_POST['month']))$update1_arr['birthmonth'] = MooGetGPC('month','integer','P'); //if(isset($_POST['day']))$update1_arr['birthday'] = MooGetGPC('day','integer','P'); $password = trim(MooGetGPC('password', 'string', 'P')); if ($password) { $update1_arr['password'] = md5($password); } //$update1_arr['introduce'] = MoogetGPC('introduce','string','P'); //note memberfield表字段 if (isset($_POST['occupation2'])) { $update1_arr['occupation'] = MooGetGPC('occupation2', 'integer', 'P'); } if (isset($_POST['stock2'])) { $update1_arr['nation'] = MooGetGPC('stock2', 'integer', 'P'); } if (isset($_POST['hometownProvince'])) { $update1_arr['hometownProvince'] = MooGetGPC('hometownProvince', 'integer', 'P'); } if (isset($_POST['hometownCity'])) { $update1_arr['hometownCity'] = MooGetGPC('hometownCity', 'integer', 'P'); } //$update2_arr['wantchildren'] = MooGetGPC('wantchildren2','integer','P'); if (isset($_POST['issmoking'])) { $update1_arr['smoking'] = MooGetGPC('issmoking', 'integer', 'P'); } if (isset($_POST['isdrinking'])) { $update1_arr['drinking'] = MooGetGPC('isdrinking', 'integer', 'P'); } if (isset($_POST['body'])) { $update1_arr['body'] = MooGetGPC('body', 'integer', 'P'); } if (isset($_POST['weight'])) { $update1_arr['weight'] = MooGetGPC('weight', 'integer', 'P'); } $userBase = $GLOBALS['_MooClass']['MooMySQL']->getOne('select nature,qq,msn,birth,oldsex from `' . $GLOBALS['dbTablePre'] . 'members_base` where `uid`=' . $uid, true); if (isset($_POST['nature3'])) { $update2_arr['nature'] = MooGetGPC('nature3', 'integer', 'P'); } if (isset($_POST['qq'])) { $update2_arr['qq'] = MooGetGPC('qq', 'string', 'P'); } if (isset($_POST['msn'])) { $update2_arr['msn'] = MooGetGPC('msn', 'string', 'P'); } if (isset($_POST['oldsex'])) { $update2_arr['oldsex'] = MooGetGPC('oldsex', 'integer', 'P'); } if (isset($_POST['year']) || isset($_POST['month']) || isset($_POST['day'])) { //birth modify $year = isset($_POST['year']) && $_POST['year'] ? $_POST['year'] : 0; $month = isset($_POST['month']) && $_POST['month'] ? $_POST['month'] : 0; $day = isset($_POST['day']) && $_POST['day'] ? $_POST['day'] : 0; if (!$year) { $time = 0; } elseif (!$month) { $time = $year . '-01-01'; } elseif (!$day) { $time = $year . '-' . $month . '-01'; } else { $time = $year . '-' . $month . '-' . $day; } $update2_arr['birth'] = date('Y-m-d', strtotime($time)); } $sql = 'select age1,age2,height1,height2,weight1,weight2,salary,workprovince,workcity,hometownprovince,hometowncity,smoking,education,children,wantchildren,nature from `' . $GLOBALS['dbTablePre'] . 'members_choice` where `uid`=' . $uid; $userChoice = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql, true); //note choice表字段 if (isset($_POST['spouse_age1'])) { $update3_arr['age1'] = MooGetGPC('spouse_age1', 'integer', 'P'); } if (isset($_POST['spouse_age2'])) { $update3_arr['age2'] = MooGetGPC('spouse_age2', 'integer', 'P'); } if (isset($_POST['spouse_minheight'])) { $update3_arr['height1'] = MooGetGPC('spouse_minheight', 'integer', 'P'); } if (isset($_POST['spouse_maxheight'])) { $update3_arr['height2'] = MooGetGPC('spouse_maxheight', 'integer', 'P'); } if (isset($_POST['spouse_minweight'])) { $update3_arr['weight1'] = MooGetGPC('spouse_minweight', 'integer', 'P'); } if (isset($_POST['spouse_maxweight'])) { $update3_arr['weight2'] = MooGetGPC('spouse_maxweight', 'integer', 'P'); } if (isset($_POST['spouse_salary'])) { $update3_arr['salary'] = MooGetGPC('spouse_salary', 'integer', 'P'); } if (isset($_POST['spouse_workprovince'])) { $update3_arr['workprovince'] = MooGetGPC('spouse_workprovince', 'integer', 'P'); } if (isset($_POST['spouse_workCity'])) { $update3_arr['workCity'] = MooGetGPC('spouse_workCity', 'integer', 'P'); } if (isset($_POST['spouse_smoking'])) { $update3_arr['smoking'] = MooGetGPC('spouse_smoking', 'integer', 'P'); } if (isset($_POST['spouse_hometownprovince'])) { $update3_arr['hometownprovince'] = MooGetGPC('spouse_hometownprovince', 'integer', 'P'); } if (isset($_POST['spouse_hometowncity'])) { $update3_arr['hometowncity'] = MooGetGPC('spouse_hometowncity', 'integer', 'P'); } if (isset($_POST['spouse_education'])) { $update3_arr['education'] = MooGetGPC('spouse_education', 'integer', 'P'); } if (isset($_POST['spouse_children'])) { $update3_arr['children'] = MooGetGPC('spouse_children', 'integer', 'P'); } if (isset($_POST['spouse_wantchildren'])) { $update3_arr['wantchildren'] = MooGetGPC('spouse_wantchildren', 'integer', 'P'); } if (isset($_POST['spouse_character'])) { $update3_arr['nature'] = MooGetGPC('spouse_character', 'integer', 'P'); } $where_arr = array('uid' => $uid); $modifyinfo = ''; //initialize modify information $comma = ","; $update1arr = array(); foreach ($update1_arr as $key => $val) { foreach ($search1 as $k => $v) { //修改的字段名 if ($k == $key) { $column = $v; } } $update1arr[$key] = $val; if ($userInfo[$key] != $val) { //修改了值 foreach ($search2 as $v1) { //循环数组 foreach ($v1 as $k2 => $v2) { if ($k2 == $key) { //如果出现在$search2数组中的 foreach ($v2 as $k3 => $v3) { if ($userInfo[$key] == $k3) { //对应修改的字段原先的值 $xx = $v3; } if ($val == $k3) { //对应修改的字段现在的值 $val = $v3; } } break; } elseif ($k2 != $key && in_array($key, array("username", "nickname", "height", "truename", "telphone", "weight", "family"))) { //如果不出现在$search2数组中的,直接显示的,比如姓名,电话,体重 $xx = $userInfo[$key]; } } } $modifyinfo .= $column . "原:" . $xx . "|现:" . $val; $modifyinfo .= $comma; } } foreach ($update2_arr as $key => $val) { $update2arr[$key] = $val; if (!empty($val) && $userBase[$key] != $val) { $modifyinfo .= $key . "原:" . $userBase[$key] . "|现:" . $val; $modifyinfo .= $comma; } } foreach ($update3_arr as $key => $val) { $update3arr[$key] = $val; if (!empty($val) && $userChoice[$key] != $val) { //echo $val.'and'.$key.'and'.$userChoice[$key];exit; $modifyinfo .= "配偶" . $key . "原:" . $userChoice[$key] . "|现:" . $val; $modifyinfo .= $comma; } } if (!isset($modifyinfo)) { echo "<script>alert('未修改任何信息');location.href='index.php?action=allmember&h=edit_info&uid={$uid}';</script>"; exit; } $now = time(); $update1arr['updatetime'] = $now; if (count($update1arr) >= 1) { updatetable('members_search', $update1arr, $where_arr); if (MOOPHP_ALLOW_FASTDB) { $fastdb->set('members_searchuid' . $uid, null); MooFastdbUpdate('members_search', 'uid', $uid, $update1arr); } if ($update1arr['s_cid'] == 20) { $sql = "REPLACE INTO {$GLOBALS['dbTablePre']}diamond (uid ,username ,skin ,status, nickname, gender, birthyear,bgtime,endtime)\n\t\t\t\t\t\t\tVALUES ( '{$uid}', '{$update1arr['username']}', '" . ($update1arr['gender'] == 0 ? 'cyan' : 'red') . "', '1', '{$update1arr['nickname']}','{$update1arr['gender']}','{$update1arr['birthyear']}','{$update1arr['bgtime']}','{$update1arr['endtime']}')"; if (!$GLOBALS['_MooClass']['MooMySQL']->query($sql)) { echo "操作失败!无法添加钻石会员数据.请联系管理员..."; exit; } } } if (count($update2arr) >= 1) { updatetable('members_base', $update2arr, $where_arr); if ($update2arr['birth']) { $yourage = date('Y', strtotime($update2arr['birth'])); $sql = "update web_members_search set birthyear=" . $yourage . " where uid={$uid}"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_search', 'uid', $uid, array("birthyear" => $yourage)); } } if (MOOPHP_ALLOW_FASTDB) { MooFastdbUpdate('members_base', 'uid', $uid, $update2arr); } } if (count($update3arr) >= 1) { updatetable('members_choice', $update3arr, $where_arr); if (MOOPHP_ALLOW_FASTDB) { // $fastdb->set('members_choiceuid'.$uid,null); MooFastdbUpdate('members_choice', 'uid', $uid, $update3arr); } } if (!empty($password)) { $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT username FROM {$GLOBALS['dbTablePre']}members_search WHERE uid='{$uid}'", true); $content = "尊敬的用户:您在真爱一生网的密码现在改为" . $password; MooSendMail($userinfo['username'], "修改密码", $content, '../public/system/mailtamp/template.html', $is_template = true, $uid); insert_admin_log($uid, "{$GLOBALS['username']}客服成功修改{$uid}会员密码为{$password}"); //fangin暂时屏蔽 //暂时不改 if ($userinfo['telphone']) { if (SendMsg($userinfo['telphone'], $content)) { $GLOBALS['_MooClass']['MooMySQL']->query("INSERT INTO {$GLOBALS['dbTablePre']}smslog(sid,uid,content,sendtime) VALUES('{$GLOBALS['adminid']}','{$uid}','{$content}','{$GLOBALS['timestamp']}')"); } } } if (!isset($tag)) { $tag = ''; } //添加操作日志 //serverlog(4,$GLOBALS['dbTablePre']."members_search和member_base","{$GLOBALS['username']}修改用户{$uid}资料",$GLOBALS['adminid'],$uid); serverlog(4, $GLOBALS['dbTablePre'] . "members_search和member_base", $modifyinfo, $GLOBALS['adminid'], $uid); echo "<script>alert('修改成功{$tag}');location.href='index.php?action=allmember&h=edit_info&uid={$uid}';</script>"; exit; //salert("修改成功{$tag}");exit; } $uid = MooGetGPC('uid', 'integer', 'G'); $userinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_search WHERE uid='{$uid}'", true); $userfield = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_base WHERE uid='{$uid}'", true); $spouseinfo = $GLOBALS['_MooClass']['MooMySQL']->getOne("SELECT * FROM {$GLOBALS['dbTablePre']}members_choice WHERE uid='{$uid}'", true); $userinfo = $userfield = $userinfo + $userfield; if (in_array($GLOBALS['groupid'], $GLOBALS['admin_service_arr']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_after']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_team']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_complaints']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_all_group']) && $userinfo['usertype'] == 3 || in_array($GLOBALS['groupid'], $GLOBALS['admin_resource_manager']) || in_array($GLOBALS['groupid'], $GLOBALS['admin_service_manager']) || in_array($GLOBALS['groupid'], $GLOBALS['general_service']) && $userinfo['usertype'] == 3) { $is_admin = 0; //管理人员可以修改特殊字段 } else { $is_admin = 1; } require adminTemplate("allmember_edit_info"); }
function check_storyimage() { global $_MooClass, $adminid, $dbTablePre, $memcached; $sql_where = ''; $sid = $GLOBALS['adminid']; $type = MooGetGPC('type', 'string') == '' ? 'list' : MooGetGPC('type', 'string'); $usersid = MooGetGPC('usersid', 'string'); //makui $lei = "故事图片审核"; $uid = MooGetGPC('uid', 'integer'); $id = MooGetGPC('id', 'integer'); $checkArr = array(1 => '审核通过', 0 => '未审核'); switch ($type) { case 'list': if (MooGetGPC('pass', 'string', 'R')) { $pass = MooGetGPC('pass', 'string', 'R'); $pass = str_replace("\\'", "", $pass); } else { $pass = 0; } //note 获得当前url $currenturl = "index.php?action=check&h=storyimage"; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $currenturl2 = preg_replace("/(&pass=\\d+)/", "", $currenturl2) . "&pass={$pass}"; $currenturl2 = preg_replace("/(&usersid=\\d+)/", '', $currenturl2); if (MooGetGPC('page', 'string', 'G')) { $page = MooGetGPC('page', 'string', 'G'); $page = str_replace("\\'", "", $page); } else { $page = 1; } $prepage = 20; $start = ($page - 1) * $prepage; if (MooGetGPC('usersid', 'string', 'R') != "-1" && MooGetGPC('usersid', 'string', 'R') != "") { $val = MooGetGPC('usersid', 'string', 'R'); $val = str_replace("\\'", "", $val); $sid_where = "m.sid = '{$val}' AND "; $currentur = $currenturl2 . '&usersid=' . $val; } else { $sid_where = " "; $currentur = $currenturl2; } //所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist) || $myservice_idlist === $GLOBALS['adminid']) { //本客服 $condition[] = " sid ={$GLOBALS['adminid']}"; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 //if(!empty($usersid)){$condition[]=" sid='$usersid'";} $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user"); } else { $condition[] = " sid IN({$myservice_idlist})"; //if(!empty($usersid)) {$condition[]=" sid='$usersid'";} $adminUser = $GLOBALS['_MooClass']['MooMySQL']->getAll("select uid,username from web_admin_user where uid in ({$myservice_idlist}) "); } if ($uid > 0) { $sql_where .= ' m.uid=' . $uid . ' AND '; } else { if ($val == 10000) { $sql_where .= " p.syscheck=" . $pass . " AND "; } else { $sql_where .= " p.syscheck=" . $pass . " AND " . $sid_where; } } $sql1 = "select count(1) as c from web_story_pic as p left join web_members_search as m on (p.uid = m.uid) where {$sql_where} p.mid != (select is_index from web_story as s where p.sid = s.sid)"; $total_count = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql1); $total = $total_count['c']; $sql = "select p.uid,p.mid as id,p.syscheck,m.nickname,m.birthyear,m.sid,m.gender,mb.allotdate from web_story_pic as p left join web_members_search as m on (p.uid = m.uid) left join web_members_base as mb on mb.uid=m.uid where {$sql_where} p.mid != (select is_index from web_story as s where p.sid = s.sid) order by p.syscheck,p.submit_date desc limit {$start},{$prepage}"; $list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); require adminTemplate("check_list"); break; case 'show': $pass = MooGetGPC('pass', 'integer', 'G'); //查询出该会员的所有待审核照片222 $usersid = MooGetGPC('usersid', 'string', 'G'); //makui if (MooGetGPC('page', 'string', 'G')) { $page = MooGetGPC('page', 'string', 'G'); } else { $page = 1; } $url = "index.php?action=check&h=storyimage&type=list&pass='******'&usersid='{$usersid}'&page='{$page}'"; $storyimages = array(); if (isset($_COOKIE['storyimages']) && $_COOKIE['storyimages']) { $storydata_dir = $memcached->get('story' . $adminid); if ($storydata_dir) { $storyimages = unserialize($storydata_dir); } } if (!$storyimages) { $storyimages = $GLOBALS['_MooClass']['MooMySQL']->getAll("SELECT a.*,b.birthyear,b.gender, a.mid FROM {$GLOBALS['dbTablePre']}story_pic as a left join {$GLOBALS['dbTablePre']}members_search as b ON a.uid=b.uid WHERE a.uid={$uid} and a.syscheck={$pass}"); } if ($id && $storyimages) { //数组重排 $sortarr = array(); foreach ($storyimages as $img) { if ($img['mid'] == $id) { $sortarr[] = -1; } else { $sortarr[] = $img['mid']; } } array_multisort($sortarr, SORT_ASC, $storyimages); } //取出待审核照片 $storyimage = $storyimages[0]; $_MooClass['MooCache']->setBlockCache('story' . $adminid, $storyimages, 3600); $id = $storyimage['mid']; serverlog(1, $dbTablePre . $GLOBALS['username'] . "story_pic", "查询会员爱情故事图片", $GLOBALS['adminid']); require adminTemplate("check_show"); break; case 'submit': $is_pass = MooGetGPC('pass', 'string'); $is_onpass = MooGetGPC('nopass', 'string'); if ($is_onpass) { $storyimagessrc = MooGetGPC('storyimagessrc', 'string'); $GLOBALS['_MooClass']['MooMySQL']->query("DELETE FROM {$GLOBALS['dbTablePre']}story_pic WHERE `mid`='{$id}'"); $files = MooAutoLoad('MooFiles'); $files->fileDelete($storyimagessrc); serverlog(2, $dbTablePre . "story_pic", $GLOBALS['username'] . "未通过用户的故事图片" . $id, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的成功故事图片不符合图片要求,已被红娘删除,请您按要求进行操作", "成功故事图片审核"); //salert('成功删除故事图片!'); $alert = '成功删除故事图片'; } elseif ($is_pass) { $GLOBALS['_MooClass']['MooMySQL']->query("UPDATE {$GLOBALS['dbTablePre']}story_pic SET `syscheck`=1 WHERE `mid`='{$id}'"); serverlog(3, $dbTablePre . "story_pic", $GLOBALS['username'] . "通过用户的故事图片" . $id, $GLOBALS['adminid'], $uid); sendusermessage($uid, "您的成功故事图片已经过红娘的审核,希望您和您的另一半白头偕老,同时也感谢您对红娘的支持", "成功故事图片审核"); //salert('审核成功故事图片成功'); $alert = '审核成功故事图片成功'; } $storydata_dir = $memcached->get('story' . $adminid); $storyimages = array(); if ($storydata_dir) { $storyimages = unserialize($storydata_dir); } $sotryimage = array_shift($storyimages); $_MooClass['MooCache']->setBlockCache('story' . $adminid, $storyimages, 3600); if ($storyimages) { $url = 'index.php?action=check&h=storyimage&type=show&id=' . $sotryimage['mid']; } else { $url = 'index.php?action=check&h=storyimage'; } $storykey = $storyimages ? 1 : 0; setcookie('storyimages', $storykey); salert($alert, $url); break; } }
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; }
function myaccount_makepic() { global $_MooClass, $uid, $user, $pic_size_arr, $user_arr, $_MooCookie, $last_login_time; global $dbTablePre; $a = $_MooCookie['tmp_order']; $sql = "select count(*) as c from {$dbTablePre}tmp where uid='{$uid}' and staus=0"; $tmp_num = $_MooClass['MooMySQL']->getOne($sql); $sql2 = "select count(*) as count from {$dbTablePre}pic where uid='{$uid}'"; $pic_num = $_MooClass['MooMySQL']->getOne($sql2); $count = $tmp_num['c'] + $pic_num['count']; $succes = 'ok'; if ($count < 20) { if (!empty($a)) { $tmp_order = $a; } else { $pic_url = time(); MooSetCookie("tmp_order", $pic_url); $tmp_order = $pic_url; } //note 设定全局路径 $orgin = "orgin"; //note 原图文件夹名 $thumb_path = PIC_PATH; //图片路径 $thumb_datedir = date("Y/m/d"); $main_img_path = $thumb_path . "/" . $thumb_datedir . "/" . $orgin . "/"; //note 调用文件操作类库,建立无限级目录 $mkdirs = MooAutoLoad('MooFiles'); !is_dir($main_img_path) && $mkdirs->fileMake($main_img_path, 0777); $date = date('YmdHis') . rand(111111, 999999); $pic_name = $date . '.jpg'; $imgurl = $main_img_path . $pic_name; $result = file_put_contents($imgurl, file_get_contents('php://input')); if (!$result) { print "ERROR: Failed to write data to {$imgurl}, check permissions\n"; exit; } /* $w = (int)$_POST['width']; $h = (int)$_POST['height']; $img = imagecreatetruecolor($w, $h); imagefill($img, 0, 0, 0x669966); $rows = 0; $cols = 0; for($rows = 0; $rows < $h; $rows++){ $c_row = explode(",", $_POST['px' . $rows]); for($cols = 0; $cols < $w; $cols++){ $value = $c_row[$cols]; if($value != ""){ $hex = $value; while(strlen($hex) < 6){ $hex = "0" . $hex; } $r = hexdec(substr($hex, 0, 2)); $g = hexdec(substr($hex, 2, 2)); $b = hexdec(substr($hex, 4, 2)); $test = imagecolorallocate($img, $r, $g, $b); imagesetpixel($img, $cols, $rows, $test); } } } */ //header("Content-type:image/jpeg"); //imagejpeg($img,$imgurl, 90); $insertarr = array('uid' => $uid, 'pic_url' => $imgurl, 'tmp_order' => $tmp_order, 'staus' => 0, 'pic_date' => $thumb_datedir, 'pic_name' => $pic_name); inserttable('tmp', $insertarr); $first = new Imagick($imgurl); //写入水印 $second = new Imagick('public/system/images/logo_original.png'); //$second->setImageOpacity (0.4);//设置透明度 $dw = new ImagickDraw(); $dw->setGravity(Imagick::GRAVITY_SOUTHEAST); //设置位置 //$dw->setGravity(Imagick::GRAVITY_SOUTH);//设置位置 $dw->composite($second->getImageCompose(), 0, 0, 50, 0, $second); $first->drawImage($dw); $first->writeImage($imgurl); //将第一张图片的大小控制成我们需要的大小 list($width, $height) = getimagesize($imgurl); //note 缩略图路径,大小全局调用 $thumb1_width = $pic_size_arr["1"]["width"]; $thumb1_height = $pic_size_arr["1"]["height"]; $thumb2_width = $pic_size_arr["2"]["width"]; $thumb2_height = $pic_size_arr["2"]["height"]; $thumb3_width = $pic_size_arr["3"]["width"]; $thumb3_height = $pic_size_arr["3"]["height"]; //note 生成日期目录 $thumb1_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb1_width . "_" . $thumb1_height . "/"; $thumb2_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb2_width . "_" . $thumb2_height . "/"; $thumb3_path = $thumb_path . "/" . $thumb_datedir . "/" . $thumb3_width . "_" . $thumb3_height . "/"; !is_dir($thumb1_path) && $mkdirs->fileMake($thumb1_path, 0777); !is_dir($thumb2_path) && $mkdirs->fileMake($thumb2_path, 0777); !is_dir($thumb3_path) && $mkdirs->fileMake($thumb3_path, 0777); $thumb_filename = md5($date) . '.jpg'; //生成缩略图1 $image = MooAutoLoad('MooImage'); $image->config(array('thumbDir' => $thumb1_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '41', 'waterMarkMinHeight' => '57', 'waterMarkStatus' => 9)); $image->thumb($thumb1_width, $thumb1_height, $imgurl); $image->waterMark(); //生成缩略图2 $image = MooAutoLoad('MooImage'); $b = $width / $thumb2_width; $thumb2_height = $height / $b; $image->config(array('thumbDir' => $thumb2_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '139', 'waterMarkMinHeight' => '189', 'waterMarkStatus' => 9)); $image->thumb($thumb2_width, $thumb2_height, $imgurl); $image->waterMark(); //生成缩略图3 $image = MooAutoLoad('MooImage'); $b = $width / $thumb3_width; $thumb3_height = $height / $b; $image->config(array('thumbDir' => $thumb3_path, 'thumbStatus' => '1', 'saveType' => '0', 'thumbName' => $thumb_filename, 'waterMarkMinWidth' => '171', 'waterMarkMinHeight' => '244', 'waterMarkStatus' => 9)); $image->thumb($thumb3_width, $thumb3_height, $imgurl); $image->waterMark(); //判断照片是否生成 $succes = ''; } header("Location:index.php?n=myaccount&h=picflash&do=js&succes='{$succes}'"); //include MooTemplate('public/myaccount_flash', 'module'); }