转:flash滚动图片+结合数据库显示函数
(来自:http://www.gois.cn/blog/article.asp?id=96)
客户有需要就写了个函数,可能写得比较一般,欢迎大家使用!请根据自己要求适当修改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 classid=" & ClassId & " order by Id desc"
rs.open sql,conn,1,1
set rss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rss.open sql,conn,1,1
set rsss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rsss.open sql,conn,1,1
'response.write sql
if rs.recordcount = 0 then
response.write"no data"
'response.end
else
%>
<!-- flashpic begin -->
<!--焦点图开始-->
<script type="text/javascript">
<!--
var focus_width=<%=AdWidth%>
var focus_height=<%=AdHeight%>
var text_height=0
var swf_height = focus_height+text_height
var pics='<%do while not rs.eof:response.write rs("pic")&"|":rs.movenext:loop%>http://www.gois.cn/images/logo.gif'
var links='<%do while not rss.eof:response.write rss("url")&"|":rss.movenext:loop%>http://www.gois.cn'
var texts='<%do while not rsss.eof:response.write"|":rsss.movenext:loop%>|'
document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://mat1.qq.com/ent/upday2/playswfnew.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed ID="focus_flash" src="http://mat1.qq.com/ent/upday/playswfnew.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#C5C5C5" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); document.write('</object>');
//-->
</script>
<!--焦点图结束-->
<!-- flashpic end -->
<%
end if
rs.close
rss.close
rsss.close
end function
调用例子:
</textarea></div></div><script language="javascript" type="text/javascript">initUBB("Message")</script></td>
</tr>
<tr>
<td align="right" valign="top"> </td>
<td colspan="2" align="left"><label for="label4">
<label for="label4"><input id="label4" name="log_disImg" type="checkbox" value="1" />
禁止显示图片</label>
<label for="label5">
<input name="log_DisSM" type="checkbox" id="label5" value="1" />
禁止表情转换</label>
<label for="label6">
<input name="log_DisURL" type="checkbox" id="label6" value="1" />
禁止自动转换链接</label>
<label for="label7">
<input name="log_DisKey" type="checkbox" id="label7" value="1" />
禁止自动转换关键字</label></td>
</tr>
<tr>
<td align="right" valign="top"><span style="font-weight: bold">内容摘要:</span></td>
<td colspan="2" align="left"><div><label for="shC"><input id="shC" name="log_IntroC" type="checkbox" value="1" onclick="document.getElementById('Div_Intro').style.display=(this.checked)?'block':'none'" />编辑内容摘要</label></div>
<div id="Div_Intro" style="display:none">
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;">客户有需要就写了个函数,可能写得比较一般,欢迎大家使用!请根据自己要求适当修改sql语句
'=============================
'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 classid=" & ClassId & " order by Id desc"
rs.open sql,conn,1,1
set rss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rss.open sql,conn,1,1
set rsss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rsss.open sql,conn,1,1
response.write sql
if rs.recordcount = 0 then
response.write"no data"
'response.end
else
%>
<!-- flashpic begin -->
<!--焦点图开始-->
<script type="text/javascript">
<!--
var focus_width=<%=AdWidth%>
var focus_height=<%=AdHeight%>
var text_height=0
var swf_height = focus_height+text_height
var pics='<%do while not rs.eof:response.write rs("pic")&"|":rs.movenext:loop%>http://www.gois.cn/images/logo.gif'
var links='<%do while not rss.eof:response.write rss("url")&"|":rss.movenext:loop%>http://www.gois.cn'
var texts='<%do while not rsss.eof:response.write"|":rsss.movenext:loop%>|'
&...
</textarea>
</div>
</td>
</tr>
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
<tr>
<td align="right" valign="top"><span style="font-weight: bold">引用通告:</span></td>
<td colspan="2" align="left"><input name="log_Quote" type="text" size="80" class="inputBox" /><br>请输入网络日志项的引用通告URL。可以用逗号分隔多个引用通告地址. </td>
</tr>
<tr>
<td colspan="3" align="center">
<input name="SaveArticle" type="submit" class="userbutton" value="保存日志" accesskey="S"/>
<input name="DelArticle" type="button" class="userbutton" value="删除该日志" accesskey="K" onclick="if (window.confirm('是否要删除该日志')) {document.getElementById('action').value='del';document.forms['frm'].submit()}"/>
<input name="CancelEdit" type="button" class="userbutton" value="取消编辑" accesskey="Q" onClick="location='default.asp?id=95'"/>
</td>
</tr>
</table>
</div>
</div>
</form>
<br/></div>
</div>
<!--底部-->
<div id="foot">
<p>Powered By <a href="http://www.pjhome.net" target="_blank"><strong>PJBlog2 v2.6 build 02</strong></a> CopyRight 2005, <strong>SOSOS's Blog...</strong> <a href="http://validator.w3.org/check/referer" target="_blank">xhtml</a> | <a href="http://jigsaw.w3.org/css-validator/validator-uri.html">css</a></p>
<p style="font-size:11px;">Processed in <b>0.054688</b> second(s) , <b>2</b> queries , <a href="http://www.pjhome.net" target="_blank"><strong>Nuvola Style For PJBlog2</strong></a> Design By <a href="mailto:puterjam@gmail.com" target="_blank"><strong>PuterJam</strong></a>
<br/><a href="http://www.miibeian.gov.cn" style="font-size:12px"><b>粤ICP备06022113号</b></a>
</p>
</div>
</div>
<script type="text/javascript">initAccessKey() //转换AccessKey For IE</script>
</body>
</html>
客户有需要就写了个函数,可能写得比较一般,欢迎大家使用!请根据自己要求适当修改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 classid=" & ClassId & " order by Id desc"
rs.open sql,conn,1,1
set rss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rss.open sql,conn,1,1
set rsss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rsss.open sql,conn,1,1
'response.write sql
if rs.recordcount = 0 then
response.write"no data"
'response.end
else
%>
<!-- flashpic begin -->
<!--焦点图开始-->
<script type="text/javascript">
<!--
var focus_width=<%=AdWidth%>
var focus_height=<%=AdHeight%>
var text_height=0
var swf_height = focus_height+text_height
var pics='<%do while not rs.eof:response.write rs("pic")&"|":rs.movenext:loop%>http://www.gois.cn/images/logo.gif'
var links='<%do while not rss.eof:response.write rss("url")&"|":rss.movenext:loop%>http://www.gois.cn'
var texts='<%do while not rsss.eof:response.write"|":rsss.movenext:loop%>|'
document.write('<object ID="focus_flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="http://mat1.qq.com/ent/upday2/playswfnew.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFFFF">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed ID="focus_flash" src="http://mat1.qq.com/ent/upday/playswfnew.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#C5C5C5" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'); 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 id="label4" name="log_disImg" type="checkbox" value="1" />
禁止显示图片</label>
<label for="label5">
<input name="log_DisSM" type="checkbox" id="label5" value="1" />
禁止表情转换</label>
<label for="label6">
<input name="log_DisURL" type="checkbox" id="label6" value="1" />
禁止自动转换链接</label>
<label for="label7">
<input name="log_DisKey" type="checkbox" id="label7" value="1" />
禁止自动转换关键字</label></td>
</tr>
<tr>
<td align="right" valign="top"><span style="font-weight: bold">内容摘要:</span></td>
<td colspan="2" align="left"><div><label for="shC"><input id="shC" name="log_IntroC" type="checkbox" value="1" onclick="document.getElementById('Div_Intro').style.display=(this.checked)?'block':'none'" />编辑内容摘要</label></div>
<div id="Div_Intro" style="display:none">
<textarea name="log_Intro" class="editTextarea" style="width:99%;height:120px;">客户有需要就写了个函数,可能写得比较一般,欢迎大家使用!请根据自己要求适当修改sql语句
程序代码
'=============================
'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 classid=" & ClassId & " order by Id desc"
rs.open sql,conn,1,1
set rss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rss.open sql,conn,1,1
set rsss=server.createobject("adodb.recordset")
sql="select * from shop_ad where s_page=" & ShowPage & " and classdeep=" & ClassDeep & " and classid=" & ClassId & " order by Id desc"
rsss.open sql,conn,1,1
response.write sql
if rs.recordcount = 0 then
response.write"no data"
'response.end
else
%>
<!-- flashpic begin -->
<!--焦点图开始-->
<script type="text/javascript">
<!--
var focus_width=<%=AdWidth%>
var focus_height=<%=AdHeight%>
var text_height=0
var swf_height = focus_height+text_height
var pics='<%do while not rs.eof:response.write rs("pic")&"|":rs.movenext:loop%>http://www.gois.cn/images/logo.gif'
var links='<%do while not rss.eof:response.write rss("url")&"|":rss.movenext:loop%>http://www.gois.cn'
var texts='<%do while not rsss.eof:response.write"|":rsss.movenext:loop%>|'
&...
</div>
</td>
</tr>
<tr>
<td align="right" valign="top" nowrap><span style="font-weight: bold">附件上传:</span></td>
<td colspan="2" align="left"><iframe src="attachment.asp" width="100%" height="24" frameborder="0" scrolling="no" border="0" frameborder="0"></iframe></td>
</tr>
<tr>
<td align="right" valign="top"><span style="font-weight: bold">引用通告:</span></td>
<td colspan="2" align="left"><input name="log_Quote" type="text" size="80" class="inputBox" /><br>请输入网络日志项的引用通告URL。可以用逗号分隔多个引用通告地址. </td>
</tr>
<tr>
<td colspan="3" align="center">
<input name="SaveArticle" type="submit" class="userbutton" value="保存日志" accesskey="S"/>
<input name="DelArticle" type="button" class="userbutton" value="删除该日志" accesskey="K" onclick="if (window.confirm('是否要删除该日志')) {document.getElementById('action').value='del';document.forms['frm'].submit()}"/>
<input name="CancelEdit" type="button" class="userbutton" value="取消编辑" accesskey="Q" onClick="location='default.asp?id=95'"/>
</td>
</tr>
</table>
</div>
</div>
</form>
<br/></div>
</div>
<!--底部-->
<div id="foot">
<p>Powered By <a href="http://www.pjhome.net" target="_blank"><strong>PJBlog2 v2.6 build 02</strong></a> CopyRight 2005, <strong>SOSOS's Blog...</strong> <a href="http://validator.w3.org/check/referer" target="_blank">xhtml</a> | <a href="http://jigsaw.w3.org/css-validator/validator-uri.html">css</a></p>
<p style="font-size:11px;">Processed in <b>0.054688</b> second(s) , <b>2</b> queries , <a href="http://www.pjhome.net" target="_blank"><strong>Nuvola Style For PJBlog2</strong></a> Design By <a href="mailto:puterjam@gmail.com" target="_blank"><strong>PuterJam</strong></a>
<br/><a href="http://www.miibeian.gov.cn" style="font-size:12px"><b>粤ICP备06022113号</b></a>
</p>
</div>
</div>
<script type="text/javascript">initAccessKey() //转换AccessKey For IE</script>
</body>
</html>
posted on 2007-04-23 01:10 sharewind 阅读(1065) 评论(0) 编辑 收藏 举报