Hello-
I am developing a banner rotating tool and need some ideas on how to best
handle a requirement. I have gotten the tool to a point where it displays
banners randomly- no problem. Now what I need to do is give certain banners
more "weight" than others: some banners need to be displayed more
frequently than the rest. The code that I have below gives equal weight to
each banner; I need to find a way to give some banners more prevalence on
our pages.
<cfset activeBanners=arrayNew(1)>
<cfoutput query="qryActive">
<cfset activeBanners[#qryActive.currentRow#] = "#id#">
</cfoutput>
<cfset rows = arrayLen(activeBanners)>
<cfset randomId = randRange(1,#arrayLen(activeBanners)#)>
<cfquery datasource="#dsn#" name="qryBanners">
SELECT
i.*,
a.advert_name
FROM
images i, advertiser a
WHERE
i.id = #activeBanners[randomId]# and
i.advert_id = a.advert_id
</cfquery>
Any ideas?
Thanks in advance,
Elizabeth
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists