RE: Random images from directory
Okay, this is I think the strangest CF issue I have ever seen. We have a script which handles all of our form submissions. When a form is submitted the script (which included several files) is called. What is happening is that the cf handles the request, spits out the debugging info and functions correctly. The strange thing is that once the page has finished processing the status bar shows that the web browser is attempting to contact the page again. The status bar grows and grows but can not contact our page on the second request. The Cfserver does not show this new thread (which runs forever, never to complete) as a running request. Where is this request coming from? The request never finishes. This is too strange. I'm stumped. Could our firewall have anything to do with it? MARACASMEDIA INC. Brook Davies President Address Info 421 - 425 Carrall Street Vancouver, BC V6B 6E3 CA ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Random images from directory
The most flexible way is to get a directory listing, then select one of the files randomly. One additional advantage is that you don't have to use a special file naming convention unless you've mixed the photos in the same directory with others that you _don't_ want in the rotation. You also needn't know ahead of time how many files there will be. Jim -Original Message- From: Carlo van Wyk <[EMAIL PROTECTED]> To: CF-Talk <[EMAIL PROTECTED]> Date: Wednesday, July 04, 2001 11:13 AM Subject: Random images from directory >I need to display random images from a directory. (Almost like a Ad >rotator.) There will probably be about 100 .jpeg files in the directory ata >a time, and they will be in the format 1.jpg to 100.jpg > >How can one display the images randomly? > >Regards >Carlo > >Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ >Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Random images from directory
Look into the randomize() and randrange() functions to get the number... As long as the images are in their own directories, you can use the tag to get the file, generate a random number and access the directory list as an array. then again, some hosts disable the CFDirectory. If that's the case, you can still generate the random number and use it in your img tag. The difference between the two? With the option you don't restrict yourself to naming the files 1.jpg through 100.jpg. You can have 100 images in the directory with 100 different names, it just grabs the filename and uses it. HTH Hatton Humphrey -Original Message- From: Carlo van Wyk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 04, 2001 1:13 PM To: CF-Talk Subject: Random images from directory I need to display random images from a directory. (Almost like a Ad rotator.) There will probably be about 100 .jpeg files in the directory ata a time, and they will be in the format 1.jpg to 100.jpg How can one display the images randomly? Regards Carlo Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Re: Random images from directory
HTH, Howie Hamlin - inFusion Project Manager On-Line Data Solutions, Inc. www.CoolFusion.com 631-737-4668 x101 inFusion Mail Server (iMS) - The Intelligent Mail Server Join the DevCon community at www.coolfusion.com/devcon - Original Message - From: "Carlo van Wyk" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Wednesday, July 04, 2001 1:12 PM Subject: Random images from directory > I need to display random images from a directory. (Almost like a Ad > rotator.) There will probably be about 100 .jpeg files in the directory ata > a time, and they will be in the format 1.jpg to 100.jpg > > How can one display the images randomly? > > Regards > Carlo > > Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ > Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists