支持权重的无组件ASP广告显示代码

所属分类: 网络编程 / ASP编程 阅读数: 1116
收藏 0 赞 0 分享
网站同一显示很多广告?需要不同权重?简单的20行代码。 


  
复制代码 代码如下:

Dim cc_fv_ad_468_80_code,cc_fv_ad_power,cc_fv_ad_i 
  '广告权重显示 明月星光 Copyright http://www.5iya.com/blog 原创 
  cc_fv_ad_power = Array(1,3,2,4) '设置每个广告权重 
  Redim cc_fv_ad_ubound(Ubound(cc_fv_ad_power)) 
  cc_fv_ad_ubound(0) = cc_fv_ad_power(0) 
  For cc_fv_ad_i = 1 To Ubound(cc_fv_ad_power) 
    cc_fv_ad_ubound(cc_fv_ad_i) = cc_fv_ad_ubound(cc_fv_ad_i-1)+cc_fv_ad_power(cc_fv_ad_i) 
  Next 
  Randomize 
  Dim cc_fv_ad_j,cc_fv_ad_random,cc_fv_ad_number 
  cc_fv_ad_number = 1 
  cc_fv_ad_random = Int(Rnd*cc_fv_ad_ubound(Ubound(cc_fv_ad_power)))+1 
  For cc_fv_ad_j = 0 To Ubound(cc_fv_ad_power) 
    If cc_fv_ad_random <= cc_fv_ad_ubound(cc_fv_ad_j) Then 
      cc_fv_ad_number = cc_fv_ad_j 
      Exit For 
    End If 
  Next 
  '广告代码 
  cc_fv_ad_468_80_code = Array("<iframe width=""468"" height=""60"" align=""center"" marginwidht=""0"" name=""union163com"" marginheight=""0"" hspace=""0"" vspace=""0"" frameborder=""0"" scrolling=""no"" src=""http://news2.163.com/product/photo/tpl1.jsp?ID=yibaoxiang&NO=21688&productid=0422""></iframe>","<script type=""text/javascript"" src=""http://www.joyo.com/lianmeng/ad.asp?s=cg5iyacom&k=1""></script>","http://www.5iya.com/blog","<script language=""JavaScript1.1"" src=""http://smarttrade.allyes.com/main/adfshow?user=1|8033|103810&db=smarttrade&border=0&local=yes&js=ie""></script>") 
  Response.Write cc_fv_ad_468_80_code(cc_fv_ad_number) 
更多精彩内容其他人还在看

TsysV1.1 系统文件清单介绍

TsysV1.1 系统文件清单介绍
收藏 0 赞 0 分享

好久没发布新玩意,完成了tsys的少年不在版

好久没发布新玩意,完成了tsys的少年不在版
收藏 0 赞 0 分享

tsys _rss程序

tsys _rss程序
收藏 0 赞 0 分享

TSYS 新闻列表JS调用下载

TSYS 新闻列表JS调用下载
收藏 0 赞 0 分享

使用asp代码突破图片的防盗连

使用asp代码突破图片的防盗连
收藏 0 赞 0 分享

一种理论上最快的Web数据库分页方法

一种理论上最快的Web数据库分页方法
收藏 0 赞 0 分享

asp:debug类调试程序

asp:debug类调试程序
收藏 0 赞 0 分享

如何增加Referer功能--反向链接插件

如何增加Referer功能--反向链接插件
收藏 0 赞 0 分享

pjblog中清空引用的小程序

pjblog中清空引用的小程序
收藏 0 赞 0 分享

光碟工具 Alcohol 120% v1.9.6.4719 下载(附序列号注册码)

光碟工具 Alcohol 120% v1.9.6.4719 下载(附序列号注册码)
收藏 0 赞 0 分享
查看更多