帝国CMS   发布时间:2022-05-06  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了分享一个效果:6.0的搜索页支持标签大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

搜索结果页支持标签: <?php require(\"../../class/connect.php\"); include(\"../../class/db_sql.php\");

搜索结果支持标签

<?PHP
require("../../class/connect.PHP");
include("../../class/db_sql.PHP");
include("../../data/dbcache/class.PHP");
require('../../class/functions.PHP');
require('../../class/t_functions.PHP');
include "../".LoadLang("pub/fun.PHP");

$editor=1;
$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']))
{
printerror("SearchNotRecord",1);
}
$page=(int)$_GET['page'];
$start=0;
$page_line=$public_r['search_pagenum'];//每页显示链接
$line=$public_r['search_num'];//每页显示记录数
if(!(int)$_GET['line']){
$line=$public_r['search_num'];//每页显示记录数
}else{
$line=(int)$_GET['line'];
$search="&line=".(int)$_GET['line'];
}
$search.="&classid=".(int)$_GET['classid'];
$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]." where checked=1".$add;
$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 tempid,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 tempid,docode from ".GetTemptb("enewssearchtemp")." where isdefault=1 limit 1");

}
else
{
$tempr=$empire->fetch1("SELEct tempid,docode from ".GetTemptb("enewssearchtemp")." where tempid='".$class_r[$search_r[trueclassid]][searchtempid]."' limit 1");

}
$have_class=1;

//页面支持标签(知行网络)
$tempr[temptext]=DtNewsBq('list'.$tempr[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,$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);
$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);
?>

将此文件放到e/search/result/index.PHP目录覆盖就OK了

大佬总结

以上是大佬教程为你收集整理的分享一个效果:6.0的搜索页支持标签全部内容,希望文章能够帮你解决分享一个效果:6.0的搜索页支持标签所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: