支持權(quán)重的無組件ASP廣告顯示代碼
更新時間:2007年03月29日 00:00:00 作者:
網(wǎng)站同一顯示很多廣告?需要不同權(quán)重?簡單的20行代碼。
Dim cc_fv_ad_468_80_code,cc_fv_ad_power,cc_fv_ad_i
'廣告權(quán)重顯示 明月星光 Copyright http://www.5iya.com/blog 原創(chuàng)
cc_fv_ad_power = Array(1,3,2,4) '設(shè)置每個廣告權(quán)重
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)
復(fù)制代碼 代碼如下:
Dim cc_fv_ad_468_80_code,cc_fv_ad_power,cc_fv_ad_i
'廣告權(quán)重顯示 明月星光 Copyright http://www.5iya.com/blog 原創(chuàng)
cc_fv_ad_power = Array(1,3,2,4) '設(shè)置每個廣告權(quán)重
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)
相關(guān)文章
推薦4款傻瓜型的ASP服務(wù)器軟件(asp運行環(huán)境一鍵搭建工具)
雖然現(xiàn)在各種語言大行其道,但是asp的成熟性以及易用性還是有很大的客戶量存在,要運行ASP程序,必須安裝調(diào)試ASP的環(huán)境,而IIS對于普通用戶來說,安裝起來還是有一定的難度的,這里我來推薦幾款傻瓜型的ASP服務(wù)器軟件,比較適合初級站長。2014-08-08
ASP+MSSQL2000 數(shù)據(jù)庫被批量注入后的解決方法
這陣子,采用ASP+MSSQL設(shè)計的很多網(wǎng)站可能遭遇到sql數(shù)據(jù)庫被掛馬者插入JS木馬的經(jīng)歷;這不,朋友的一個網(wǎng)站就被黑客忽悠了一把2009-02-02
asp有效防止網(wǎng)站留言板出現(xiàn)垃圾留言/評論實現(xiàn)思路
如何有效防止網(wǎng)站(留言板)出現(xiàn)垃圾留言,垃圾評論?本文提供詳細解決思路與實現(xiàn)步驟,需要了解的朋友可以參考下2012-12-12
asp下實現(xiàn)截取字符串特定部分內(nèi)容函數(shù)
asp下實現(xiàn)截取字符串特定部分內(nèi)容函數(shù)...2007-08-08
asp下通過HTTP_USER_AGENT判斷用戶是從手機上訪問,還是電腦IE上訪問
最近wap網(wǎng)站比較流行,我們需要判斷下客戶使用手機訪問的還是電腦ie訪問的, 好給出不同尺寸的頁面,更符合用戶瀏覽習(xí)慣,下面是核心判斷代碼,需要的朋友可以參考下。2011-01-01

