PHP photo gallery
PHP photo gallery
Categories:This is a quick and dirty php script that generates a web picture gallery.
There is no need for a database because it recursively scans the directory tree and outputs all the images inside a n html table. It generates a navigation menu to switch between galleries as well.
It's a good solution if you deal with big amounts of pictures because you can just use FTP to upload the pictures and the script generates the thumbnails and galleries automatically.
You could also insert the script in your page through an include php tag and customize the look of it by modifying the css style sheet.
The idea is that you add folders inside gallery/images to create more picture galleries. In this example I created a category called Arts and I placed the City and No-flash galleries inside of it.
This gallery is just a coding exercise to get a whole picture gallery work from one php script and no use of databses. The advantages of this solution are the speed and the simplicity of it. Although the code is not very clean, the gallery work pretty well.
There is a lot of room for improvement, this is just the ferst version of a little project.
The picture on the right is a sample of how the directory structure should look like when you install the PHP gallery:
You are more than welcome to try it, you can download it from the link on the bottom of the page.
Installation:
- Download the compressed package
- Extract it on your public_html folder
- Make the yoursite.com/sample-gallery/cache/images direcotry writable, set its permissions to 777
- Upload your pictures to yoursite.com/sample-gallery/images/your-category/your-gallery
- Never change the names of the folders written here in bold.
System requirements:
- PHP 4.x or newer
| Attachment | Size |
|---|---|
| sample-gallery.rar | 416.3 KB |
- 1266 reads
Post new comment