Another Random Image Selector
The first thing we need to do is to define the
save file path and the web path to the "myimages" folder which we will later
query for the files.
<cfset imagepath =
"C:\webroot\myimages">
<cfset imageURL = "http://myserver/myimages">
<!--- first get a list of all jpg's in your image
directory --->
<cfdirectory action="LIST"
directory="#imagepath#"
filter="*.jpg" name="homeimages">
<!--- This variable will hold a comma delimited list of
all the jpg's found in the directory --->
<cfparam name="imglist"
default="">
<cfloop query="homeimages">
<cfset imglist = listappend(imglist, name,
",")>
</cfloop>
<!--- "ThisImage" is this rounds random image file --->
<cfset thisimage = listgetat(imglist, randrange(1,
listlen(imglist)))>
<cfoutput>
<img src="#imageURL#/#ThisImage#">
</cfoutput>
<!--- hope someone can use it and as always... Have
fun! --->
-
A Basic Calendar Application to Build on
I have seen quite a few people looking for prebuilt calendar apps but the people I wrote this for are the people who wanted a headstart in building their OWN custom calendar app.
It is very basic and does nothing more than display the currently selected month/year's calendar and give links to the PREVIOUS the NEXT month's calendars by using The DateAdd() function. Basically the backbone of any calendar app.
Enjoy. and as Always.. HAVE FUN!
Author: Bobby Hartsfield
Views: 24,729
Posted Date: Friday, August 15, 2003
-
Another Random Image Selector
I have seen a couple random image scripts here and there.
Most require you to have a list of the images stored in a database somewhere or actually a switch statement with all the images listed there...
This code will read a directory, pull all jpg's and choose a random one everytime to be displayed.
Alot of my clients have wanted random images. THis is the easiest way I came up with to do it. This way when they want another image in the rotation... all you have to do is upload it to the image directory and its ready to go.
Author: Bobby Hartsfield
Views: 9,392
Posted Date: Tuesday, August 12, 2003
-
Random String/Password Generation
This is a custom tag I wrote that generates a random string at the set number of characters using the characters you decide on
Alpha
AlphaNumeric
or Numeric
Uppercase, lowercase, mixed case...
It will create a variable that you name as you wish and call however you'd like.
It is a small example of how to create a custom tag and will hopefully send someone in the right direction. It is also fully functional and has come in handy quite a few times. Enjoy and as always.. Have Fun!
Author: Bobby Hartsfield
Views: 13,564
Posted Date: Tuesday, August 12, 2003