您现在的位置是:首页 > 教程 > ecshop商城教程ecshop商城教程
ecshop出现Call to undefined function insert_ads()的解决方法
痴梦2024-01-20 23:13:40ecshop商城教程已有人查阅
导读ECShop Fatal error: Call to undefined function insert_ads() in includes/cls_template.php on line 1157 报错解决方法
ECShop Fatal error: Call to undefined function insert_ads() in includes/cls_template.php on line 1157 报错解决方法
删除这句话即可
还有一种解决方法:新建立一个PHP文件,命名为:ecshop119.php 文件内容为:
删除这句话即可
还有一种解决方法:新建立一个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实现后台文章信息可以修改添加时间的方法。有时我们希望将过去发布的新闻改成今天发布的,或者是今天发布的文章,希望改成是过去发布的,ECSHOP教 -
ecshop用户名,手机号,email同步登陆的实现方法
该ECSHOP插件仅适用于没有做过任何平台整合的ECSHOP网站;includes/modules/integrates/ecshop.php -
ecshop商品页实现每个商品一个连接的方法
添加新商品 ------其它信息----商家备注:在输入框里输入你的淘宝代码就OK了 -
ecshop支付方式修改支付宝付款按钮样式外观换成图片方法
ECSHOP默认的支付宝支付按钮丑爆了,通过本教程可以美化一下默认支付宝支付按钮的样式是这样的:下面我们来修改一下1.在includes/modules/
留言与评论 (共有 条评论) |