急!急!急!高手看看这源码哪里错了?
2016-07-07 16:48 来源:www.chinab4c.com 作者:ecshop专家
Warning: unserialize() expects parameter 1 to be string, array given in /home/mxxcc/public_html/uc_client/model/cache.php on line 89 这是首次打开新店在页面上方出现的,刷新后就没有了。 下边是这个文件的源码: <?php /* [UCenter] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: cache.php 846 2008-12-08 05:37:05Z zhaoxiongfei $ */ !defined('IN_UC') && exit('Access Denied'); if(!function_exists('file_put_contents')) { function file_put_contents($filename, $s) { $fp = @fopen($filename, 'w'); @fwrite($fp, $s); @fclose($fp); } } class cachemodel { var $db; var $base; var $map; function __construct(&$base) { $this->cachemodel($base); } function cachemodel(&$base) { $this->base = $base; $this->db = $base->db; $this->map = array( 'settings' => array('settings'), 'badwords' => array('badwords'), 'apps' => array('apps') ); } //public function updatedata($cachefile = '') { if($cachefile) { foreach((array)$this->map[$cachefile] as $modules) { $s = "<?php\r\n"; foreach((array)$modules as $m) { $method = "_get_$m"; $s .= '$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n"; } $s .= "\r\n?>"; @file_put_contents(UC_DATADIR."./cache/$cachefile.php", $s); } } else { foreach((array)$this->map as $file => $modules) { $s = "<?php\r\n"; foreach($modules as $m) { $method = "_get_$m"; $s .= '$_CACHE[\''.$m.'\'] = '.var_export($this->$method(), TRUE).";\r\n"; } $s .= "\r\n?>"; @file_put_contents(UC_DATADIR."./cache/$file.php", $s); } } } function updatetpl() { } //private function _get_badwords() { $data = $this->db->fetch_all("SELECT * FROM ".UC_DBTABLEPRE."badwords"); $return = array(); if(is_array($data)) { foreach($data as $k => $v) { $return['findpattern'][$k] = $v['findpattern']; $return['replace'][$k] = $v['replacement']; } } return $return; } //private function _get_apps() { $this->base->load('app'); $apps = $_ENV['app']->get_apps(); $apps2 = array(); if(is_array($apps)) { foreach($apps as $v) { $v['extra'] = unserialize($v['extra']); $apps2[$v['appid']] = $v; } } return $apps2; } function _get_settings() { return $this->base->get_setting(); } } ?> |
回答:
源程序的小问题,修改 _get_app()方法 function _get_apps() { $this->base->load('app'); $apps = $_ENV['app']->get_apps(); $apps2 = array(); if(is_array($apps)) { foreach($apps as $v) { if(!is_array($v['extra'])){ $v['extra'] = unserialize($v['extra']); } $apps2[$v['appid']] = $v; } } return $apps2; } |
最近更新
常用插件
- ecshop使用手机验证码登陆
ecshop使用手机验证码登陆,这个功能很新颖,有些特殊的ecshop站点,他到...
- ecshop中nginx实现url的重写
上几章为了让ecshop很好的在nginx上运行。我们搭配了ecshop的nginx下的工作...
- ecshop商品分类名称增加样
ecshop插件介绍:本插件可以方便在后台管理,为ecshop商品分类名称增加样...
- ecshop根据订单批量发红包
ecshop根据订单批量发红包 ,大家肯定对ecshop红包不陌生,但是对ecshop订...
- ecshop 手机注册验证插件
ecshop 手机注册验证插件 ,需要通过手机获短信,然后注册验证 价格:...
ecshop热门问答
ecshop热门资料
ecshop演示站
ecshop到期
ecshop帝国
ecshop网站空间
ecshop播放器
ecshop会员导出
ecshop淑女匠
ecshop局部
ecshopdefault
ecshop分类模板
ecshop推荐朋友
ecshop团购说明
ecshop网页显示
ecshop详解介绍
ecshopemoi
ecshop删改
ecshop找到你
ecshop图里
ecshopHEAD
ecshop商品顺序
ecshop提取分类
ecshop新窗口
ecshop专版
ecshopmodel
ecshop软件包
ecshop本网价格
ecshop自动执行
ecshop板子
ecshop女孩
ecshop老友