Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Images using FSO and a Paging structure

Status
Not open for further replies.

cvasquez

MIS
Joined
Feb 28, 2001
Messages
88
Location
US
I have read many help documents in ASP that show a list of images and paging properties using ADO. An example of what I am talking about is this link:

My problem is that I am trying to simulate this exact same paging structure but I am not using a database. The images reside in a folder. I have already create thumbnail images of the large images. Everything is working fine right now because I was able to use FSO to generate the images to display on the browser.

My problem right now resides in the paging structure.
Since I am not using ADO and just using FSO what coding elements do I use? I went into the Microsoft Website and saw that I can use PAGESIZE but this uses ADO. Again, I am not using a database just the images found in a local folder.

Please help me. I know that this could be tricky to work with but hopefully there is someone out there that can help me. Currently I am coding the ASP page in JavaScript but if someone knows this answer in VBScript, I would just have to convert the code to JavaScript.

Thanks everyone;


Carlo
 
Well, as long as the filenames are going to come back in alphabetical order, you could simply keep track of how many images you've displayed so far and pass directions (back, forward) in the querystring along with the number of the last/first picture, ie (pseudocode)_
Code:
If passed direction = "" Then 'this is the first visit
   Display the first x number of pictures
   set your start counter to 1, set your end counter to x
ElseIf passed direction = forward
   get the filenum counter from the querystring
   loop through the files lastfile number of times
   display x number of files
   set your start counter to filenum + 1, set your end counter to filenum + x
Else  'the direction is backward
   get the filenum counter from the querystring
   loop through the files filenum -x times
   display x number of files
   set your start counter to filenum - x, set your end counter to filenum - 1
End If

Display a link for back: "mypage.asp?direction=back&filenum=" & startcounter
Display a link for forward: mypage.asp?direction=forward&filenum=" & endcounter
You could also use a little math to do page numbering. Be sure in your loops to display files that you exit if you run out of files to display, and if you display less than x number of files you don't add the next link because if you have less than x files to display your on the last page.

Hope this helps, thanks for a fun exercise,
-Tarwn
________________________________________________________________________________
Sometimes it is how you ask the question: faq333-2924
Many ASP questions have already been answered, please check faq333-3048 and use the search tool before posting
 
I thought that there was some other way of doing this but your explanation sounds like a great plan to me.

I will let you know how it all worked out.

Gracias for your help.

Carlo.
 
There may be another way to do it, I am by no means the end al lbe all expert of ASP, but I haven't heard of one, and the one above was the best thing that occurred to me. If you decide to look for other methods or if anyone else knows of a method, please post it, I always welcome new knowledge :)

-Tarwn ________________________________________________________________________________
Sometimes it is how you ask the question: faq333-2924
Many ASP questions have already been answered, please check faq333-3048 and use the search tool before posting
 
Awzome!
I am back with news. It WORKS!
Thanks for the logic. It took me sometime to get the logic to work with the code but eventually I won.

I working now in the paging structure,(Google paging structure where it shows the page numbers), and evaluating the images based on dates. But I got it from here.

Thanks for your help and oustanding logic structure!


Carlo.
 
Glad to hear it worked for you, feel free to post back any hints you come up with that might help us out down the road if we attempt to do this on our own :)

-Tarwn ________________________________________________
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top