0% found this document useful (0 votes)
211 views

PHP Thumbnail Image Gallery..

This document provides instructions for using a PHP script that creates thumbnail images and displays them in a gallery from full-sized images uploaded to an FTP server. It describes configuring options like thumbnail size and quality, file permissions needed, and how to modify the CSS for different layouts. Optional lightbox functionality is also explained.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
211 views

PHP Thumbnail Image Gallery..

This document provides instructions for using a PHP script that creates thumbnail images and displays them in a gallery from full-sized images uploaded to an FTP server. It describes configuring options like thumbnail size and quality, file permissions needed, and how to modify the CSS for different layouts. Optional lightbox functionality is also explained.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PHP Thumbnail Image Gallery Script | ricocheting.

com

http://www.ricocheting.com/code/php/thumbnail-image-gallery

Home

Javascripts

PHP Scripts

Apache on Windows

Login

PHP Scripts
PHP MySQL Wrapper PHP MySQL Wrapper v3 Simple Login PHP Image Gallery

PHP Thumbnail Image Gallery Script


Description
This is an image gallery script that allows you to simply upload new full sized images in FTP and the script will automatically create the thumbnails for those images and add those images to a paged thumbnail gallery suitable for browsing.

Example
Sample photo gallery using this script.

Download
gallery.zip

Terms of Use
Version 1.2.0 and onward is released under GNU General Public License. Basically this means you are free to use the script, modify it, and even redistribute versions of your own under the same license.

What's new
1.2.1 [January 13, 2008] - Code went through another cleanup and comment updates. Goal is to make it so anyone can easily modify it themselves. 1.2.0 [December 26, 2007] 1. Stripped out broken Imagemagick support. 2. Cleaned up the code. 3. Better commented everything. 4. Redid the gallery layout to use CSS the user can easily change. 5. Changed the License to GNU General Public License. 1.1.0 [June 2, 2006] - Started cleaning up the code. This version was never publicly released 1.01 [May 11, 2004] - Initial release

Instructions
gallery.php settings
Open gallery.php and scroll down to about line 30 and look for $config['size'] . Set this to the maximum width or height you want your image thumbnail to be. On the next line in the $config['imagequality'] set this to the JPEG quality you would like your thumbnails to be. I recommend you

1 of 2

11/2/2010 4:16 PM

PHP Thumbnail Image Gallery Script | ricocheting.com

http://www.ricocheting.com/code/php/thumbnail-image-gallery

keep it set to 70 $config['rows'] and $config['cols'] are the number of rows and number of columns of thumbnail images you want shown on each page $config['maxShow'] is the number of page numbers to show at one time. for instance if you have 100 pages of images, you can set this to only show the page numbers of the 10 pages close to where you currently are $config['fulls'] is the relative path to the full size images located on your server. Include the trailing slash. example: $config['fulls'] = "photos/"; $config['thumbs'] is the relative path to where you want the thumbnail images to be stored. Include the trailing slash.

Scripts & design created 2000-2010 ricocheting.com :: Use Policy

File Permissions
You'll need to change the permission on the directory you set $config['thumbs'] to. CHMOD it to 775 or 777 so PHP and GD2 can automatically write and create your thumbnails in that directory.

Changing the Look


The entire gallery table is controlled by the CSS settings you'll find toward the bottom of the gallery.php file. I tried to comment each specific part of the CSS and what it controls so you can easily change the look of the gallery without actually having to actually edit any of the PHP.

Lightbox
Lightbox Support (OPTIONAL)
I've had multiple people want to know how to make this gallery work with the Lighbox script or telling me that they modified it (which is great!) themselves. While the above gallery script does not come with Lightbox support, modifing it to work with Lightbox requires very minor changes. In gallery.php edit line 116 to add rel="lightbox" so it becomes echo '<a href="'. $config['fulls'].$imagelist[$i] .'" title="'. $imagelist[$i] .'" rel="lightbox" target="_blank">'; Go down to about line 353 and include lightbox.js and its CSS in the page header (it's normal HTML down there).

Add new comment

PHP

2 of 2

11/2/2010 4:16 PM

You might also like