2

I have various projects going on that I need to document and then display pictorial progress on. It is set up as project\year\month\pic.jpg... I was planning on having in the root of the section a index.php that would list the directorys and create a link that when clicked would pass the project\ directory to a listing.php page. With the listing php it would read the contents of project\ the files in that directory would make the initial page content. The listing.php would then read the \project\year\month\ directorys in order. at the bottom of the listing.php page would be an href=year\month. if one of the links to the year-month is clicked it would open another page that would view the pictures in abc-123 order. it would have a dropdown for selecting other year/month's and a next/previous button.

I get the readdir / scandir part and can list a single dir eaisly enough. I have no idea how to make the callback work for that or if/how to make dynamic global arrays to store the info in. memory comsumption isnt to troubling for me as the directorys are 2-3 deep only a couple projects have 40k or so images. the average looks to be 3k or less photos

If php is a bad way of doing this then what would be a good way so that the listing.php type page is always current and the display pages so I dont have to worry about having it updated via script every so often.

Kendrick
  • 173
  • 1
  • 9

1 Answers1

0

You'll want to use iterators, probably - see this question and it's answer: PHP recursive directory path

Community
  • 1
  • 1
ETWW-Dave
  • 732
  • 5
  • 8
  • I ended up using iterators, the php recursive was a good base for the answer. I cant remember where I found the code but it had a section for allow extensions ignore files/dirs etc. I can send a copy if some one wants it. Its a nicely commented function that is pretty explanitory. – Kendrick Jul 20 '12 at 02:42