Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[已答复] 使用搜索时需要先登陆

[复制链接]
mimikai109 发表于 2010-3-29 14:03:42 | 显示全部楼层 |阅读模式
在使用ss的搜索功能时需要先登陆才能进行操作。此次可修改batch.search.php页面,将//权限
if(!checkperm('allowsearch')) {
        showmessage('no_permission');
}

$perpage = 30;
$urlplus = $wheresql = $message = $multipage = '';
$wherearr = $iarr = array();

empty($_GET['page'])?$page = 1page = intval($_GET['page']);
$start = ($page-1)*$perpage;

$searchname = postget('searchname');        //获取类型

if(!empty($searchname)) {
        if(empty($_SGLOBAL['supe_uid']) && empty($_SCONFIG['allowguestsearch'])) {
                showmessage('the_system_does_not_allow_searches', geturl('action/login'));
        }
        if(!empty($_SCONFIG['searchinterval']) && $_SGLOBAL['group']['groupid'] != 1) {
                if($_SGLOBAL['timestamp'] - $_SGLOBAL['member']['lastsearchtime'] < $_SCONFIG['searchinterval']) {
                        showmessage('inquiries_about_the_short_time_interval');
                }
        }
}
改为//权限


$perpage = 30;
$urlplus = $wheresql = $message = $multipage = '';
$wherearr = $iarr = array();

empty($_GET['page'])?$page = 1page = intval($_GET['page']);
$start = ($page-1)*$perpage;

$searchname = postget('searchname');        //获取类型

if(!empty($searchname)) {
       
        if(!empty($_SCONFIG['searchinterval']) && $_SGLOBAL['group']['groupid'] != 1) {
                if($_SGLOBAL['timestamp'] - $_SGLOBAL['member']['lastsearchtime'] < $_SCONFIG['searchinterval']) {
                        showmessage('inquiries_about_the_short_time_interval');
                }
        }
}
可取消登陆后才能操作的限制
nirending 发表于 2010-4-7 17:13:58 | 显示全部楼层
兄弟啊,我太感谢你了
回复

使用道具 举报

nirending 发表于 2010-4-7 17:23:20 | 显示全部楼层
不过还差了一个,因为模型使用的是m.php,所以m.php也要修改,本来一直没找到,被你一提醒就找到了,呵呵

找到
  1. if(count($getarr) > 1) {
  2.         if(!empty($modelsinfoarr['allowguestsearch'])) {
  3.                 if(empty($_COOKIE['ss_modeldateline_1'])) {
  4.                         setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp'], $_SGLOBAL['timestamp']+86400);
  5.                         showmessage('inquiries_about_the_short_time_interval');
  6.                 } else {
  7.                         if($_SGLOBAL['timestamp'] - $_COOKIE['ss_modeldateline_1'] < $modelsinfoarr['searchinterval']) {
  8.                                 showmessage('inquiries_about_the_short_time_interval');
  9.                         } else {
  10.                                 setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp'], $_SGLOBAL['timestamp']+86400);
  11.                         }
  12.                 }
  13.         } else {
  14.                 if(empty($_SGLOBAL['supe_uid'])) {
  15.                         setcookie('_refer', rawurlencode(S_URL_ALL.'/m.php?'.$_SERVER['QUERY_STRING']));
  16.                         showmessage('no_login', geturl('action/login'));
  17.                 }
  18.                 if(!empty($modelsinfoarr['searchinterval']) && $_SGLOBAL['group']['groupid'] != 1) {
  19.                         $query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('modelinterval').' WHERE uid = \''.$_SGLOBAL['supe_uid'].'\' AND type=1');
  20.                         $result = $_SGLOBAL['db']->fetch_array($query);
  21.                         if(!empty($result)) {
  22.                                 if($_SGLOBAL['timestamp'] - $result['dateline'] < $modelsinfoarr['searchinterval']) {
  23.                                         showmessage('inquiries_about_the_short_time_interval');
  24.                                 } else {
  25.                                         updatetable('modelinterval', array('dateline' => $_SGLOBAL['timestamp']), array('uid'=>$_SGLOBAL['supe_uid'], 'type'=>1));
  26.                                 }
  27.                         } else {
  28.                                 inserttable('modelinterval', array('uid'=>$_SGLOBAL['supe_uid'], 'dateline'=>$_SGLOBAL['timestamp'], 'type'=>1));
  29.                         }
  30.                 }
  31.         }
  32. } else {
  33.         if(!empty($modelsinfoarr['allowguestsearch'])) {
  34.                 if(empty($_COOKIE['ss_modeldateline_1'])) {
  35.                         setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp']-86400, $_SGLOBAL['timestamp']+86400);
  36.                 }
  37.         }
  38. }
复制代码
替换为
  1. if(count($getarr) > 1) {
  2.         if(!empty($modelsinfoarr['allowguestsearch'])) {
  3.                 if(empty($_COOKIE['ss_modeldateline_1'])) {
  4.                         setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp'], $_SGLOBAL['timestamp']+86400);
  5.                         showmessage('inquiries_about_the_short_time_interval');
  6.                 } else {
  7.                         if($_SGLOBAL['timestamp'] - $_COOKIE['ss_modeldateline_1'] < $modelsinfoarr['searchinterval']) {
  8.                                 showmessage('inquiries_about_the_short_time_interval');
  9.                         } else {
  10.                                 setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp'], $_SGLOBAL['timestamp']+86400);
  11.                         }
  12.                 }
  13.         } else {
  14.                
  15.                 if(!empty($modelsinfoarr['searchinterval']) && $_SGLOBAL['group']['groupid'] != 1) {
  16.                         $query = $_SGLOBAL['db']->query('SELECT * FROM '.tname('modelinterval').' WHERE uid = \''.$_SGLOBAL['supe_uid'].'\' AND type=1');
  17.                         $result = $_SGLOBAL['db']->fetch_array($query);
  18.                         if(!empty($result)) {
  19.                                 if($_SGLOBAL['timestamp'] - $result['dateline'] < $modelsinfoarr['searchinterval']) {
  20.                                         showmessage('inquiries_about_the_short_time_interval');
  21.                                 } else {
  22.                                         updatetable('modelinterval', array('dateline' => $_SGLOBAL['timestamp']), array('uid'=>$_SGLOBAL['supe_uid'], 'type'=>1));
  23.                                 }
  24.                         } else {
  25.                                 inserttable('modelinterval', array('uid'=>$_SGLOBAL['supe_uid'], 'dateline'=>$_SGLOBAL['timestamp'], 'type'=>1));
  26.                         }
  27.                 }
  28.         }
  29. } else {
  30.         if(!empty($modelsinfoarr['allowguestsearch'])) {
  31.                 if(empty($_COOKIE['ss_modeldateline_1'])) {
  32.                         setcookie('ss_modeldateline_1', $_SGLOBAL['timestamp']-86400, $_SGLOBAL['timestamp']+86400);
  33.                 }
  34.         }
  35. }
复制代码
即可不用登陆搜索模型信息。。。
回复

使用道具 举报

 楼主| mimikai109 发表于 2010-4-8 16:01:52 | 显示全部楼层
回复 3# nirending


    //if(empty($_SGLOBAL['supe_uid'])) {
                //        setcookie('_refer', rawurlencode(S_URL_ALL.'/m.php?'.$_SERVER['QUERY_STRING']));
                //        showmessage('no_login', geturl('action/login'));
                //}
就使把这几行去掉呗。
回复

使用道具 举报

DZfly 发表于 2010-5-1 11:57:58 | 显示全部楼层
留个记号。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-2 09:49 , Processed in 0.102578 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表