总结ecshop列表及详情页乱码问题解决方法
发布时间:2019-12-16 11:16:20作者:admin点击:
ecshop程序有时无故出现554fcae493e564ee0dc75bdf2ebf94ca错误代码,比如:
554fcae493e564ee0dc75bdf2ebf94camember_info|a:1:{s:4:"name";s:11:"member_info";}554fcae493e564ee0dc75bdf2ebf94ca
554fcae493e564ee0dc75bdf2ebf94cacart_info|a:1:{s:4:"name";s:9:"cart_info";}554fcae493e564ee0dc75bdf2ebf94ca
一、首先清下后台缓存,看是否还会出现错误;
二、页面有程序方面错误,这是修改而导致的(只要有程序错误代码先解决掉、再清空缓存)。
三、2.7.3版本后,模板不支持php写法,而部分模板里(京东模板)带有diyfile.php处理php代码文件,所以有关php代码都无法编译加载出来。
解决办法:
打开includes/cls_template.php文件,找到fetch_str方法,改为如下代码:
functionfetch_str($source) { if(!defined('ECS_ADMIN')) { $source=$this->smarty_prefilter_preCompile($source); } /*if(preg_match_all('~(<\\?(?:\\w+|=)?|\\?>|language\\s*=\\s*[\\"\\']?php[\\"\\']?)~is',$source,$sp_match)) { $sp_match[1]=array_unique($sp_match[1]); for($curr_sp=0,$for_max2=count($sp_match[1]);$curr_sp<$for_max2;$curr_sp++) { $source=str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$source); } for($curr_sp=0,$for_max2=count($sp_match[1]);$curr_sp<$for_max2;$curr_sp++) { $source=str_replace('%%%SMARTYSP'.$curr_sp.'%%%',''."\\n",$source); } }*/ returnpreg_replace("/{([^\\}\\{\\n]*)}/e","\\$this->select('\\\\1');",$source); }
四、更早版本的ecshop出现这种问题
解决方法:同样打开includes/cls_template.php文件,注释如下代码:
$source = preg_replace("/<\?[^><]+\?>/i", "", $source);
五、如果不是554fcae493e564ee0dc75bdf2ebf94ca错误提示,出现乱码那就是编码问题,需转换相应文件编码。