I downloaded Andrew Grossman's webbanner.r from the rebol.com script 
library and I'm having some difficulty.

The script is executed using an <!--#exec cgi="/cgi-bin/webbanner.cgi"-
-> statement in an .html file which has been included as a server-side 
include. I figure webbanner.cgi MUST be executing OK, because it does 
return the following HTML...


<a href="none"><IMG SRC="none" ALT="none" target="_blank"></a>

But as you can see, the url, img, and alt word values have no value at 
all. Where am I going wrong?

I don't pretend to know exactly how the script works, but I was hoping 
to modify it accordingly and use it, anyway. Besides changing the url, 
img, and alt word values in the block, I made the following changes to 
the code...

Original (with three urls in the block)

        adnumber - 1 * 3
        random (length? banner-db) / 3
        make-banner/ad 3]

My changes (with six urls in the block)

        adnumber - 1 * 6
        random (length? banner-db) / 6
        make-banner/ad 6]

I simply assumed the instances of "3" all had to be changed to "6"

Can someone look over the following script (short) and help me out? I 
really appreciate any help. Thanks.

Ryan Christiansen
Editor/Webmaster



#!rebol -cs

print "Content-Type: text/html^/"

REBOL [
    Title:  "Web Banner"
    File:   %webbanner.r
    Date:   20-Jul-1999
    Author: "Andrew Grossman"
    Purpose: {
        Generate HTML code that displays a banner and links to its
        destination.
    }  
    Usage: { 
        make-banner or make-banner/ad with an ad number to show a
        specific ad.
    }
]

random/seed now

banner-db: [
        http://www.schonder.com  %/graphics/bannerads/schonder.gif
                "Papier-Schonder KG office supply and bookstore"
        http://www.schonder.com  %/graphics/bannerads/schnondersource.gif
                "Papier-Schonder KG office supply and bookstore"
        http://www.abisoft.com/BePlan/PurchaseBOSJ.html  %/graphics/
bannerads/BePlan.gif
                "BePlan from AbiSoft"
        http://www.lebuzz.com/buzzcd_ad.html  %/graphics/bannerads/
buzzcd_anim.gif
                "BuzzCD - Hand-picked best BeOS software"
        http://www.pushove.com/beos/  %/graphics/bannerads/nvf.gif
                "NVF: A Be-centric comic strip"
        http://www.bebits.com/app/867  %/graphics/bannerads/ImageProAd.gif
        "ImagePro displays, zooms, and re-sizes images"
]

make-banner: func [/ad adnumber /local url img alt] [
    set [url img alt] skip banner-db either ad [ 
        adnumber - 1 * 6
    ][
        random (length? banner-db) / 6
    ]   
    rejoin [{<a href="} url {"><IMG SRC="} img {" ALT="} alt {" target=
"_blank"></a>}]
]

examples: [
    print [make-banner newline
           make-banner/ad 6]
]
do examples

Reply via email to