現在很多帝國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就可以實現控制面板模板頭尾支持標簽調用了。
新聞熱點
疑難解答