fetch1("select * from {$dbtbpre}enewssearch where searchid='$searchid'"); if(empty($search_r['searchid'])||InfoIsInTable($search_r[tbname])) { printerror("SearchNotRecord",$getfrom,1); } $page=(int)$_GET['page']; $page=RepPIntvar($page); $start=0; $page_line=$public_r['search_pagenum'];//每页昄链接?$line=$public_r['search_num'];//每页昄记录?$offset=$page*$line;//dU量 $search="&searchid=".$searchid; $myorder=$search_r[orderby]; if(empty($search_r[myorder])) { $myorder.=" desc"; } $add=stripSlashes($search_r['andsql']); $num=$search_r[result_num]; if($search_r[tbname] == 'zt'){ $query="select * from {$dbtbpre}enews".$search_r[tbname].($add?' where '.substr($add,5):''); $query.=" order by ".$myorder." limit $offset,$line"; $query =str_replace("title","ztname",$query); $query =str_replace("keyboard","ztpagekey",$query); $query =str_replace("newstime","addtime",$query); }else{ $query="select * from {$dbtbpre}ecms_".$search_r[tbname].($add?' where '.substr($add,5):''); $query.=" order by ".$myorder." limit $offset,$line"; } //echo $query; $sql=$empire->query($query); $listpage=page1($num,$line,$page_line,$start,$page,$search); //取得模板 if($search_r['tempid']) { $tempr=$empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from ".GetTemptb("enewssearchtemp")." where tempid='".$search_r['tempid']."' limit 1"); } elseif(empty($class_r[$search_r[trueclassid]][searchtempid])) { $tempr=$empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from ".GetTemptb("enewssearchtemp")." where isdefault=1 limit 1"); } else { $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"); } $have_class=1; //面支持标签 //$tempr[temptext]=DtNewsBq('list'.$tempid,$tempr[temptext],0); //替换公共模板变量 $listtemp=$tempr[temptext]; if($public_r['searchtempvar']) { $listtemp=ReplaceTempvar($listtemp); } $search_r[keyboard]=ehtmlspecialchars($search_r[keyboard]); //相关搜烦 $xgsql=$empire->query("select * from {$dbtbpre}enewstags where tagname like '%$search_r[keyboard]%' limit 15"); //查询新闻表最?0条记?if (mysql_num_rows($xgsql) < 1){$xgss='
暂无相关搜烦
';} while($s=$empire->fetch($xgsql)) { $xgss=$xgss.''.$s[tagname].''; } $listtemp=str_replace("[!--xgss--]",$xgss,$listtemp); $listtemp=str_replace("[!--show.page--]",$listpage,$listtemp); $listtemp=str_replace("[!--keyboard--]",$search_r[keyboard],$listtemp); $listtemp=str_replace("[!--ssclassid--]",$search_r[trueclassid],$listtemp); $listtemp=str_replace("[!--ssorder--]",$search_r[orderby],$listtemp); $listtemp=str_replace("[!--ssgeshi--]",$search_r[geshi],$listtemp); $listtemp=str_replace("[!--ssyuanchuang--]",$search_r[yuanchuang],$listtemp); $listtemp=str_replace("[!--ssbanshi--]",$search_r[banshi],$listtemp); $listtemp=str_replace("[!--sssexi--]",$search_r[sexi],$listtemp); $listtemp=str_replace("[!--ecms.num--]",$num,$listtemp); $url="".$fun_r['index']." > ".$fun_r['adsearch']; $pagetitle=$fun_r['adsearch']." ".$search_r[keyboard]; $listtemp=ReplaceSvars($listtemp,$url,0,$pagetitle,$pagetitle,$pagetitle,$add,0); $rownum=$tempr[rownum]; if(empty($rownum)) { $rownum=1; } $formatdate=$tempr[showdate]; $subnews=$tempr[subnews]; $subtitle=$tempr[subtitle]; $docode=$tempr[docode]; $modid=$tempr[modid]; $listvar=str_replace('[!--news.url--]',$public_r[newsurl],$tempr[listvar]); //字段 $ret_r=ReturnReplaceListF($tempr[modid]); //取得列表模板 $list_exp="[!--empirenews.listtemp--]"; $list_r=explode($list_exp,$listtemp); $listtext=$list_r[1]; $no=$offset+1; $changerow=1; while($r=$empire->fetch($sql)) { //替换列表变量 $repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r,$docode); $listtext=str_replace("",$repvar,$listtext); //$listtext=str_replace($search_r[keyboard],"$search_r[keyboard]",$listtext); $listtext=preg_replace('/(?!<[^>]*)'.$search_r[keyboard].'(?![^<]*>)/',''.$search_r[keyboard].'',$listtext); $pa = new PhpAnalysis(); $pa->SetSource($search_r[keyboard]); $pa->resultType = 2; $pa->differMax = true; $pa->StartAnalysis(); $parr = $pa->GetFinallyIndex(); for($i=0;$i]*)'.$s.'(?![^<]*>)/',''.$s.'',$listtext); //$listtext=str_replace($s,"$s",$listtext); } $changerow+=1; //过行数 if($changerow>$rownum) { $changerow=1; $string.=$listtext; $listtext=$list_r[1]; } $no++; } db_close(); $empire=null; //多余数据 if($changerow<=$rownum&&$listtext<>$list_r[1]) { $string.=$listtext; } $string=$list_r[0].$string.$list_r[2]; echo stripSlashes($string); ?> 10Ӽ