phpcms后台在线编辑模板禁止含有{php标签编辑的解决方法

1、开启后台在线编辑模板功能

找到caches\configs\system.php文件,找到'tpl_edit'=> 0,

系统默认是0,开启在线编辑模板功能只需把0改成1

 

2、phpcms禁止含有{php标签的编辑,修改两个文件

一个文件是phpcms/modules/template/file.php

将$code = str_replace(array('<?','{php'),array('<?','{ php'),$code);          //注释掉

另一个文件是phpcms\modules\template\templates\file_edit_file.tpl.php

把 function check_form() {
        //if(findInPage("{php")) {
               // alert("在线模板编辑禁止提交含有{php 的标签。");
               // return false;
       // } else if(findInPage("<\?php")) {
           //     alert('在线模板编辑禁止提交含有<\?php 的标签。');
            //    return false;
       // } else {
         //       myform.submit();
       // }
}

的内容注释掉,这样子就可以在线编辑模板了,为了安全性,并不建议这么做。

 

posted @ 2015-08-20 11:19  Ewbo  阅读(760)  评论(0)    收藏  举报