Have just spent this morning updating bits and pieces of this site.
I have also been working on adding "Previous" and "Next" buttons to all my photo galleries. (
Photo Gallery). This was a relatively easy task. I already had a function which put all the files from a directory into an array. Then using
array_search() in PHP, and the image name from the URL, I was able to work out what number in the array the displayed file was. From there it was easy as the next file in the array is the current file +1, and the previous file in the array is current file-1. The tricky bit was getting it not to display the previous file if there is no previous file, and similarly with display the next file...
Other than that, it works a treat and I will be implementing it into all sites which require a photo gallery in the future.
'Till next time...
Labels: update