No-component ASP advertisement display code supporting weight

Source: Internet
Author: User

How many advertisements are displayed on the same website? Need different weights? Simple 20 lines of code.

Copy codeThe Code is as follows: Dim cc_fv_ad_468_80_code, cc_fv_ad_power, cc_fv_ad_ I
'Ad weight show Bright Moon starlight Copyright http://www.5iya.com/blog original
Cc_fv_ad_power = Array (,) 'sets the weight of each advertisement.
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
End If
Next
'Ad code
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.