相思资源网 Design By www.200059.com
网站同一显示很多广告?需要不同权重?简单的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="/UploadFiles/2021-04-02/"> 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="/UploadFiles/2021-04-02/"> Response.Write cc_fv_ad_468_80_code(cc_fv_ad_number)
相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com
暂无支持权重的无组件ASP广告显示代码的评论...