一、打开esearchindex.php 411行左右,找到:
1 | Header( "Location:result/?searchid=$searchid" . $dogetvar ); |
修改为:
1 | Header( "Location:$public_r[newsurl]search/$searchid/0.html" . $dogetvar ); |
二、打开esearchresultindex.php 20行左右,找到:
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 | //搜索结果 $searchid =(int) $_GET [ 'searchid' ]; 在前面添加分页函数: //增加分页函数 function page10( $num , $line , $page_line , $start , $page , $search ){ global $fun_r , $public_r ; if ( $num <= $line ) { return '' ; } $search =RepPostStr( $search ,1); $url = $public_r [ 'newsurl' ]. 'search' ; $snum =2; //最小页数 $totalpage = ceil ( $num / $line ); //取得总页数 $firststr = '<a title="' . $fun_r [ 'trecord' ]. '"> ' . $num . ' </a> ' ; //上一页 if ( $page <>0) { $toppage = '<a href="' . $url . '/' . $search . '/' . '0.html">' . $fun_r [ 'startpage' ]. '</a> ' ; $pagepr = $page -1; $prepage = '<a href="' . $url . '/' . $search . '/' . $pagepr . '.html">' . $fun_r [ 'pripage' ]. '</a>' ; } //下一页 if ( $page != $totalpage -1) { $pagenex = $page +1; $nextpage = ' <a href="' . $url . '/' . $search . '/' . $pagenex . '.html">' . $fun_r [ 'nextpage' ]. '</a>' ; $lastpage = ' <a href="' . $url . '/' . $search . '/' .( $totalpage -1). '.html">' . $fun_r [ 'lastpage' ]. '</a>' ; } $starti = $page - $snum <0?0: $page - $snum ; $no =0; for ( $i = $starti ; $i < $totalpage && $no < $page_line ; $i ++) { $no ++; if ( $page == $i ) { $is_1 = "<b>" ; $is_2 = "</b>" ; } else { $is_1 = '<a href="' . $url . '/' . $search . '/' . $i . '.html">' ; $is_2 = "</a>" ; } $pagenum = $i +1; $returnstr .= " " . $is_1 . $pagenum . $is_2 ; } $returnstr = $firststr . $toppage . $prepage . $returnstr . $nextpage . $lastpage ; return $returnstr ; } |
这里的页码样式可以自行修改。
三、然后在48行左右找到:
1 | $listpage =page1( $num , $line , $page_line , $start , $page , $search ); |
修改为
1 | $listpage =page10( $num , $line , $page_line , $start , $page , $search ); |
四、修改:
1 | $search = "&searchid=" . $searchid ; |
为
1 | $search = "$searchid" ; |
搜索伪静态规则(例子为Apache,自己修改为对应的)
1 | RewriteRule ^search/(.+?)/(.+?).html$ /e/search/result/index.php?searchid=$1&page=$2 |
新闻热点
疑难解答