支持权重的无组件ASP广告显示代码
程序员文章站
2023-11-21 17:00:10
网站同一显示很多广告?需要不同权重?简单的20行代码。 复制代码 代码如下:dim cc_fv_ad_468_80_code,c...
网站同一显示很多广告?需要不同权重?简单的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)
复制代码 代码如下:
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)
上一篇: 凯立德的T系列与C系列的区别及版本号说明
下一篇: 手机 分组数据连接不存在