Ecshop首页主广告修改为:JS 并带有排序功能

  下面讲一下如何把Ecshop网店系统的首页主广告修改为JS并带有排序功能,先来看看效果吧:

修改方法如下:

1、把library/index_ad.lbi 里代码替换成以下代码:

<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<script type="text/javascript" src="http://www.mfwine.cn/themes/Genuine/myFocus/myfocus-2.0.1.min.js"></script>
<script type="text/javascript">
//设置
myFocus.set({
        id:'myFocus',//ID
        pattern:'mF_pconline',//风格
        time:5//切换时间间隔(秒)
});
</script>
<div id="myFocus"><!--焦点图盒子-->
  <div class="loading"><img src="themes/Genuine/myFocus/loading.gif" alt="请稍候..." /></div><!--载入画面(可删除)-->
  <div class="pic"><!--图片列表-->
          <ul>
                <!--{foreach from=$index_adlist item=ads}-->
        <li><a target="_blank" href="{$ads.url}"><img src="{$ads.content}" alt="{$ads.ad_name}" /></a></li><!--{/foreach}-->
          </ul>
  </div>
</div>

2、修改index.php

在“?>”前加上以下代码: 

function get_index_ad(){
    $sql = 'SELECT ad_type,content,ad_name,url,orderid FROM ' . $GLOBALS['ecs']->table("ad_custom") .'ORDER BY orderid ASC'  ;
    $res = $GLOBALS['db']->getAll($sql);
    $ads = array();
                foreach ($res AS $adx => $row)
                {
                        $ads[$adx]['ad_type']           = $row['ad_type'];
                        $ads[$adx]['content']           = $row['content'];
                        $ads[$adx]['url']               = $row['url'];
                        $ads[$adx]['ad_name']           = $row['ad_name'];
                }
                return $ads;
        }

 在下面这段代码

$smarty->assign('shop_notice', $_CFG['shop_notice']); // 商店公告

后加入

$smarty->assign('index_adlist', get_index_ad());

3、在“ecs_ad_custom”表下增加一个字段“orderid”

4、修改admin/flashplay.php

5、修改后台模板 admin/templates 下的三个文件

  • flashplay_custom.htm
  • flashplay_custom_add.htm
  • flashplay_ccustom_edit.htm

第4与5步的修改打包下载地址:http://www.028wz.net/mf.zip

本文摘自:028工作室

转载于:https://www.cnblogs.com/www028wznet/archive/2012/10/09/2717157.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值