Results 1 to 2 of 2

Thread: Banner Add Rotation Program Help

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63

    Banner Add Rotation Program Help

    I have some code that allows me to display a banner but I need to display multiple banners on the same page instead of just one and have them randomly rotate on page refresh only.

    Code Sample
    =======================================
    <%@ Language=VBScript %>

    <%
    set conn = server.createobject ("adodb.connection")
    conn.open "ADROTATE"
    set RSTopNumber = conn.Execute("select Max(BannerAdID) as MaxID from GTBannerAds")
    Randomize
    RecordNumber = Int(RSTopNumber("MaxID") * Rnd + 1)
    set RSImage = conn.Execute("select * from GTBannerAds " _
    & "where BannerAdID = " & RecordNumber)
    conn.Execute "insert into GTBannerAdImps (BannerAdID, WhenHit) values (" _& RecordNumber & ", '" & Now & "')"
    %>
    =======================================


    Here is the kind of code I would like to have in the body of the page
    =======================================
    <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 align="center">
    <TR VALIGN="top" ALIGN="left"><%DO UNTIL RSImage.EOF%>
    <TD colspan="2" ALIGN="left" VALIGN="top"><A HREF="./router.asp?BannerADID=<% Response.Write RSImage("BannerAdID") %>"><IMG HEIGHT=69 WIDTH=439 SRC="<% Response.Write RSImage("Path2Image") %>" BORDER=0 ALT="<% Response.Write RSImage("ALTText") %>" ></A></TD>
    </TR>
    <%
    RSImage.movenext
    loop
    %>
    </TABLE>
    =======================================

    The next question is how can I limit the number of banners being displayed on the page for example if I had a database of 26 banners
    I would like to have say 6 per page and then if the page is refreshed a different 6 display.

    All help is appreciated

    Kind Regards,
    Hakan

  2. #2

    Thread Starter
    Member
    Join Date
    Jan 2000
    Posts
    63
    Does anyone have any ideas?

    Thank You
    Hakan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width