954,593 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Image Slideshow

Does anyone know of a good slideshow component or snippet for cf? basically i would just like to rotate a few thumbnail size images in a featured area of my website. thanks.

kory27
Newbie Poster
11 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

Download the gallery_viewer.zip, unzip, and put the gallery_viewer.cfm file into any folder with .jpg images. Upload the file and browse to the page to view your slideshow gallery.

http://www.webhostingelite.com/downloads/gallery_viewer/proxy_gallery_viewer.cfm?file=#UrlEncodedFormat(

<!---gallery Viewer 2.1.1 Source Code--->

<!--- param the image to show --->
<cfparam name="url.image" default="1">

<!--- directory --->
<cfset dir = expandPath(".")>

<!--- get all images --->
<cfdirectory directory="#dir#" filter="*.jpg" name="images" sort="name">

<!--- quick sanity checks --->
<cfif not isNumeric(url.image) or url.image lte 0 or url.image gt images.recordcount or round(url.image) neq url.image>
<cfset url.image = 1>
</cfif>

<html>
<head>
<title>
<!---JSD - dynamically retrieve the image name into the page title, SEO --->
<cfoutput>#images.name[url.image]#</cfoutput>
</title>
</head>
<body>

<!--- do we even have images? --->
<cfif images.recordCount>
<cfoutput>
<table align="center">
<tr><!---JSD - dynamically retrieve the image name into the page text, SEO --->
<td colspan="2"><cfoutput>#images.name[url.image]#</cfoutput></td>
</tr>
<tr>
<td><cfif url.image gt 1>
<!--- JSD - Set the Delimeter path to "\/" for windows and linux--->
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image-1#">Previous</a>
<cfelse>
Previous
</cfif></td>
<td><cfif url.image lt images.recordCount>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image+1#">Next</a>
<cfelse>
Next
</cfif></td>
</tr>
<tr>
<td colspan="2"><img src="#images.name[url.image]#"></td>
</tr>
<!--- links --->
<tr>
<td>
<cfif url.image gt 1>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image-1#">Previous</a>
<cfelse>
Previous
</cfif> </td>
<td align="right">
<cfif url.image lt images.recordCount>
<a href="#listLast(getCurrentTemplatePath(),"\/")#?image=#url.image+1#">Next</a>
<cfelse>
Next
</cfif> </td>
</tr>
</table>
</cfoutput>
</cfif>

</body>
</html>
techniner
Posting Pro
527 posts since May 2005
Reputation Points: 12
Solved Threads: 19
 

thanks. i will try that. an add on question before i explore this; i am going to use this to show like 5 different movie posters, 5 different music posters, etc for about 7 subjects or so to show a featured type gallery. would i put the 5 thumbs in an indiv folder for each subject then put the .cfm file in the each folder and then reference from there?

thanks again.

kory27
Newbie Poster
11 posts since Feb 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You