Photo Gallery
Photo Gallery is a dynamic PHP photo gallery.
Features
- Generates an index page of thumbnail images
- Provides navigational links when viewing images to the previous image, the next image, and the thumbnail index
- Allows you to specify the order in which the images are displayed
- Allows you to specify an optional caption for each image
- Allows you to specify an optional link to a parent gallery page, which would contain links to all of the individual galleries
Examples
http://www.swc-shotokan.org/kyutest_2007_12.php
Usage
Photos
First, dump all of the photos you want to appear in the gallery into a single directory. Each photo must have a thumbnail image associated with it, and that thumbnail must contain the same name as the original, with “-thumb.jpg” tacked onto the end. So, a photo named “family.jpg” would have a thumbnail named “family.jpg-thumb.jpg”.
photos.txt
In the directory containing the images, create a new file named “photos.txt”. This file specifies the order of the photos in the gallery, as well as any captions you have for each file. On each line in this file, first list the name of the full sized photo, then a comma, then an optional caption.
An example photos.txt file:
IMGA1864.JPG,Warm up practice before kyu test
IMGA1865.JPG,Oi-zuki
IMGA1867.JPG,Heian Nidan
IMGA1876.JPG,Kumite
IMG_1092.JPG,Signing in for the test
IMGA1879.JPG,Khion
IMGA1885.JPG
IMGA1898.JPG
IMGA1904a.jpg
IMGA1928.JPG
IMGA1952.JPG
IMGA1973a.jpg,Kata
The index page
Now that the photos are setup, and the photos.txt file has been created, it’s time to create a PHP page to generate the gallery. We do this with a call to generate_gallery. generate_gallery takes 3 parameters. First is the location of the directory containing the photos, thumbnails, and photos.txt file. Second is the name of this PHP page. Third is an optional parameter which specifies a master photo gallery index page, which would contain links to each of your individual photo gallery pages (like this one).
<?php
include_once('gallery.php');
generate_gallery("./photos/kyutest_2007_12",
"kyutest_2007_12.php",
"photo_galleries.php");
?>
Download
GitHub
Most Popular Posts
Tags
Archives
- December 2011 (1)
- September 2011 (1)
- July 2011 (1)
- May 2011 (1)
- April 2011 (1)
- March 2011 (1)
- January 2011 (2)
- November 2010 (2)
- September 2010 (1)
- August 2010 (1)
- July 2010 (2)
- June 2010 (2)
- April 2010 (1)
- March 2010 (1)
- February 2010 (2)
- January 2010 (1)
- December 2009 (1)
- November 2009 (1)
- September 2009 (2)
- August 2009 (3)
- July 2009 (2)
- June 2009 (3)
- April 2009 (1)
- February 2009 (1)
- January 2009 (2)
- December 2008 (8)
- November 2008 (2)
- October 2008 (3)
- September 2008 (6)
- July 2008 (3)
- June 2008 (1)
- May 2008 (8)
- April 2008 (6)
- March 2008 (2)
Blogroll
Industury News
Other Links
My GitHub Feed
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby
- jwood pushed to stripe at signal/proby




