转: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


调用例子:
程序代码 程序代码
ShowAd 0,1,2,768,80
</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" οnclick="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" οnclick="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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值