标签:
一共4个文件:
列表显示文件:site/links/img0.html
添加图片文件:site/links/img0_add.html
添加保存图片文件:site/links/img0_add_up1.chtml
删除图片文件:site/links/img0_del.chtml
在轻开电子商务系统(企业入门级B2C网站)的site/links/目录下
轻松实现图片替换
1、列表显示文件代码介绍
查询最新的主题图片
[html] view plaincopyprint?
<esql module=base id=links>Select we_id,img_url,link,name From images_base where catalog=0 order by created desc limit 10esql>
循环显示主题图片列表
[html] view plaincopyprint?
<for objects=links end="@{links:getLength}">
<tr align=center><td><img src="@{sys:path}@{links:IMG_URL}" width="@{double:730/3}" height="@{double:486/3}" border=1 style="cursor:pointer" onclick="window.open(‘@{sys:path}@{links:IMG_URL}‘,‘‘,‘width=730,height=486‘)" alt="全图">td><td align=left><a href="@{links:LINK}" target=_blank title="@{links:LINK}">@{links:NAME}a>td><td><if x="@{sys:canDo}"><a href="javascript:doDel(‘@{links:WE_ID}‘);" x=true>[删除]a>if>td>tr>
for>
列表效果
点开单张效果
权限判断
[html] view plaincopyprint?
<chtml><Bag id=sys><we name=NodeID>a0.0we>Bag>chtml>
<chtml file="base/ac/checkAcl.htm"/>
...
<if x="@{sys:canDo}"><a href="javascript:doDel(‘@{links:WE_ID}‘);" x=true>[删除]a>if>
....
<center><if x="@{sys:canDo}"><a href="@{sys:face}site/links/img0_add.html" x=true>[添加]a>if>center>
删除提示js函数
[javascript] view plaincopyprint?
function doDel(rid)
{
if(!confirm(‘真的要删除吗?‘)){return;}
var str = ‘@{sys:face}site/links/img0_del.chtml?reUrl=site/links/img0.html&WE_ID=‘ rid;
location.href= str;
}
全部代码
[html] view plaincopyprint?
<link href="@{sys:path}site/links/a.css" rel="stylesheet" type="text/css" />
<chtml><Bag id=sys><we name=NodeID>a0.0we>Bag>chtml>
<chtml file="base/ac/checkAcl.htm"/>
<chtml>
<table width=90% align=center border=1 cellpadding="3" cellspacing="0" style="border-collapse:collapse;font-size:12px">
<tr><th colspan=3>.<font class=listTitle>主题图片font>.th>tr>
<tr align=center bgcolor=#ECECEC>
<th>图片th><th>名称和链接th><th width=40>操作th>tr>
<esql module=base id=links>Select we_id,img_url,link,name From images_base where catalog=0 order by created desc limit 10esql>
<for objects=links end="@{links:getLength}">
<tr align=center><td><img src="@{sys:path}@{links:IMG_URL}" width="@{double:730/3}" height="@{double:486/3}" border=1 style="cursor:pointer" onclick="window.open(‘@{sys:path}@{links:IMG_URL}‘,‘‘,‘width=730,height=486‘)" alt="全图">td><td align=left><a href="@{links:LINK}" target=_blank title="@{links:LINK}">@{links:NAME}a>td><td><if x="@{sys:canDo}"><a href="javascript:doDel(‘@{links:WE_ID}‘);" x=true>[删除]a>if>td>tr>
for>
table><br>
<center><if x="@{sys:canDo}"><a href="@{sys:face}site/links/img0_add.html" x=true>[添加]a>if>center>
chtml>
<script>
function doDel(rid)
{
if(!confirm(‘真的要删除吗?‘)){return;}
var str = ‘@{sys:face}site/links/img0_del.chtml?reUrl=site/links/img0.html&WE_ID=‘ rid;
location.href= str;
}
script>
(文件:site/links/img0.html)在轻开电子商务系统(企业入门级B2C网站)的site/links/目录下
轻松互联网开发平台(Easy Do IT)资源下载
开发实例:轻开企业入门级B2C电子商务网站,免费下载:http://download.csdn.net/detail/tx18/8818883轻开平台会不定期升级为大家提供更多强大而Easy的功能,请留意下载最新的版本
【小萌库】相关精品书籍推荐
互联网赚钱的核心秘密.pdf
互联网创业成功之道.pdf
【转帖来自于】 http://coding.hongjuzi.net/share?id=900
【转帖来自于】http://blog.csdn.net/tx18/article/details/46571799
换主页轮播的主题图片(1)---轻开电子商务系统(企业入门级B2C网站)
标签:
原文地址:http://www.cnblogs.com/luodao1991/p/4593553.html