output, which is a query and turning it into a list? If you leave it as a
qeury then you start with the same sort of data structure as your querysim
code, just with different column names.
BTW, I'd reconsider moving to using directory listings. With querying a
database, you can have a lot more control over what (and how) photos are
displayed. For instance, you could have photos that exist in the
directory, but get marke 'active' and 'inactive' to keep them from being
displayed without physically deleting them. Or you could have photos in a
single directory, but in different categories (or sub-galleries) without
worrying about doing directory & file manipulation to get it all working.
----- Original Message -----
From: "Mark Henderson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, August 25, 2004 7:49 PM
Subject: Photo Album Modification
>I ended up revisiting an old photoalbum I have setup on a few sites (from
>a tutorial several years ago). In it the album uses a query and the
>resulting recordset to do all the work. HOWEVER, I used querysim when
>setting up and testing, and it never got changed. Now, instead of using a
>query I want to go through the directory automatically (using
>cfdirectory) to create a list of images and use this instead of my
>original query (or Querysim in this case).
>
> So far this is what I have.....
>
> *********************
> Original Querysim example
> ============
> <cf_querysim>
> GetRecords
> name
> photo1.jpg
> photo2.jpg
> etc etc
> </cf_querysim>
>
> act_photos.cfm
> ==========
> <!--- Define All Default Values If They Are Not Passed --->
> <cfparam name="page" default="0">
>
> <!--- Define All Initial Parameters --->
> <cfset disp_page = #page# + 1>
> <cfset block_size = 6>
> <cfset block_pages = ceiling(GetRecords.recordcount/block_size)>
> <cfset block_start = (page * block_size) + 1>
> <cfset block_end = (page * block_size) + block_size>
>
> <cfif block_end GT GetRecords.recordcount>
> <cfset block_end = GetRecords.recordcount>
> </cfif>
>
> <!--- Make the array with 6 items --->
> <cfset pic_array = ArrayNew(1)>
>
> <!--- Make Arrays Have value of 0, so we can determine display --->
> <cfloop from="1" to="6" index="i">
> <cfset pic_array[i] = 0>
> </cfloop>
>
> <cfset count = 1>
> <!--- populate the arrays with values --->
> <cfloop query="GetRecords" startrow="#((page*6)+1)#"
> endrow="#((page*6)+6)#">
> <cfset pic_array[count] = '#GetRecords.name#'>
> <cfset count = count + 1>
> </cfloop>
>
> ====================
>
> and here is the start of my directory list
> ======================
>
> <cfset serverdir = "d:\serverpath\images\npc\random\">
> <cfset httpdir = "http://www.urlname.com/images/npc/random">
>
> <!--- retrieve all JPGs --->
> <cfdirectory name="getJPG"
> action=""> > directory="#serverdir#"
> filter="*.jpg" >
>
> <!--- comma delimited list of all the jpg's --->
> <cfparam name="imglist" default="">
>
> <cfloop query="getJPG">
> <cfset GetRecords = listappend(imglist, name, ",")>
> </cfloop>
>
> So here I have my list...now how to use this instead of the querysim for
> output? I get stuck bcos originally I call the image from the query
> using the column title (ie name) but here it's a list so that's not
> possible.
>
> TIA
> Regards
> Mark H
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

