Duane can you set a client variable that contains a list of already
displayed banners and test against that list so they do not come up as
often?  Of course you might want to make a weighting table for clients that
paid more to come up more often.

And actually your code should be more like
<cfquery datasource="#Attributes.DataSource#" name="q_banners">
SELECT BannerAdID
FROM BannerAds
WHERE Active = 1
</cfquery>
<cfset myrow = RandRange(1,q_banners.RecordCount)>
<cfoutput>
#q_banners.BannerAdID[myrow]#
</cfoutput>

----- Original Message -----
From: "Duane Boudreau" <[EMAIL PROTECTED]>
To: "CFTalk" <[EMAIL PROTECTED]>
Sent: Sunday, July 23, 2000 1:53 PM
Subject: Random Numbers and Banner Managers


> Hi All,
>
> I'm working on a banner manager program and I seem to be having a problem
> getting a true random number. It seems that some of the banners pop up
more
> frequently than others. Here is the code I am using. Is there something
> better I could be using to generate a random number or is this as good as
it
> gets?
>
> <cfquery datasource="#Attributes.DataSource#" name="q_banners">
> SELECT BannerAdID
> FROM BannerAds
> WHERE Active = 1
> </cfquery>
> <cfset variables.bid = ListGetAt(ValueList(q_banners.BannerAdID),
> andRange( 1, ListLen(ValueList(q_banners.BannerAdID))))>
>
> TIA,
> Duane Boudreau
> CFExperts.Com
>
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to