Ecshop模板高,而程序版本低报错解决办法
- 格式:doc
- 大小:28.00 KB
- 文档页数:3
织梦dedecms后台编辑器样式错乱,变为px=""yle=的解决办法
在用图集模型建站的时候,新建了一个自定义模型,为HTML文本。
建立之后发布完成文档后,点击编辑后,样式竟然全部出现了错乱。
如下图所示:
在百度和官方论坛寻找解决办法,但是网站上的办法并不起作用。
最后发现问题可能出现在album_edit.php这个文件:
在代码里面搜索发现是可能是因为过滤引起的。
解决办法:
打开/dede/album_edit.php文件,在第56行的位置找到如下代码,直接去掉或者注释掉即可
希望跟版网这条解决方案可以帮到您!。
Ecshop常见问题汇总ECSHOP开发中心()1、如何修改网站"欢迎光临本店"回答(1) languages\zh_cn\common.php文件中,$_LANG['welcome'] = '欢迎光临本店';将他修改成你需要的字样。
还有member_info.lbi里面的welcome字样。
回答(2) 打开网站后台-模板选择-语言项编辑选择公共语言包-搜索“欢迎”进行修改2、如何修改登录\注册字体的颜色在库文件member_info.lbi 中修改3、如何修改首页"热门搜索关键字"后台-系统设置-网店设置-显示设置-首页搜索关键字,修改他的内容,然后保存,必须是英文半角字符隔开4、如何修改首页标题"Powered by ECShop"includes/lib_main.php,找到$page_title = $GLOBALS['_CFG']['shop_title'] . ' - ' .'Powered by ECShop';修改成$page_title = $GLOBALS['_CFG']['shop_title']就可以了。
5、如何发布首页公告后台->系统设置->商店设置->网店信息->商店公告.6、如何修改网站logo用你的logo图片替换/themes/当前使用模板/images/logo.gif (以你当前logo图的名称为准)7、如何去除ecshop产品详细页产品点击率模板文件中,打开goods.dwt,删除<strong>{$lang.goods_click_count}:</strong>{$goods.click_count}8、网站公告代码段在那里index.php文件中, $smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告代码段控制公告9、网站首页"精品推荐"显示数量在那里设置ecshop中,为了让更多更丰富的购买信息显示在首页,可以根据自己所在行业特点,根据自己所在行业购买行为的分析,在ecshop首页设置热买促销新品的数量,让版面更加合理,让用户体验.设置ecshop首页热买商品的数量.模板管理-> 设置模板-> 热买商品(修改其显示数量)修改下面的10为你需要的数量,这就是热买商品设置ecshop首页新品的数量.模板管理-> 设置模板-> 新品上架(修改其显示数量)修改下面的10为你需要的数量,这就是新品上架设置ecshop首页精品的数量.模板管理-> 设置模板-> 精品推荐(修改其显示数量)修改下面的10为你需要的数量,这就是精品推荐10、如何修改产品的库存商品管理-> 商品列表-> 选中(库存),编辑11、如何修改ecshop表的前缀修改data/config.php下的$prefix = "ecs_";将ecs_修改成你需要的前缀.其次,在数据库中,修改表名比如ecs_ad修改为"xxx_ad";12、如何调用促销产品后台-商品管理- 商品列表- 编辑产品- 通用信息- 勾上促销价-填写促销期限-保存-清除缓存13、如何显示商品品牌列表商品管理- 商品品牌- 增加品牌-> 保存增加该品牌下的产品商品管理- 增加新产品- 选择商品品牌- 保存- 清除缓存(ps:为什么我添加的品牌图片没有显示,很显然你上传的商品没有选择该品牌)14、如何修改ecshop导航栏目名称后台- 系统设置-> 自定义导航栏- 编辑- 修改导航栏名称(导航有顶部、中部和底部)15、ecshop产品相关的图片有哪几种$goods_img = ''; // 初始化商品图片$goods_thumb = ''; // 初始化商品缩略图$original_img = ''; // 初始化原始图片$old_original_img = ''; // 初始化原始图片旧图16、如何修改“支付方式”显示顺序打开ecs_payment表,如果你想让他显示在前面,你将设置pay_order值小一些,比如想让“支付宝”排第一,“快钱”排第二,你就可以设置支付宝pay_order=1,快钱pay_order=217、如何修改详细页的积分详细页面的积分在模板<strong>{$lang.goods_give_integral}</strong><font>{$goods.give_integral}{$points_name}</font>中来控制的18、如何修改产品缩略图大小后台- 系统设置- 网店设置- 显示设置- 缩略图宽度.,当然你也可以设置缩略图高度19、如何设置ecshop货币格式和日期格式后台- 系统设置- 网店设置- 显示设置- 货币格式(¥%s元)或者时间格式(Y-m-d H:i:s)20、如何开取和关闭ecshop登陆验证码后台- 系统设置- 验证码管理,开启或关闭21、ecshop如何删除“注册用户”,“VIP用户”价格会员管理- 会员等级- 删除或者不显示对应会员等级的价格22、如何修改调整ecshop用户中心左侧栏目模板文件library/user_menu.lbi中。
ecshop适应在PHP7的修改⽅法解决报错的实现ecshop这个系统,到⽬前也没见怎么推出新版本,如果是新项⽬,不太建议使⽤它。
不过,因为我⼀直以来都在使⽤中,所以不得不更改让其适应PHP新版本。
现在PHP 7已经出发⾏版了,所以更改来继续使⽤吧。
具体的更改有以下⽅⾯:(1)将mysql扩展的使⽤替换掉,改为使⽤mysqli或pdo:从php5.5开始,mysql扩展将废弃了。
具体更改的⽂件在于includes/cls_mysql.php。
这是个不⼩的⼯程,⽂件代码太长……if (!defined('DITAN_ECS')){die('Hacking attempt');}class cls_mysql{var $link_id = NULL;var $settings = array();var $queryCount = 0;var $queryTime = '';var $queryLog = array();var $max_cache_time = 300; // 最⼤的缓存时间,以秒为单位var $cache_data_dir = 'temp/query_caches/';var $root_path = '';var $error_message = array();var $platform = '';var $version = '';var $dbhash = '';var $starttime = 0;var $timeline = 0;var $timezone = 0;// 事务指令数protected $transTimes = 0;var $mysql_config_cache_file_time = 0;var $mysql_disable_cache_tables = array(); // 不允许被缓存的表,遇到将不会进⾏缓存function __construct($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'gbk', $pconnect = 0, $quiet = 0){$this->cls_mysql($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect, $quiet);}function cls_mysql($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'gbk', $pconnect = 0, $quiet = 0){if (defined('EC_CHARSET')){$charset = strtolower(str_replace('-', '', EC_CHARSET));}if (defined('ROOT_PATH') && !$this->root_path){$this->root_path = ROOT_PATH;}if ($quiet){$this->connect($dbhost, $dbuser, $dbpw, $dbname, $charset, $pconnect, $quiet);}else{$this->settings = array('dbhost' => $dbhost,'dbuser' => $dbuser,'dbpw' => $dbpw,'dbname' => $dbname,'charset' => $charset,'pconnect' => $pconnect);}}function connect($dbhost, $dbuser, $dbpw, $dbname = '', $charset = 'utf8', $pconnect = 0, $quiet = 0){if ($pconnect){$this->link_id = new mysqli('p:'.$dbhost, $dbuser, $dbpw);if ($this->link_id->connect_error){if (!$quiet){$this->ErrorMsg("Can't pConnect MySQL Server($dbhost)!");}return false;}}else{$this->link_id = new mysqli($dbhost, $dbuser, $dbpw);if ($this->link_id->connect_error){if (!$quiet){$this->ErrorMsg("Can't Connect MySQL Server($dbhost)!");}return false;}}$this->dbhash = md5($this->root_path . $dbhost . $dbuser . $dbpw . $dbname);$this->version = $this->link_id->server_version;/* 对字符集进⾏初始化 */$this->link_id->set_charset($charset);$this->link_id->query("SET sql_mode=''");$sqlcache_config_file = $this->root_path . $this->cache_data_dir . 'sqlcache_config_file_' . $this->dbhash . '.php';@include($sqlcache_config_file);$this->starttime = time();if ($this->max_cache_time && $this->starttime > $this->mysql_config_cache_file_time + $this->max_cache_time){if ($dbhost != '.'){$result = $this->link_id->query("SHOW VARIABLES LIKE 'basedir'");$row = $result->fetch_array(MYSQLI_ASSOC);$result->free();if (!empty($row['Value']{1}) && $row['Value']{1} == ':' && !empty($row['Value']{2}) && $row['Value']{2} == "/"){$this->platform = 'WINDOWS';}else{$this->platform = 'OTHER';}}else{$this->platform = 'WINDOWS';}if ($this->platform == 'OTHER' &&($dbhost != '.' && strtolower($dbhost) != 'localhost:3306' && $dbhost != '127.0.0.1:3306') ||date_default_timezone_get() == 'UTC'){$result = $this->link_id->query("SELECT UNIX_TIMESTAMP() AS timeline, UNIX_TIMESTAMP('" . date('Y-m-d H:i:s', $this->starttime) . "') AS timezone");$row = $result->fetch_array(MYSQLI_ASSOC);$result->free();if ($dbhost != '.' && strtolower($dbhost) != 'localhost:3306' && $dbhost != '127.0.0.1:3306'){$this->timeline = $this->starttime - $row['timeline'];}if (date_default_timezone_get() == 'UTC'){$this->timezone = $this->starttime - $row['timezone'];}}$content = '<' . "?php\r\n" .'$this->mysql_config_cache_file_time = ' . $this->starttime . ";\r\n" .'$this->timeline = ' . $this->timeline . ";\r\n" .'$this->timezone = ' . $this->timezone . ";\r\n" .'$this->platform = ' . "'" . $this->platform . "';\r\n?" . '>';@file_put_contents($sqlcache_config_file, $content);}/* 选择数据库 */if ($dbname){if ($this->link_id->select_db($dbname) === false ){if (!$quiet){$this->ErrorMsg("Can't select MySQL database($dbname)!");}return false;}else{return true;}}else{return true;}}function select_database($dbname){return $this->link_id->select_db($dbname);}function set_mysql_charset($charset){if (in_array(strtolower($charset), array('gbk', 'big5', 'utf-8', 'utf8'))){$charset = str_replace('-', '', $charset);}$this->link_id->set_charset($charset);}function fetch_array($query, $result_type = MYSQLI_ASSOC){$row = $query->fetch_array($result_type);$query->free();return $row;}function query($sql, $type = ''){if ($this->link_id === NULL){$this->connect($this->settings['dbhost'], $this->settings['dbuser'], $this->settings['dbpw'], $this->settings['dbname'], $this->settings['charset'], $this->settings['pconnect']); $this->settings = array();}if ($this->queryCount++ <= 99){$this->queryLog[] = $sql;}if ($this->queryTime == ''){if (PHP_VERSION >= '5.0.0'){$this->queryTime = microtime(true);}else{$this->queryTime = microtime();}}/* 当当前的时间⼤于类初始化时间的时候,⾃动执⾏ ping 这个⾃动重新连接操作 */if (time() > $this->starttime + 1){$this->link_id->ping();}if (!($query = $this->link_id->query($sql)) && $type != 'SILENT'){$this->error_message[]['message'] = 'MySQL Query Error';$this->error_message[]['sql'] = $sql;$this->error_message[]['error'] = $this->link_id->error;$this->error_message[]['errno'] = $this->link_id->errno;$this->ErrorMsg();return false;}if (defined('DEBUG_MODE') && (DEBUG_MODE & 8) == 8){$logfilename = $this->root_path . DATA_DIR . '/mysql_query_' . $this->dbhash . '_' . date('Y_m_d') . '.log'; $str = $sql . "\n\n";if (PHP_VERSION >= '5.0'){file_put_contents($logfilename, $str, FILE_APPEND);}else{$fp = @fopen($logfilename, 'ab+');if ($fp){fwrite($fp, $str);fclose($fp);}}}return $query;}function affected_rows(){return $this->link_id->affected_rows;}function error(){return $this->link_id->error;}function errno(){return $this->link_id->errno;}function result($query, $row){$query->data_seek($row);$result = $query->fetch_row();$query->free();return $result;}function num_rows($query){return $query->num_rows;}function num_fields($query){return $this->link_id->field_count;}function free_result($query){return $query->free();}function insert_id(){return $this->link_id->insert_id;}function fetchRow($query){return $query->fetch_assoc();}function fetch_fields($query){return $query->fetch_field();}function version(){return $this->version;}function ping(){return $this->link_id->ping();}function escape_string($unescaped_string){return $this->link_id->real_escape_string($unescaped_string);}function close(){return $this->link_id->close();}function ErrorMsg($message = '', $sql = ''){if ($message){echo "<b>DTXB info</b>: $message\n\n<br /><br />";//print('<a href="/?type=mysql&dberrno=2003&dberror=Can%27t%20connect%20to%20MySQL%20server%20on" target="_blank">/</a>');}else{echo "<b>MySQL server error report:";print_r($this->error_message);//echo "<br /><br /><a href='/?type=mysql&dberrno=" . $this->error_message[3]['errno'] . "&dberror=" . urlencode($this->error_message[2]['error']) . "' target='_blank'>/</a>"; }exit;}/* 仿真 Adodb 函数 */function selectLimit($sql, $num, $start = 0){if ($start == 0){$sql .= ' LIMIT ' . $num;}else{$sql .= ' LIMIT ' . $start . ', ' . $num;}return $this->query($sql);}function getOne($sql, $limited = false){if ($limited == true){$sql = trim($sql . ' LIMIT 1');}$res = $this->query($sql);if ($res !== false){$row = $res->fetch_row();$res->free();if ($row !== false){return $row[0];}else{return '';}}else{return false;}}function getOneCached($sql, $cached = 'FILEFIRST'){$sql = trim($sql . ' LIMIT 1');$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time;if (!$cachefirst){return $this->getOne($sql, true);}else{$result = $this->getSqlCacheData($sql, $cached);if (empty($result['storecache']) == true){return $result['data'];}}$arr = $this->getOne($sql, true);if ($arr !== false && $cachefirst){$this->setSqlCacheData($result, $arr);}return $arr;}function getAll($sql){$res = $this->query($sql);if ($res !== false){$arr = $res->fetch_all(MYSQLI_ASSOC);$res->free();return $arr;}else{return false;}}function getAllCached($sql, $cached = 'FILEFIRST'){$cachefirst = ($cached == 'FILEFIRST' || ($cached == 'MYSQLFIRST' && $this->platform != 'WINDOWS')) && $this->max_cache_time; if (!$cachefirst){return $this->getAll($sql);}else{$result = $this->getSqlCacheData以上就是⼩编为⼤家带来的ecshop适应在PHP7的修改⽅法解决报错的实现全部内容了,希望⼤家多多⽀持~。
不只是在模板修改中会碰到此类问题,在任何的DIV+CSS页面制作中都会碰到。
日前本站长在帮朋友制作ECSHOP模板的时候就遇到了这个兼容性问题。
我在最外层的DIV设置了一个 heiht:auto ,里面还有两级 div ,在IE下很正常,最外层的大DIV会随着内部的DIV的高度而变化,但是在火狐下就无效。
Firefox等符合W3C标准的浏览器中,如果有一个DIV作为外部容器,内部的DIV如果设置了float样式,则外部的容器DIV因为内部没有clear,导致不能被撑开。
例:<div style=" border:2px solid #0CC; width:600px;" ><div style=" width:50px; height:600px; border:#099 1px solid; margin-left:5px;float:left;display:inline"></div><div style=" width:50px; height:40px; border:#099 1px solid; margin-left:5px;float:left;display:inline "></div><div style=" width:50px; height:40px; border:#099 1px solid;float:right "></div><!-- <div style="clear:both"></div>--></div>解决方法如下,1.<div style=" border:2px solid #0CC; width:600px;" ><div style=" width:50px; height:600px; border:#099 1px solid; margin-left:5px;float:left;display:inline"></div><div style=" width:50px; height:40px; border:#099 1px solid; margin-left:5px;float:left;display:inline "></div><div style=" width:50px; height:40px; border:#099 1px solid;float:right "></div><div style="clear:both"></div> </div>在float:left的Div之后加入<div style="clear:both"></div> 这样加入的弊端是,JS DOM找节点时会出现了一个多余的节点,这个也是个没用的DIv2.直接在最大层加入 overflow:hidden; 这也是我用的解决手法!!简单--<div style=" border:2px solid #0CC; width:600px;overflow:hidden; " ><div style=" width:50px; height:600px; border:#099 1px solid; margin-left:5px;float:left;display:inline"></div><div style=" width:50px; height:40px; border:#099 1px solid; margin-left:5px; float:left;display:inline "></div><div style=" width:50px; height:40px; border:#099 1px solid;float:right "></div></div>3.今天研究163代码的时候也发现一种新的解决方法就是加入一个伪类!<div style=" border:2px solid #0CC; width:600px;" class="clearfix" ><div style=" width:50px; height:600px; border:#099 1px solid; margin-left:5px; float:left;display:inline"></div><div style=" width:50px; height:40px; border:#099 1px solid; margin-left:5px; float:left;display:inline "></div><div style=" width:50px; height:40px; border:#099 1px solid;float:right "></div></div>Css如下:<style>.clearfix:after{context:"."; height:"0"; display:block;clear:both;visibility:hidden} /* Hides from IE-mac \*/* html .clearfix {height: 1%;}/* End hide from IE-mac */</style>至于这种方法,IE5.5下对此类并不支持!!。
虚拟主机安装ecshop提示"安装数据错误"的解决办法
虚拟主机安装ecshop提示"安装数据错误"的解决办法
安装ecshop V2.6版需要安装先安装UC,利用虚拟主机控制面板的预装软件功能,预装ecshop后,请先访问http://您的域名/uc/install/index.php先安装UC,然后才能进行Ecshop 的安装。
特别提示:因为试用虚拟主机默认有IP限制,这会导致ecshop 安装时提示"安装数据错误",解决办法是在虚拟主机控制面板点"IP限制",将您申请的虚拟主机的IP地址添加上去,然后再进行ecshop的安装,就不会出错了.
安装discuz6.1如果遇到UC连接失败,也是相同的解决方案.。
学习使人进步1、Strict Standards: Non-static method cls_image::gd_version() should not be called statically in F:\xampp\htdocs\ceshi\includes\lib_base.php on line 346找到\lib_base.php 第346行将它注释//return cls_image::gd_version();添加$p = new cls_image();return $p->gd_version(); 即可2、Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\xampp\htdocs\ceshi\includes\cls_template.php on line 300找到\lib_template.php 第300行将它注释//return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source); 添加return preg_replace_callback("/{([^\}\{\n]*)}/", function($r){return $this->select($r[1]);}, $source); 即可3、Strict Standards: Only variables should be passed by reference in F:\xampp\htdocs\ceshi\includes\cls_template.php on line 422找到\lib_template.php 第422行将它注释//$tag_sel = array_shift(explode(' ', $tag));添加$tag_arr = explode(' ', $tag);$tag_sel = array_shift($tag_arr); 即可4、Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\xampp\htdocs\ceshi\includes\cls_template.php on line 1074找到\lib_template.php 第1074行//$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/se';// $replacement = "'{include file='.strtolower('\\1'). '}'";//$source = preg_replace($pattern, $replacement, $source);添加$pattern = '/<!--\s#BeginLibraryItem\s\"\/(.*?)\"\s-->.*?<!--\s#EndLibraryItem\s-->/s'; $replacement = function($r){return '{include file='.strtolower($r[1]). '}';}; $source = preg_replace_callback($pattern, $replacement, $source); 即可5、Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\xampp\htdocs\ceshi\includes\cls_template.php on line 496找到\lib_template.php 第496行将它注释//$out = "<?php \n" . '$k = ' . preg_replace("/(\'\\$[^,]+)/e" , "stripslashes(trim('\\1','\''));", var_export($t, true)) . ";\n";添加$out = "<?php \n" . '$k = ' . preg_replace_callback("/(\'\\$[^,]+)/", function(){return stripslashes(trim('\\1','\''));}, var_export($t, true)) . ";\n";即可6、Strict Standards: Only variables should be passed by reference in F:\xampp\htdocs\ceshi\includes\lib_main.php on line 1329找到\lib_main.php 第1329行将它注释// $ext = end(explode('.', $tmp));添加$ext = explode('.', $tmp);$ext = end($ext);即可7、Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in F:\xampp\htdocs\ceshi\includes\cls_template.php on line 556找到\lib_template.php 第556行//$val = preg_replace("/\[([^\[\]]*)\]/eis", "'.'.str_replace('$','\$','\\1')", $val);添加$val =preg_replace_callback("/\[([^\[\]]*)\]/is", function(){return '.'.str_replace('$','\$','\\1');}, $val); 即可8、Strict Standards: Declaration of vbb::set_cookie() should be compatible with integrate::set_cookie($username = '', $remember = NULL)子类的函数跟父类的同名,必须使子类的函数参数跟父类的对应函数参数个数相同依据错误提示,修改例如:function set_cookie ($username="")改为function set_cookie ($username="", $remember = NULL)9、Strict Standards: mktime(): You should be using the time() function instead in F:\xampp\htdocs\ceshi\admin\sms_url.php on line 31将$auth = mktime();替换为$auth = time();10、Strict Standards: Redefining already defined constructor for class alipay in F:\xampp\htdocs\ceshi\includes\modules\payment\alipay.php on line 85PHP 类,有两种构造函数,一种是跟类同名的函数,一种是____construct()。
解决ECSHOP“StrictStandards:Non解决ECSHOP"Strict Standards: Non-static methodcls_image"问题老蒋前面刚解决"解决ECSHOP出现"Deprecated:preg_replace()"报错提示问题",不过再次刷新页面又出现新的问题"Strict Standards: Non-static methodcls_image::gd_version() should not be called statically in",看这次是gd_version函数问题。
解决方法:include/cls_image.php将这一行:function gd_version()改成static function gd_version()然后替换文件之后刷新就解决问题。
ECShop 3.0安装出现错误:Non-static methodcls_image::gd_version()2014-06-18 15:10:59来源:威易网作者:icechECShop可以说是比较早的电商程序了,那个时候的运行环境在PHP 5.3及其以下版本。
不过目前流行的都是PHP 5.4版本,所以安装后运行就出现了一些小的错误。
ECShop可以说是比较早的电商程序了,那个时候的运行环境在PHP 5.3及其以下版本。
不过目前流行的都是PHP 5.4版本,所以安装后运行就出现了一些小的错误。
Strict Standards: Non-static method cls_image::gd_version() should not be called statically in E:\web\shopex\includes\lib_base.php on line 346PHP 5.3版本以上会出现这个错误。
ecshop计划任务不能运行的解决方法首先计划任务添加好后,在后台->商店设置中->基本设置->是否开启命令行调用计划任务->选择是这一步是最基本的但还是不能启动计划任务?原来在includes/lib_insert.php文件中的第63行$cron_method = empty($GLOBALS['_CFG']['cron_method']) ? '<img src="api/cron.php?t=' . gmtime() . '" alt="" style="width:0px;height:0px;" />' : '';明显的逻辑错误,如果后台设置了是否开启命令行调用计划任务->选择否,反而能触发计划任务..不知道是怎么想的所以只要大家是否开启命令行调用计划任务->选择否就应该能触发了为什么有的人还是不能呢?那你肯定用的不是系统模板只要在你模板的页脚文件:page_footer.lbi中加{insert name='query_info'}<br />就可以了这句话就是显示"共执行 26 个查询,用时 0.084101 秒,在线 45 人,Gzip 已禁用,占用内存 2.605 MB"这些东西的,也包括触发计划任务的语句"<img src="api/cron.php?t=1224439876" alt="" style="width:0px;height:0px;" />"计划任务没有启动的可以找找最模板排查下!。
解决ecshop网站模板使用错误
今天小编为大家带来的是解决ecshop网站模板使用错误,这里详细的介绍了怎幺解决ecshop网站模板在php5.5环境上使用错误,希望能对大家有所帮助。
服务器环境php大家用的版本不断提高,Ecshop没有来得及修改那幺及时。
兼容性有问题,有点淘汰了。
在php5.5上安装Ecshop出现报错:Onlyvariablesshouldbepassedbyreference
php 5.3以上版本的问题,应该也和配置有关只要418行把这一句拆成两句就没有问题了
$tag_sel=array_shift(explode('',$tag));改成:
$tag_arr=explode('',$tag);$tag_sel=array_shift($tag_arr); 因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值
修改
Deprecated:preg_replace():The/emodifierisdeprecated,usepreg_replace_callbackins tead...?找到cls_template.php
$out=“其他页面如果遇此报错,以此类推修改。
以上教程仅提供参考.
以上是给大家带来解决ecshop网站模板使用错误的内容,感谢大家继续支持我们的51。
ecshop错误大全概要:本文针对于对ecshop 接触时间不久的同事制作Maximum execution time of 30 seconds exceeded(30秒运行超时的错误。
)提示解答:修改php执行文件加上set_time_limit(0);?>“0”为永不过时,也可设置为其他时间。
二.安装Ecshop首页出现报错常见的问题解决办法(在网上看到整理的)安装Ecshop首页出现报错:Only variables should be passed by referen最近想安装一个ECSHOP商城上去,老是报错,出现下面这就话:Strict Standards: Only variables should be passed by reference inD:\**\includes\cls_template.php on line 406 第406行:$tag_sel = array_shift(explode(' ', $tag));解决办法 1 5.3以上版本的问题,应该也和配置有关只要406行把这一句拆成两句就没有问题了$tag_sel = array_shift(explode(' ', $tag));改成:$tag_arr = explode(' ', $tag);$tag_sel = array_shift($tag_arr);(实验过,绝对可行)因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值解决办法修改完了要记得清理缓存。
2 :或则如果这样配置的话:error_reporting = E_ALL | E_STRICT 估计也可(未测试过,实验中……)修改完上面这个问题之后,可能还会出现下面这个问题:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\**XX\ecshopshi\includes\lib_main.php on line 1316经过查询"includes\lib_main.php"文件的1316行发现,还是同样的问题://$ext = end(explode('.', $tmp));我们把上面这句拆分为下面这三句:$ext = end();$ar = explode('.', $tmp);$ext = end($ar);就正常了(亲自测试过的,没问题)$tmp = basename($tmp,".$ext");如果主机的GD库不存在或者版本不同还有可能出现下面这句错误提示:Strict Standards: Non-static method cls_image::gd_version() should not be called statically in D:\**X\includes\lib_base.php on line 346直接找到“includes\lib_base.php”文件的346行左右,将这句://return cls_image::gd_version();注释掉就可以了,当然,如果你的程序需要GD库支持,那就要咨询下服务器空间商了,只作简要说明Strict Standards: Only variables should be passed by reference inupload\includes\cls_template.php on line 418第418行:$tag_sel = array_shift(explode(' ', $tag));解决办法1 ():5.3以上版本的问题,应该也和配置有关只要418行把这一句拆成两句就没有问题了$tag_sel = array_shift(explode(' ', $tag)); 改成:$tag_arr = explode(' ', $tag); $tag_sel = array_shift($tag_arr);(实验过,绝对可行)因为array_shift的参数是引用传递的,5.3以上默认只能传递具体的变量,而不能通过函数返回值同理举一反三:遇到函数嵌套错误时可以分开写,错误自然解决如:function get_dyna_libs($theme, $tmp){$extsub = explode('.', $tmp);$ext = end($extsub);$tmp = basename($tmp,".$ext");$sql = 'SELECT region, library, sort_order, id, number, type' .' FROM ' . $GLOBALS['ecs']->table('template') ." WHERE theme = '$theme' AND filename = '" . $tmp . "' AND type > 0 AND remarks=''".' ORDER BY region, library, sort_order';$res = $GLOBALS['db']->getAll($sql);$dyna_libs = array();foreach ($res AS $row){$dyna_libs[$row['region']][$row['library']][] = array('id' => $row['id'],'number' => $row['number'],'type' => $row['type']);}return $dyna_libs;}将$ext = end(explode('.', $tmp));改为$extsub = explode('.', $tmp);$ext = end($extsub);解决办法2(屏蔽错误):或则如果这样配置的话:error_reporting = E_ALL | E_STRICTphp.ini中有如下设置:error_reporting = E_ALL | E_STRICT这是说,显示那些不符合编码规范的警告(coding standards warnings)。
相信大家都会遇到这种情况:Ecshop模板高,而程序版本低,当打开商品详情也的时候就会出乱子,下面简单介绍下我处理这一问题的经验,希望对大家有所帮助
Fatal error: Call to undefined function insert_bought_notes() in。
\web\includes\cls_template.php on line 1140
function insert_mod($name) // 处理动态内容
{
list($fun, $para) = explode('|', $name);
$para = unserialize($para);
$fun = 'insert_' . $fun;
return $fun($para); //就是这一行,在这里调了$fun($para)即是function insert_bought_notes
}
这个可能是你用的新版的模板,程序是旧版的,旧版的程序
includes\lib_insert.php中没有这个函数,可以从最新版中把此函数复制过去就可以了
找了几个版本的在这个文件里也没找到这个function insert_bought_notes()函数,可把我急坏了,我就在/inclues/文件夹下面挨着文件找这个函数,终于功夫不付有心人,在lib_insert下面找到了,但是我包含这个文件时,仍然报错;我只能重建一个文件,单独放这一个函数做包含,这下就可以了,哈哈
新建文件lib_buy.php
<?php
if (!defined('IN_ECS'))
{
die('Hacking attempt');
}
function insert_bought_notes($arr)
{
$need_cache = $GLOBALS['smarty']->caching;
$need_compile = $GLOBALS['smarty']->force_compile;
$GLOBALS['smarty']->caching = false;
$GLOBALS['smarty']->force_compile = true;
$sql = 'SELECT er_name, og.goods_number, oi.add_time,
IF(oi.order_status IN (2, 3, 4), 0, 1) AS order_status ' .
'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON er_id =
er_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .
'WHERE oi.order_id = og.order_id AND ' . time() . ' -
oi.add_time < 2592000 AND og.goods_id = ' . $arr['id'] . ' ORDER BY oi.add_time DESC LIMIT 5';
$bought_notes = $GLOBALS['db']->getAll($sql);
foreach ($bought_notes as $key => $val)
{
$bought_notes[$key]['add_time'] = local_date("Y-m-d G:i:s", $val['add_time']);
}
$sql = 'SELECT count(*) ' .
'FROM ' . $GLOBALS['ecs']->table('order_info') . ' AS oi LEFT JOIN ' . $GLOBALS['ecs']->table('users') . ' AS u ON er_id =
er_id, ' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' .
'WHERE oi.order_id = og.order_id AND ' . time() . ' -
oi.add_time < 2592000 AND og.goods_id = ' . $arr['id'];
$count = $GLOBALS['db']->getOne($sql);
$pager = array();
$pager['page'] = $page = 1;
$pager['size'] = $size = 5;
$pager['record_count'] = $count;
$pager['page_count'] = $page_count = ($count > 0) ?
intval(ceil($count / $size)) : 1;;
$pager['page_first'] = "javascript:gotoBuyPage(1,$arr[id])";
$pager['page_prev'] = $page > 1 ?
"javascript:gotoBuyPage(" .($page-1). ",$arr[id])" : 'javascript:;'; $pager['page_next'] = $page < $page_count ?
'javascript:gotoBuyPage(' .($page + 1) . ",$arr[id])" : 'javascript:;'; $pager['page_last'] = $page < $page_count ?
'javascript:gotoBuyPage(' .$page_count. ",$arr[id])" :
'javascript:;';
$GLOBALS['smarty']->assign('notes', $bought_notes);
$GLOBALS['smarty']->assign('pager', $pager);
$val= $GLOBALS['smarty']->fetch('library/bought_notes.lbi');
$GLOBALS['smarty']->caching = $need_cache;
$GLOBALS['smarty']->force_compile = $need_compile;
return $val;
}
?>
再在文件cls_template.php中,在这个函数里引用上面这个文件
即:function insert_mod($name) // 处理动态内容
{
require_once(ROOT_PATH . 'includes/lib_buy.php');
list($fun, $para) = explode('|', $name);
$para = unserialize($para);
$fun = 'insert_' . $fun;
return $fun($para);
}
这样就不会报错了,希望遇到跟我相同问题的人,能有所帮助,呵呵!。