帝国cms让控制面板模板头尾也支持标签调用的教程方法

帝国cms让控制面板模板头尾也支持标签调用的教程方法

来源:帝国CMS模板网 作者:帝国CMS教程 时间:2014-02-02
浏览:6.5千+ 收藏 点赞(8)
简介: 修改/e/clas/functions.php文件,找到解析代码function RepExeCode($string)在这之前添加标签替换4function CustomNewsBq($name,$indextext){ global $empire,$dbtbpr

修改/e/class/functions.php文件,找到

//解析代码
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模板网 帝国CMS模板网(www.daixiao360.cn)长期承接帝国CMS模板定制,帝国CMS仿站,帝国CMS采集规则,帝国CMS插件,帝国CMS二次开发。