SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Bgcolor

  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bgcolor

    How do you get the background color to be added to the <TD>also. This is my code below.


    Asp page: banner.asp



    DIM strBanners
    Set strBanners = Server.CreateObject(MSWC.AdRotator)

    <Table width=800 height=100 border=0 cellpadding=0 cellspacing=0>
    <tr>
    <td width=100% height=100 border=0 valign=top bgcolor=<sbgcolor>>

    Response.Write (strBanners.GetAdvertisement("adrotator.txt"))



    </td>

    Adrotater TXt

    REDIRECT /index.asp
    WIDTH 500
    HEIGHT 100
    BORDER 0
    *
    images/100.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65
    images/200.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65
    images/300.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65

    </tr>
    </table>

  2. #2
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Is sbgcolor an ASP variable with the bgcolor you want? If so then:

    Code:
    <%
    DIM strBanners
    Set strBanners = Server.CreateObject(MSWC.AdRotator) 
    %>
    <Table width=800 height=100 border=0 cellpadding=0 cellspacing=0>
    <tr>
    <td width=100% height=100 border=0 valign=top bgcolor="<%=sbgcolor%>">
    <%
    Response.Write (strBanners.GetAdvertisement("adrotator.txt"))
    %>
    </td>

  3. #3
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    vi
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I got that, but how do I color the bgcolor from the adtrotater txt file

    Is this correct:

    REDIRECT /index.asp
    WIDTH 500
    HEIGHT 100
    BORDER 0
    *
    000000
    images/100.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65

    images/200.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65

    images/300.jpg
    http://www.blackhearentertainement.com
    Visit Advertiser1 now!
    65

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the classic situation of why I don't read from text files, I prefere to read from ini files,

    Which allows me to do the following:

    [00001]
    "ad_Image"="images/ad1.jpg"
    "url"="http://www.ad1.com"
    "Text"="Visit Ad 1"
    "width"="480"
    "height"="64"
    "back_color"="#000000"
    "border"="0"

    etc.

    Then I use a script to read those values, and display them as required. Also I am able to write to this file which also means its always updatable.

    Gavin


Bookmarks

Posting Permissions

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