003 | require( '../../class/connect.php' ); |
005 | require( '../../class/db_sql.php' ); |
007 | require( '../../class/functions.php' ); |
009 | require( '../../class/t_functions.php' ); |
011 | require( '../../data/dbcache/class.php' ); |
013 | require "../" .LoadLang( "pub/fun.php" ); |
017 | eCheckCloseMods( 'search' );//关闭模块 |
021 | $empire=new mysqlquery(); |
023 | $getvar=$_GET[ 'getvar' ]; |
027 | $getfrom= "history.go(-1)" ; |
031 | $getfrom= "../../../search/" ; |
037 | $searchid=(int)$_GET[ 'searchid' ]; |
039 | if (empty($searchid)) { |
041 | printerror( "SearchNotRecord" ,$getfrom,1); |
045 | $search_r=$empire->fetch1( "select searchid,keyboard,result_num,orderby,myorder,tbname,tempid,andsql,trueclassid from {$dbtbpre}enewssearch where searchid='$searchid'" ); |
047 | if (empty($search_r[ 'searchid' ])||InfoIsInTable($search_r[tbname])) { |
049 | printerror( "SearchNotRecord" ,$getfrom,1); |
053 | $page=(int)$_GET[ 'page' ]; |
055 | $page=RepPIntvar($page); |
059 | $page_line=$public_r[ 'search_pagenum' ];//每页显示链接数 |
061 | $line=$public_r[ 'search_num' ];//每页显示记录数 |
063 | $offset=$page*$line;//总偏移量 |
065 | $search= "&searchid=" .$searchid; |
067 | $myorder=$search_r[orderby]; |
069 | if (empty($search_r[myorder])) { |
075 | $add=stripSlashes($search_r[ 'andsql' ]); |
077 | $num=$search_r[result_num]; |
079 | $query= "select * from {$dbtbpre}ecms_" .$search_r[tbname].($add? ' where ' .substr($add,5): '' ); |
081 | $query.= " order by " .$myorder. " limit $offset,$line" ; |
083 | $sql=$empire->query($query); |
085 | $listpage=page1($num,$line,$page_line,$start,$page,$search); |
089 | if ($search_r[ 'tempid' ]) { |
091 | $tempr=$empire->fetch1( "select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " .GetTemptb( "enewssearchtemp" ). " where tempid='" .$search_r['tempid ']."' limit 1"); |
093 | } elseif(empty($class_r[$search_r[trueclassid]][searchtempid])) { |
095 | $tempr=$empire->fetch1( "select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " .GetTemptb( "enewssearchtemp" ). " where isdefault=1 limit 1" ); |
099 | $tempr=$empire->fetch1( "select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from " .GetTemptb( "enewssearchtemp" ). " where tempid='" .$class_r[$search_r[trueclassid]][searchtempid]. "' limit 1" ); |
103 | $have_class=1;//页面支持标签 |
105 | $tempr[temptext]=DtNewsBq( 'listsearch' .$search_r[ 'tempid' ],$tempr[temptext],0);//替换公共模板变量 |
107 | $listtemp=$tempr[temptext]; |
109 | if ($public_r[ 'searchtempvar' ]) { $listtemp=ReplaceTempvar($listtemp); |
113 | $search_r[keyboard]=ehtmlspecialchars($search_r[keyboard]); |
115 | $listtemp=str_replace( "[!--show.page--]" ,$listpage,$listtemp); |
117 | $listtemp=str_replace( "[!--keyboard--]" ,$search_r[keyboard],$listtemp); |
119 | $listtemp=str_replace( "[!--ecms.num--]" ,$num,$listtemp); |
121 | $url= "<a href='" .ReturnSiteIndexUrl(). "'>" .$fun_r[ 'index' ]. "</a> > " .$fun_r[ 'adsearch' ]; |
123 | $pagetitle=$fun_r[ 'adsearch' ]. " " .$search_r[keyboard]; |
125 | $listtemp=ReplaceSvars($listtemp,$url,0,$pagetitle,$pagetitle,$pagetitle,$add,0); |
127 | $rownum=$tempr[rownum]; |
129 | if (empty($rownum)) { $rownum=1; |
133 | $formatdate=$tempr[showdate]; |
135 | $subnews=$tempr[subnews]; |
137 | $subtitle=$tempr[subtitle]; |
139 | $docode=$tempr[docode]; |
143 | $listvar=str_replace( '[!--news.url--]' ,$public_r[newsurl],$tempr[listvar]); |
147 | $ret_r=ReturnReplaceListF($tempr[modid]); |
151 | $list_exp= "[!--empirenews.listtemp--]" ; |
153 | $list_r=explode($list_exp,$listtemp); |
161 | while ($r=$empire->fetch($sql)) { |
165 | $repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r,$docode); |
167 | $listtext=str_replace( "<!--list.var" .$changerow. "-->" ,$repvar,$listtext); |
169 | $listtext=str_replace($search_r[keyboard], "<font color='red'>$search_r[keyboard]</font>" ,$listtext); |
175 | if ($changerow>$rownum) { |
191 | if ($changerow<=$rownum&&$listtext<>$list_r[1]) { |
197 | $string=$list_r[0].$string.$list_r[2]; |
199 | echo stripSlashes($string); |
|
发表评论
评论列表(0条)