SitePoint has a new article today for anyone out there that's found the need to have a section of their site displaying a "picture showcase" of sorts - David Pankhurst has rolled his own.
I recently decided to create a showcase for one of my sites. I needed a row of five thumbnail images of my products, randomly displayed. I thought it would be easy to find this PHP code, but this turned out not to be the case, so I rolled up my sleeves and wrote my own. The result is a new way (at least, to me) of rotating images - I hope you'll find it as useful as I did.
The problem was that I didn't really want a random display. I wanted random, but without duplicates. I had about 25 images, so the chance of repeat images in a row of five was pretty good -- and would be pretty unprofessional!
The script he comes up with is a pretty simple one, really - but sometimes those are the best, eh? With a simple array of the images, selecting a set of images from it is an easy task...




