OK, I have a question: If "1005(next)" is deleted, why: 1) Is it still in the file system, or 2) Not flagged as deleted in the database?
Use SQL on each page hit, but do a UNION join. The example below is from a database called "quotations", and gives list of current (7) id, previous and next: SELECT quotation_id FROM quotation WHERE quotation_id = 7 AND date_deleted IS NULL UNION SELECT top 1 quotation_id FROM quotation WHERE quotation_id > 7 AND date_deleted IS NULL UNION SELECT MAX(quotation_id) as quotation_id FROM quotation where quotation_id < 7 AND date_deleted IS NULL ORDER BY quotation_id RESULTS: quotation_id ------------ 4 7 8 That make sense?? >Yes, they are coming out of the database and the filename is their ID number >... > >Can't hardcode, what if you are on 1003 and 1005(next) is deleted? > >So by using the CFDirectory method, is it possible to know what place a >particular file is in (without counting) and then reference the item before >and after? > >If so, what would the syntax be on this? > >The users will come into the page and view a database driven page that wll >display short descriptions and thumbnails. > >They click on the thumbnail and it takes them to a page /reports/10032.cfm > >From their I would like them to navigate without going back and forth >throughout the whole site. > >Thanks >Paul Giesenhagen >QuillDesign > >----- Original Message ----- >From: "Mosh Teitelbaum" <[EMAIL PROTECTED]> >To: "CF-Talk" <[EMAIL PROTECTED]> >Sent: Monday, September 22, 2003 3:19 PM >Subject: RE: Previous/Next with Files > > >> >> Paul: >> >> It might help to take a step back and determine how people will come to >this >> page in the first place. perhaps you can use the same mechanism that >> provides the link to this page to determine the previous/next pages. >> >> Do these files have entries in a database? You could then use some sort >of >> query to determine previous/next (although this may be more intensive than >> using CFDIRECTORY). >> >> Do you ever add new files? If not, consider hard coding the references to >> previous/next files. >> >> Are the files/pages heavily traversed? If so, it may make sense to cache >> the whole directory listing in the APPLICATION scope and read from the >cache >> to dynamically create the previous/next links at each page request. >> >> HTH >> >> -- >> Mosh Teitelbaum >> evoch, LLC >> Tel: (301) 942-5378 >> Fax: (301) 933-3651 >> Email: [EMAIL PROTECTED] >> WWW: http://www.evoch.com/ >> >> >> > -----Original Message----- >> > From: Paul Giesenhagen [mailto:[EMAIL PROTECTED] >> > Sent: Monday, September 22, 2003 4:02 PM >> > To: CF-Talk >> > Subject: Previous/Next with Files >> > >> > >> > I have a directory that can have a small amount or possibly a >> > large amount of files (3,000) files. >> > >> > Here would be an excerpt of the directory: >> > >> > 10330.cfm >> > 10331.cfm >> > 10336.cfm >> > 10440.cfm >> > 10441.cfm >> > 10442.cfm >> > 10445.cfm etc.. >> > >> > If someone is looking at 10440.cfm, I would like to have two >> > links a link to 10336.cfm (previous) and a link to 10441.cfm (next). >> > >> > I could do a CFdirectory and populate a list with all the file >> > names and then look to the before and after the selected file for >> > the next/previous, but that seems alittle intensive. >> > >> > Does anyone have any suggestions on the most efficient way to get >> > next/previous files? >> > >> > Any help would be appreciated! >> > >> > Paul Giesenhagen >> > QuillDesign >> > >> > >> > >> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm?link=i:4:138008 Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm

