AutoCAD 3DMAX C语言 Pro/E UG JAVA编程 PHP编程 Maya动画 Matlab应用 Android
Photoshop Word Excel flash VB编程 VC编程 Coreldraw SolidWorks A Designer Unity3D
 首页 > PHP编程

将ECMALL店铺banner换成flash动画的方法

51自学网 2016-09-26 http://www.51zixue.net
原文地址:http://www.tuogan.com/info/read-htm-tid-339.html
1、修改/themes/store/default/top.html,用以下代码来覆盖第一个if语句。
<!--{if $store.store_banner}-->
    <object type="application/x-shockwave-flash" width="1000" height="150">
    <param name="movie" value="{$store.store_banner}" />
    <param name="menu" value="false">
</object>
<!--{else}-->
    <img src="{res file=images/banner.jpg}"  />
<!--{/if}-->
注释:<object type="application/x-shockwave-flash" width="1000" height="150">
此处高度和宽度表示banner的高度和宽度,可自由设置
2、修改/app/my_store.app.php。将带有标记部分的代码插入实例代码中
   $data = array_merge($data, array(
       'store_name' => $_POST['store_name'],
       'store_banner'  => $_POST['store_banner'],
       'region_id'  => $_POST['region_id'],
       'region_name'=> $_POST['region_name'],
       'description'=> $_POST['description'],
       'address'    => $_POST['address'],
       'tel'        => $_POST['tel'],
       'im_qq'      => $_POST['im_qq'],
       'im_ww'      => $_POST['im_ww'],
       'domain'     => $subdomain,
            ));
3、打开/themes/mall/default/my_store.index.html
将以下判断代码删除,大概在47行
   store_banner : {
      accept   : 'png|jpe?g|gif'
        },
4、继续在文件/themes/mall/default/my_store.index.html
将130-139行左右
<div class="photo relative2">
    <p><img src="<!--{ if $store.store_banner neq ''}-->{$store.store_banner}<!--{else}-->{res file=images/member/banner.gif}<!--{/if}-->" width="607" height="120" ectype="store_banner" /></p>
    <b>
    <span class="file1"><input type="file" size="1" maxlength="0" hidefocus="true" ectype="change_store_banner"/></span>
    <span class="file2" style="_right: -22px;"><input type="file" size="1" maxlength="0" hidefocus="true" ectype="change_store_banner"/></span>
    <div class="txt">{$lang.change_store_banner}</div>
    </b>
    <span class="explain">{$lang.change_store_banner_des}</span>
</div>
修正为:
<div class="photo relative2">
    <p><object type="application/x-shockwave-flash" width="607" height="120" >
    <param name="movie" value="<!--{ if $store.store_banner neq ''}-->{$store.store_banner}<!--{else}-->{res file=images/member/banner.gif}<!--{/if}-->" />
    <param name="menu" value="false">
    </object></p>
    请填写图片或者flash地址:<input type="text" class="text" size="65" name="store_banner" value="{$store.store_banner|escape}"/>
    <span class="explain">{$lang.change_store_banner_des}</span>
</div>
5、修改店铺对应的css文件shop.css
一下代码用于表示在店铺页面中banner的显示大小与定位,再为修该之前,banner会被导航栏遮盖,修改之后可以解决该问题。
大家根据自己的情况灵活调整。

#nav { width: 1000px; height: 183px; margin: 0 auto 10px; position: relative; }
#nav .banner { width: 1000px; height: 150px; position: absolute; top: 0; left: 0; z-index: 1; }
该功能成功显示店铺图片banner和flash banner,但美中不足的是不能上传图片或者flash,需要先上传后再填入文件的URL,从用户层面来讲很不方便,但对站长却还不错。
如果谁有更好的办法可以实现,请无私分享。
转载请注明:http://blog.sina.com.cn/s/blog_672e827e0100hy3z.html 『阿楠技术博客』


说明
:本教程来源互联网或网友上传或出版商,仅为学习研究或媒体推广,51zixue.net不保证资料的完整性。
 
上一篇:ecmall发布商品价格、库存不能为空  下一篇:ecmall 结构图-基类函数