Limiting the display of an image to certain times of the day with CF?

2009-06-16 Thread Ian Vaughan
Hi In Coldfusion can you restrict the display of a certain image for only certain times of the day? For example only display the image before 8pm 12pm-2pm and after 5pm on the site homepage If so any ideas on the best way to achieve this? TIA

Re: Limiting the display of an image to certain times of the day with CF?

2009-06-16 Thread Rob Parkhill
Wrap it up in a CFIF or CFCASE statement. cfset currentHour = timeformat(now(),'hh') cfif currentHour gte '08' and currentHour lt '12' cfset imagetoDisplay = 'morning.png' cfelseif currentHour gte 12 and currentHour lt 5 cfset imagetoDisplay = 'afternoon.png' cfelse cfset

Re: Limiting the display of an image to certain times of the day with CF?

2009-06-16 Thread Claude Schneegans
If so any ideas on the best way to achieve this? Simply use CFIF tag and now() function. You'll be able to generate or not any code whenever you need. ~| Want to reach the ColdFusion community with something they want? Let

re: Limiting the display of an image to certain times of the day with CF?

2009-06-16 Thread Jason Fisher
!--- get the time in whole number, 24-hour (military time) --- cfset timeTest = val(timeFormat(now(), HHmm)) / !--- run the tests --- cfif (timeTest lt 800) or (timeTest gte 1200 and timeTest lt 1400) or (timeTest gt 1700) img src=imageToShow.jpg / /cfif

RE: Limiting the display of an image to certain times of the day with CF?

2009-06-16 Thread Ian Vaughan
Thanks all for the prompt responses. Both solutions work great! Thanks again -Original Message- From: Jason Fisher [mailto:ja...@wanax.com] Sent: 16 June 2009 14:24 To: cf-talk Subject: re: Limiting the display of an image to certain times of the day with CF? !--- get the time in