国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > CMS > 帝國Empire > 正文

讓7.0的搜索模板也支持動態(tài)標(biāo)簽

2024-08-28 12:23:27
字體:
供稿:網(wǎng)友

   讓7.0的搜索模板也支持動態(tài)標(biāo)簽,原修改過這個(gè)文件,但在7.0中已經(jīng)不適用了,重新修改,測試可用!

  代碼如下:

  <?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');//關(guān)閉模塊

  $link=db_connect();

  $empire=new mysqlquery();

  $getvar=$_GET['getvar'];

  if(empty($getvar))

  {

  $getfrom="history.go(-1)";

  }

  else

  {

  $getfrom="../../../search/";

  }

  //搜索結(jié)果

  $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",$getfrom,1);

  }

  $page=(int)$_GET['page'];

  $page=RepPIntvar($page);

  $start=0;

  $page_line=$public_r['search_pagenum'];//每頁顯示鏈接數(shù)

  $line=$public_r['search_num'];//每頁顯示記錄數(shù)

  $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,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;

  //頁面支持標(biāo)簽

  $tempr[temptext]=DtNewsBq('list'.$tempid,$tempr[temptext],0);

  //替換公共模板變量

  $listtemp=$tempr[temptext];

  if($public_r['searchtempvar'])

  {

  $listtemp=ReplaceTempvar($listtemp);

  }

  $search_r[keyboard]=htmlspecialchars($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='".$public_r[newsurl]."'>".$fun_r['index']."</a>&nbsp;>&nbsp;".$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("<!--list.var".$changerow."-->",$repvar,$listtext);

  $listtext=str_replace($search_r[keyboard],"<font color='red'>$search_r[keyboard]</font>",$listtext);

  $changerow+=1;

  //超過行數(shù)

  if($changerow>$rownum)

  {

  $changerow=1;

  $string.=$listtext;

  $listtext=$list_r[1];

  }

  $no++;

  }

  db_close();

  $empire=null;

  //多余數(shù)據(jù)

  if($changerow<=$rownum&&$listtext<>$list_r[1])

  {

  $string.=$listtext;

  }

  $string=$list_r[0].$string.$list_r[2];

  echo stripSlashes($string);

  ?>

  將此文件放到e/search/result/index.php目錄覆蓋就OK了

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 阿拉尔市| 二连浩特市| 阿瓦提县| 湛江市| 汕头市| 南丹县| 淮阳县| 寿阳县| 青铜峡市| 宁城县| 左权县| 吴忠市| 玉树县| 南木林县| 刚察县| 永川市| 祁阳县| 苏州市| 准格尔旗| 凉山| 施秉县| 阿鲁科尔沁旗| 黄骅市| 利辛县| 梁平县| 彭州市| 西藏| 福清市| 怀宁县| 青田县| 本溪市| 马公市| 尖扎县| 浠水县| 扎赉特旗| 布尔津县| 浙江省| 康乐县| 肥东县| 高青县| 高青县|