1.查找(15行)
- require_once DISCUZ_ROOT.'./forumdata/cache/cache_forums.php';
复制代码
在下面添加
- require_once DISCUZ_ROOT.'./plugins/searchshow/searchshow.func.php'; //SearchShow
复制代码
====================================================================
2.查找(22行)
- if(!submitcheck('searchsubmit', 1) && empty($page)) {
复制代码
在上面添加
- if(!empty($pid) && !empty($tid)){
- loc($pid, $tid);//Searchshow跳转到相应帖
- }
复制代码
====================================================================
3.查找(75行)
- $query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid IN ($index[tids]) AND displayorder>='0' ORDER BY $orderby $ascdesc LIMIT $start_limit, $tpp");
- while($thread = $db->fetch_array($query)) {
- $threadlist[] = procthread($thread);
- }
- $multipage = multi($index['threads'], $tpp, $page, "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes");
复制代码
替换成
- /*-------------------SearchShow Main-------------------*/
- $tmp = explode('|', $index['tids']);
- $index['tids'] = $tmp[0];
- $ps = intval($tmp[1]);
- $pids = $tmp[2];
-
- if($post) {
- $index['threads'] = $ps;
- if($discuz_uid && $adminid == 3) {
- $modadd1 = ', md.uid AS ismoderator';
- $modadd2 = "LEFT JOIN {$tablepre}moderators md ON md.uid='$discuz_uid' AND md.fid=f.fid";
- } else {
- $modadd1 = $modadd2 = '';
- }
- $query = $db->query("SELECT p.*, t.readperm, t.price, t.subject AS tsubject, f.allowsmilies, f.allowbbcode, f.allowimgcode, f.allowhtml, f.jammer, m.groupid, n.username AS tauthor $modadd1 FROM {$tablepre}posts p
- LEFT JOIN {$tablepre}threads t On t.tid = p.tid
- LEFT JOIN {$tablepre}forums f On f.fid = t.fid $modadd2
- LEFT JOIN {$tablepre}members m On m.uid = p.authorid
- LEFT JOIN {$tablepre}members n On n.uid = t.authorid
- WHERE p.pid IN ($pids) ORDER BY pid $ascdesc LIMIT $start_limit, $tpp");
- } else {
- $query = $db->query("SELECT * FROM {$tablepre}threads WHERE tid IN ($index[tids]) AND displayorder>='0' ORDER BY $orderby $ascdesc LIMIT $start_limit, $tpp");
- }
- while($thread = $db->fetch_array($query)) {
- if($post) {
- include_once DISCUZ_ROOT.'./include/discuzcode.func.php'; //To show discuz code.
- $thread = showproc($thread);
- }
- $threadlist[] = procthread($thread);
- }
- /*-------------------Process End-------------------*/
- $multipage = multi($index['threads'], $tpp, $page, "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&post=$post&searchsubmit=yes");
- //SearchShow -- Modified By MaxZ
复制代码
====================================================================
4.查找(220行)
- $threads = $tids = 0;
- $query = $db->query("SELECT DISTINCT t.tid, t.closed $sqlsrch ORDER BY tid DESC LIMIT $maxsearchresults");
- while($thread = $db->fetch_array($query)) {
- if($thread['closed'] <= 1) {
- $tids .= ','.$thread['tid'];
- $threads++;
- }
- }
复制代码
替换成
- /*-------------------SearchShow PreProcess-------------------*/
- $threads = $ps = $tids = $pids = 0;
- $sql = ($srchtype == 'fulltext') ? 'p.pid, t.tid, t.closed' : 't.tid, t.closed';
- $query = $db->query("SELECT DISTINCT $sql $sqlsrch ORDER BY ".($srchtype == 'fulltext' ? 'pid' : 'tid')." DESC LIMIT $maxsearchresults");
- //$query = $db->query("SELECT DISTINCT t.tid, t.closed $sqlsrch ORDER BY tid DESC LIMIT $maxsearchresults");
- if ($srchtype == 'fulltext') {
- while($thread = $db->fetch_array($query)) {
- if($thread['closed'] <= 1) {
- $pids .= ','.$thread['pid'];
- $ps++;
- if (!strstr(",$tids,", ",$thread[tid],")) {
- $tids .= ','.$thread['tid'];
- $threads++;
- }
- }
- }
- } else {
- while($thread = $db->fetch_array($query)) {
- $tids .= ','.$thread['tid'];
- $threads++;
- }
- }
- $tids .= ($srchtype == 'fulltext') ? '|'.$ps.'|'.$pids : '';
- /*-------------------PreProcess End-------------------*/
复制代码
====================================================================
5.查找(238行)
- showmessage('search_redirect', "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&searchsubmit=yes");
复制代码
替换成
- //SearchShow -- Modified By MaxZ
- showmessage('search_redirect', "search.php?searchid=$searchid&orderby=$orderby&ascdesc=$ascdesc&post=$post&searchsubmit=yes");
复制代码
结束:)
[ 本帖最后由 maxz38 于 2006-2-26 14:04 编辑 ] |