ecshop页面列表页详情页出现乱码解决方法

2019-10-23 lexiaoyao 1899

ecshop页面列表页详情页出现乱码解决

ecshop系统我相信大家都知道它了,国内搞个小的商城都会用到它了,但国内的产品总会有一些问题了,下面我们来介绍的就是解决ecshop页面列表页详情页出现乱码问题。

ecshop程序有时无故出现554fcae493e564ee0dc75bdf2ebf94ca错误代码,比如:

1

2

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方法,改为如下代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

function fetch_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);

}

}*/

return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);

}

四、更早版本的ecshop出现这种问题

解决方法:同样打开includes/cls_template.php文件,注释如下代码:

1

$source = preg_replace("/<\?[^><]+\?>/i", "", $source);

五、如果不是554fcae493e564ee0dc75bdf2ebf94ca错误提示,出现乱码那就是编码问题,需转换相应文件编码.

以上就是ecshop页面列表页详情页出现乱码解决方法的详细内容,更多请关注php知识-学习天地 www.lxywzjs.com其它相关文章!

分享至:

分享到QQ空间 分享到朋友社区 新浪微博分享

栏目地图