Skip to main content
April 20, 2011
Question

Rotating advertising images

  • April 20, 2011
  • 1 reply
  • 302 views

I have 24 ad sponsor images. I want 6 to appear on a page at any one time in a vettical column one under the other. One each page refresh/mouse click I want to rotate through all 24 images so that - over time - each one is diplayed the same number of times, and each one appears in each of the 6 positions.

I can sort of do that using:

<cfparam name="SponsorSwap" default="#randrange(1,24)#">

then:

<cfif SponsorSwap is "1"> image1, image2, image3, image4, image5, image6</cfif>

<cfif SponsorSwap is "2">image2, image3, image4, image5, image6, image1<cfif>

and so on...

But that is a lot of code.

Is there a better way to do this?

Thank you

This topic has been closed for replies.

1 reply

Inspiring
April 21, 2011

Store the last displayed timestamp.  Then get the 6 that have waited the longest.

April 21, 2011

Thanks - I'm pretty lame when it comes to code - so i have no idea what you just said - but it was new info so i will employ TheGoogle. thank you for taking the time to respond. i will report back on TheGoogle's success.