现在很多帝国CMS网站的会员中心头尾与网站首页的头尾是一样的,这就要求帝国CMS的会员中心也就是控制面版能支持标签调用,支持模板变量调用,如:[!---temp.header--]
但是帝国CMS本身是不支持的。
通过以下教程可以实现控制面版也就是会中心也支持调用模板变量标签。
第一步:
打开/e/class/functions.php 找到
| 1 2 3 4 | =============================//解析代码function RepExeCode($string)============================= |
在这上面添加以下代码:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | //标签替换4function 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;} |
第二步:
查找:
| 1 | WriteFiletext($file1,AddCheckViewTempCode().$r[0]); |
修改为:
| 1 2 | $tmplist= CustomNewsBq ("cp0",$r[0]);WriteFiletext($file1,$tmplist); |
第三步:
找到:
| 1 | WriteFiletext($file2,AddCheckViewTempCode().$r[1]); |
修改为:
| 1 2 | $tmplist= CustomNewsBq ("cp1",$r[1]);WriteFiletext($file2,$tmplist); |
如此,帝国cms就可以实现控制面板模板头尾支持标签调用了。
新闻热点
疑难解答