The same site shows a lot of ads? Need different weights? Simple 20 lines of code.
Copy Code code as follows:
Dim Cc_fv_ad_468_80_code,cc_fv_ad_power,cc_fv_ad_i
' Advertising weights show the Moon Starlight Copyright http://www.5iya.com/blog Original
Cc_fv_ad_power = Array (1,3,2,4) ' Set each ad weight
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
' Ad code
Cc_fv_ad_468_80_code = Array ("<iframe width=" "468" "height=" "" "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)