支援權重的無組件ASP廣告顯示代碼

來源:互聯網
上載者:User

網站同一顯示很多廣告?需要不同權重?簡單的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)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.