详情页

帝国CMS控制面板/会员中心模板支持变量标签调用

时间:2024年04月01日

编辑:佚名

现在很多帝国CMS网站的会员中心头尾与网站首页的头尾是一样的,这就要求帝国CMS的会员中心也就是控制面版能支持标签调用,支持模板变量调用,如:[!---temp.header--]
但是帝国CMS本身是不支持的。
通过以下教程可以实现控制面版也就是会中心也支持调用模板变量标签。
第一步:
找到
=============================
//解析代码
function RepExeCode($string)
=============================
在这上面添加以下代码:
//标签替换4
function CustomNewsBq($name,$indextext){
global $empire,$dbtbpre,$public_r,$emod_r,$class_r,$class_zr,$fun_r,$navclassid,$navinfor,$class_tr,$level_r,$etable_r;
$file=ECMS_PATH.'e/data/tmp/dt_temp'.$name.'.php';
$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;
}
第二步:
查找:
WriteFiletext($file1,AddCheckViewTempCode().$r[0]);
修改为:
$tmplist= CustomNewsBq ("cp0",$r[0]);
WriteFiletext($file1,$tmplist);
第三步:
找到:
WriteFiletext($file2,AddCheckViewTempCode().$r[1]);
修改为:
$tmplist= CustomNewsBq ("cp1",$r[1]);
WriteFiletext($file2,$tmplist);
相关文章
猜你需要