现在很多帝国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);

如此,帝国cms就可以实现控制面板模板头尾支持标签调用了。
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。