复制以下代码到e/search/result/index.PHP
<?PHP require('../../class/connect.PHP');require('../../class/db_sql.PHP');require('../../class/functions.PHP');require('../../class/t_functions.PHP');require('../../data/dbcache/class.PHP');require "../".LoadLang("pub/fun.PHP");$editor=1;eCheckCloseMods('search');//关闭模块 $link=db_connect();$empire=new MysqLquery();$getvar=$_GET['getvar'];if(empty($getvar)) { $getfrom="history.go(-1)";} else { $getfrom="../../../search/";}//搜索结果 $searchID=(int)$_GET['searchID'];if(empty($searchID)) { printerror("SearchNotRecord",$getfrom,1);} $search_r=$empire->fetch1("select searchID,keyboard,result_num,orderby,myorder,tbname,tempID,andsql,trueclassID from {$dbtbpre}enewssearch where searchID='$searchID'");if(empty($search_r['searchID'])||InfoIsIntable($search_r[tbname])) { printerror("SearchNotRecord",1);} $page=(int)$_GET['page'];$page=RepPIntvar($page);$start=0;$page_line=$public_r['search_pagenum'];//每页显示链接数 $line=$public_r['search_num'];//每页显示记录数 $offset=$page*$line;//总偏移量 $search="&searchID=".$searchID;$myorder=$search_r[orderby];if(empty($search_r[myorder])) { $myorder.=" desc";} $add=stripSlashes($search_r['andsql']);$num=$search_r[result_num];$query="select * from {$dbtbpre}eCMS_".$search_r[tbname].($add?' where '.substr($add,5):'');$query.=" order by ".$myorder." limit $offset,$line";$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,docode from ".GetTemptb("enewssearchtemp")." where isdefault=1 limit 1");} else { $tempr=$empire->fetch1("select temptext,docode from ".GetTemptb("enewssearchtemp")." where tempID='".$class_r[$search_r[trueclassID]][searchtempID]."' limit 1");} $have_class=1;//页面支持标签 $tempr[temptext]=DtNewsBq('Listsearch'.$search_r['tempID'],$tempr[temptext],0);//替换公共模板变量 $Listtemp=$tempr[temptext];if($public_r['searchtempvar']) { $Listtemp=ReplaceTempvar($Listtemp);} $search_r[keyboard]=eHTMLspecialchars($search_r[keyboard]);$Listtemp=str_replace("[!--show.page--]",$Listpage,$Listtemp);$Listtemp=str_replace("[!--keyboard--]",$search_r[keyboard],$Listtemp);$Listtemp=str_replace("[!--eCMS.num--]",$num,$Listtemp);$url="<a href='".ReturnSiteIndexUrl()."'>".$fun_r['index']."</a> > ".$fun_r['adsearch'];$pageTitle=$fun_r['adsearch']." ".$search_r[keyboard];$Listtemp=ReplaceSvars($Listtemp,$url,$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,$have_class,$r,$ret_r,$docode);$Listtext=str_replace("<!--List.var".$changerow."-->",$repvar,$Listtext);$Listtext=str_replace($search_r[keyboard],"<Font color='red'>$search_r[keyboard]</Font>",$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);?>总结
以上是内存溢出为你收集整理的帝国cms搜索模板支持调用动态标签方法全部内容,希望文章能够帮你解决帝国cms搜索模板支持调用动态标签方法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)