I want to make an album that may have like 100 photos but only 5 are ever on the screen at once.
Something like a view box in the middle. Below that 5 thumbnails. Then a rewind and forward button on either side of the thumbnails to let the user move one photo forward or backward in the group. By clicking on a thumbnail it shows the photo in the box above (view).
My problem is I have been playing around with it and have found it isn't working.
PHP only works on page encoding so nothing is "live". I don't want to reload the page every time a user moves forward or back.
I can't use javascript since it cant read files and I was using files that contained the name of the thumbnail (full path), the path to the full photo and a caption text for each photo.
Any ideas?
I was wanting to make it small enough to fit on my front page.
Mike
Making a PHP Photo Album?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
I've also wondered about this before.
Pagination would be quite easy if you grabbed all the files, put them in a MySQL DB and then pulled them out as needed, but how can you paginate through files if you are just pulling them from a directory?
The only way I can think of is to loop through all the files every time and count as you go past each file and then eg. if you were on page one just do while counter <= 5, on page 2 do while counter > 5 and <= 10, surely that isn't the only way to do it though?
Pagination would be quite easy if you grabbed all the files, put them in a MySQL DB and then pulled them out as needed, but how can you paginate through files if you are just pulling them from a directory?
The only way I can think of is to loop through all the files every time and count as you go past each file and then eg. if you were on page one just do while counter <= 5, on page 2 do while counter > 5 and <= 10, surely that isn't the only way to do it though?
The problem with that is that thr page has to be reloaded with every grab of a group of 5 photos. I am trying to prevent a reload. I have settled on allowing it for every album.
I did a test and found as long as the variable is not created and a "new Image()" it will not cache. Just using a normal variable to hold the string (which is the path to the photos) just acts like a string and only when placed as the image's src triggers the downloading.
Mike
I did a test and found as long as the variable is not created and a "new Image()" it will not cache. Just using a normal variable to hold the string (which is the path to the photos) just acts like a string and only when placed as the image's src triggers the downloading.
Mike
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England