Exemplo n.º 1
0
<?php

defined('IN_TS') or die('Access Denied.');
//搜索结果
$kw = urldecode(tsFilter($_GET['kw']));
if ($kw == '') {
    header("Location: " . tsUrl('search'));
    exit;
}
$kw = t($kw);
if (count_string_len($kw) < 2) {
    header("Location: " . tsUrl('search'));
    exit;
}
switch ($ts) {
    case "":
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
        $url = tsUrl('search', 's', array('kw' => $kw, 'page' => ''));
        $lstart = $page * 10 - 10;
        $arrAlls = $db->fetch_all_assoc("select groupid as id,'group' as type from " . dbprefix . "group where `groupname` like '%{$kw}%' union select topicid as id,'topic' as type from " . dbprefix . "group_topic WHERE `title` like '%{$kw}%' union select userid as id,'user' as type from " . dbprefix . "user_info where username like '%{$kw}%' union select articleid as id,'article' as type from " . dbprefix . "article where `title` like '%{$kw}%' limit {$lstart},10 ");
        foreach ($arrAlls as $item) {
            if ($item['type'] == 'group') {
                $arrGroup[] = $new['search']->find('group', array('groupid' => $item['id']));
            } elseif ($item['type'] == 'topic') {
                $arrTopic[] = $new['search']->find('group_topic', array('topicid' => $item['id']));
            } elseif ($item['type'] == 'user') {
                $arrUser[] = $new['search']->find('user_info', array('userid' => $item['id']));
            } elseif ($item['type'] == 'article') {
                $arrArticle[] = $new['search']->find('article', array('articleid' => $item['id']));
            }
        }
Exemplo n.º 2
0
 }
 $isEmail = $new['user']->findCount('user', array('email' => $email));
 $isUserName = $new['user']->findCount('user_info', array('username' => $username));
 if ($email == '' || $pwd == '' || $repwd == '' || $username == '') {
     getJson('所有必选项都不能为空!', $js);
 }
 if (valid_email($email) == false) {
     getJson('Email邮箱输入有误', $js);
 }
 if ($isEmail > 0) {
     getJson('Email已经注册', $js);
 }
 if ($pwd != $repwd) {
     getJson('两次输入密码不正确!', $js);
 }
 if (count_string_len($username) < 4 || count_string_len($username) > 20) {
     getJson('姓名长度必须在4和20之间', $js);
 }
 if ($isUserName > 0) {
     getJson('用户名已经存在,请换个用户名!', $js);
 }
 if ($TS_SITE['isauthcode']) {
     if (isset($_POST['geetest_challenge']) && isset($_POST['geetest_validate']) && isset($_POST['geetest_seccode'])) {
         $result = $geetest->validate($_POST['geetest_challenge'], $_POST['geetest_validate'], $_POST['geetest_seccode']);
         if ($result == TRUE) {
             //echo 'Yes!';
         } else {
             if ($result == FALSE) {
                 //echo 'No';
                 getJson('验证码输入有误,请重新输入!', $js);
             } else {
Exemplo n.º 3
0
 //note 民族
 $nation = isset($_GET['stock']) ? htmlspecialchars(trim(MooGetGPC('stock', 'integer', 'G'))) : 0;
 //		echo "籍贯省市$home_townprovince--$home_towncity<br />民族$nation";die;
 //note 保存搜索条件名称
 $searchname = isset($_GET['searchname']) ? htmlspecialchars(trim(MooGetGPC('searchname', 'string', 'G'))) : '';
 //note 以前的搜索id
 $sid = isset($_GET['sid']) ? htmlspecialchars(trim(MooGetGPC('sid', 'integer', 'G'))) : '';
 //        $condition = isset($_GET['condition']) ? trim(MooGetGPC('condition', 'integer', 'G')) : '2';
 //note 是否确定保存搜索条件
 $issavesearchname = isset($_GET['issavesearchname']) ? htmlspecialchars(MooGetGPC('issavesearchname', 'integer', 'G')) : '';
 //note 是否定期存到邮箱
 $is_commend = MooGetGPC('is_commend', 'integer', 'G');
 if ($searchname && $issavesearchname) {
     $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
     $currenturl2 = preg_replace("/(&issavesearchname=\\d+)/", "", $currenturl);
     $countname = count_string_len($searchname);
     if ($countname > 25) {
         MooMessage('对不起!您输入的搜索条件名过长!', "index.php?n=search&h=super");
     }
     //note 保存的搜索条件新增加一条记录到web_searchbk表或者根据搜索条件id更新表某一条记录
     condition_in_update($gender, $age_start, $age_end, $work_province, $work_city, $marriage, $salary, $education, $height1, $height2, $weight1, $weight2, $body, $smoking, $drinking, $occupation, $house, $vehicle, $corptype, $children, $wantchildren, $home_townprovince, $home_towncity, $nation, $animalyear, $constellation, $bloodtype, $religion, $family, $language, $photo, $sid, $is_commend, $issavesearchname, $searchname, $currenturl);
     //			exit;
 }
 if ($age_start == -1) {
     $age_start = 0;
 }
 if ($age_end == -1) {
     $age_end = 0;
 }
 if ($work_province == -1) {
     $work_province = 0;