• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Rotating advertising images

New Here ,
Apr 20, 2011 Apr 20, 2011

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

269

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 20, 2011 Apr 20, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 20, 2011 Apr 20, 2011

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation