ecshop Call to undefined function insert_ads()解决方法

ECSHOP教程 来源: ecshop插件网www.ecshop520.com 时间:2020-04-23 ECSHOP教程分类:其他ECSHOP教程

ECShop Fatal error: Call to undefined function insert_ads() in includes/cls_template.php on line 1157 报错解决方法



删除这句话即可

还有一种解决方法:新建立一个PHP文件,命名为:ecshop119.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 =
ler_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/ecshop119.php');

list($fun, $para) = explode('|', $name);

$para = unserialize($para);

$fun = 'insert_' . $fun;

return $fun($para);

}

这样就不会报错了,希望遇到跟我相同问题的人,能有所帮助,呵呵!




转载请注明:ecshop插件网-ecshop插件网官网http://www.ecshop520.com/jiaocheng-1030.html

ECSHOP
ecshop下载 ecshop安装教程 ecshop在线演示 ecshop后台测试
ECSHOP二次开发手册
ecshop教程 ecshop二次开发 ecshop模板教程 ecshop微信配置
ECSHOP商城网站建设
ecshop空间域名 ecshop商城建设 ecshop模板修改 ecshop开发定制
ECSHOP插件网
ecshop开发团队 ecshop开发中心 ecshop模板制作 ecshop插件网简介
联系我们 ECShop插件下载
ECShop二次开发
ecshop搭建

ICP备案证书号:闽ICP备19017195号-2

qq code back_top
温馨提示

确定取消
温馨提示

关闭