| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 3 | <!--- |
|---|
| 4 | Name : slideshow.cfm |
|---|
| 5 | Author : Raymond Camden |
|---|
| 6 | Created : August 18, 2006 |
|---|
| 7 | Last Updated : December 14, 2006 |
|---|
| 8 | History : Added metadata support (rkc 9/5/06) |
|---|
| 9 | : Support for getting slide show dir from CFC (rkc 12/14/06) |
|---|
| 10 | Purpose : Slide Show |
|---|
| 11 | ---> |
|---|
| 12 | |
|---|
| 13 | <cfset slideshowdir = listLast(cgi.path_info, "/")> |
|---|
| 14 | |
|---|
| 15 | <cfif not len(slideshowdir)> |
|---|
| 16 | <cflocation url="#application.rooturl#/index.cfm" addToken="false"> |
|---|
| 17 | </cfif> |
|---|
| 18 | |
|---|
| 19 | <cfset directory = application.slideshow.getSlideShowDir() & "/" & slideshowDir> |
|---|
| 20 | |
|---|
| 21 | <cfif not directoryExists(directory)> |
|---|
| 22 | <cflocation url="#application.rooturl#/index.cfm" addToken="false"> |
|---|
| 23 | </cfif> |
|---|
| 24 | |
|---|
| 25 | <cfset metadata = application.slideshow.getInfo(directory)> |
|---|
| 26 | <cfset images = application.slideshow.getImages(directory)> |
|---|
| 27 | |
|---|
| 28 | <cfif not images.recordCount> |
|---|
| 29 | <cflocation url="#application.rooturl#/index.cfm" addToken="false"> |
|---|
| 30 | </cfif> |
|---|
| 31 | |
|---|
| 32 | <cfparam name="url.slide" default="1"> |
|---|
| 33 | |
|---|
| 34 | <cfif not isNumeric(url.slide) or url.slide lte 0 or url.slide gt images.recordCount or round(url.slide) neq url.slide> |
|---|
| 35 | <cfset url.slide = 1> |
|---|
| 36 | </cfif> |
|---|
| 37 | |
|---|
| 38 | <cfif len(metadata.formalname)> |
|---|
| 39 | <cfset title = "Slideshow - #metadata.formalname#"> |
|---|
| 40 | <cfelse> |
|---|
| 41 | <cfset title = "Slideshow"> |
|---|
| 42 | </cfif> |
|---|
| 43 | |
|---|
| 44 | <cfmodule template="tags/layout.cfm" title="#title#"> |
|---|
| 45 | |
|---|
| 46 | <cfoutput> |
|---|
| 47 | <div class="date"><b>#title# - Picture #url.slide# of #images.recordCount#</b></div> |
|---|
| 48 | <div class="body"> |
|---|
| 49 | <p align="center"> |
|---|
| 50 | <img src="#application.rooturl#/images/slideshows/#application.imageroot#/#slideshowdir#/#images.name[url.slide]#"><br /> |
|---|
| 51 | <cfif structKeyExists(metadata.images, images.name[url.slide])> |
|---|
| 52 | <b>#metadata.images[images.name[url.slide]]#</b><br> |
|---|
| 53 | </cfif> |
|---|
| 54 | <cfif url.slide gt 1> |
|---|
| 55 | <a href="#application.rooturl#/slideshow.cfm/#slideshowdir#?slide=#decrementValue(url.slide)#">Previous</a> |
|---|
| 56 | <cfelse> |
|---|
| 57 | Previous |
|---|
| 58 | </cfif> |
|---|
| 59 | ~ |
|---|
| 60 | <cfif url.slide lt images.recordCount> |
|---|
| 61 | <a href="#application.rooturl#/slideshow.cfm/#slideshowdir#?slide=#incrementValue(url.slide)#">Next</a> |
|---|
| 62 | <cfelse> |
|---|
| 63 | Next |
|---|
| 64 | </cfif> |
|---|
| 65 | |
|---|
| 66 | </p> |
|---|
| 67 | </div> |
|---|
| 68 | </cfoutput> |
|---|
| 69 | |
|---|
| 70 | </cfmodule> |
|---|