客户有需要就写了个函数,可能写得比较一般,欢迎大家使用!请根据自己要求适当修改sql语句
解释一下函数:因为需要在多个地方显示.所以,我自定义了
showpage:0代表首页,1代表其他位置.
classdeep:有8个级别,1代表大类,2代表二类,以此类推
classid:类所在表的ID
'=============================
'ShowPage 显示的页面
'ClassDeep 分类深度
'ClassId 分类ID
'AdWidth 广告宽度
'AdHeight 广告高度
'本程序由SOSOS's BLOG原创 http://www.gois.cn/blog
'=============================.
function ShowAd(ShowPage,ClassDeep,ClassId,AdWidth,AdHeight)
set rs=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and class />'); document.write('</object>');
//-->
</script>
<!--焦点图结束-->
<!-- flashpic end -->
<%
end if
rs.close
rss.close
rsss.close
end function
调用例子:
ShowAd 0,1,2,768,80
</tr>
<tr>
<td align="right" valign="top"> </td>
<td colspan="2" align="left"><label for="label4">
<label for="label4"><input >
'=============================
'ShowPage 显示的页面
'ClassDeep 分类深度
'ClassId 分类ID
'AdWidth 广告宽度
'AdHeight 广告高度
'=============================.
function ShowAd(ShowPage,ClassDeep,ClassId,AdWidth,AdHeight)
set rs=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and class:rsss.movenext:loop%>|'
&...