解決帝國CMS搜索模板不支持靈動標籤的方法支持到7.5

帝國CMS搜索模板代碼修改

打開/e/class/functions.php文件,搜索 //標籤替換4  ,在它的標籤的後面增長一個標籤,代碼以下:php

//標籤替換5 
function DtNewsBq2($classid,$indextext,$ecms=0){ 
global $empire,$dbtbpre,$public_r,$emod_r,$class_r,$class_zr,$fun_r,$navclassid,$navinfor,$class_tr,$level_r,$etable_r; 
$cachetime=0; 
$file=ECMS_PATH.'e/data/tmp/list'.$classid.'.php'; 
if($cachetime&&file_exists($file)){ 
$filetime=filemtime($file); 
$string=RepExeCode($string);//解析代碼 
return $string; 
} 
$indextext=stripSlashes($indextext); 
$indextext=ReplaceTempvar($indextext);//替換全局模板變量 
//替換標籤 
$indextext=DoRepEcmsLoopBq($indextext); 
$indextext=RepBq($indextext); 
//寫文件 
WriteFiletext($file,AddCheckViewTempCode().$indextext); 
//讀取文件內容 
ob_start(); 
include($file); 
$string=ob_get_contents(); 
ob_end_clean(); 
$string=RepExeCode($string);//解析代碼 
return $string; 
}

打開/e/search/result/index.php文件,查找 //替換公共模板變量 此處修改成如下代碼:sql

//頁面支持標籤 
$tempr[temptext]=DtNewsBq2('list'.$tempid,$tempr[temptext],0);

打開/e/search/result/index.php文件,找到以下代碼(通常是在最頂):oop

<?php 
require("../../class/connect.php"); 
require("../../class/db_sql.php"); 
require("../../data/dbcache/class.php"); 
require("../../class/q_functions.php"); 
require "../".LoadLang("pub/fun.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");

最後打開帝國CMS搜索頁面模板,使用帝國CMS靈動標籤調用網站內容就能夠調用成功了。若是調用不成功的請仔細閱讀再作修改,注意修改帝國CMS搜索模板文件的時候要備份哦。ui

相關文章
相關標籤/搜索