支持權(quán)重的無組件ASP廣告顯示代碼
更新時(shí)間:2007年03月29日 00:00:00 作者:
網(wǎng)站同一顯示很多廣告?需要不同權(quán)重?簡(jiǎ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è)置每個(gè)廣告權(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è)置每個(gè)廣告權(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)文章
ASP 日期的加減運(yùn)算實(shí)現(xiàn)代碼
今天在工作中遇到了一個(gè)問題,需要按時(shí)間查詢,可是查詢出來的結(jié)果顯示的不正確。2009-12-12推薦4款傻瓜型的ASP服務(wù)器軟件(asp運(yùn)行環(huán)境一鍵搭建工具)
雖然現(xiàn)在各種語言大行其道,但是asp的成熟性以及易用性還是有很大的客戶量存在,要運(yùn)行ASP程序,必須安裝調(diào)試ASP的環(huán)境,而IIS對(duì)于普通用戶來說,安裝起來還是有一定的難度的,這里我來推薦幾款傻瓜型的ASP服務(wù)器軟件,比較適合初級(jí)站長(zhǎng)。2014-08-08ASP+MSSQL2000 數(shù)據(jù)庫被批量注入后的解決方法
這陣子,采用ASP+MSSQL設(shè)計(jì)的很多網(wǎng)站可能遭遇到sql數(shù)據(jù)庫被掛馬者插入JS木馬的經(jīng)歷;這不,朋友的一個(gè)網(wǎng)站就被黑客忽悠了一把2009-02-02asp有效防止網(wǎng)站留言板出現(xiàn)垃圾留言/評(píng)論實(shí)現(xiàn)思路
如何有效防止網(wǎng)站(留言板)出現(xiàn)垃圾留言,垃圾評(píng)論?本文提供詳細(xì)解決思路與實(shí)現(xiàn)步驟,需要了解的朋友可以參考下2012-12-12asp下實(shí)現(xiàn)截取字符串特定部分內(nèi)容函數(shù)
asp下實(shí)現(xiàn)截取字符串特定部分內(nèi)容函數(shù)...2007-08-08ASP上傳漏洞之利用CHR(0)繞過擴(kuò)展名檢測(cè)腳本
本文部分腳本具有攻擊性,僅供學(xué)習(xí)研究用,請(qǐng)用在合法合理范圍內(nèi),對(duì)造成的損失本人不承擔(dān)責(zé)任,本人也不提供黑客攻擊技術(shù)指導(dǎo)2012-01-01asp下通過HTTP_USER_AGENT判斷用戶是從手機(jī)上訪問,還是電腦IE上訪問
最近wap網(wǎng)站比較流行,我們需要判斷下客戶使用手機(jī)訪問的還是電腦ie訪問的, 好給出不同尺寸的頁面,更符合用戶瀏覽習(xí)慣,下面是核心判斷代碼,需要的朋友可以參考下。2011-01-01