Installation Instructions for the Photo Gallery Software
Components
This photo gallery system uses SLIR (Smart Lencioni Image Resizer, by Joe Lencioni) to compress and resize images on-the-fly (and cache them, too). It uses the exif_read_data() PHP function to pull lat/long coordinates out of images, and then uses the Google Maps Javascript API v3.0 to display a map with pushpins for where the images were taken.
A Quick Overview
Read this part first: it'll give you a good overall picture of how all the bits go together. And when you're trying to figure out how to tweak something, it'll help you figure out where to look.
- in your root folder of your site, you'll end up with 3 web pages, and 4 subfolders:
- managegalleries.php (the main admin page)
- showgalleries.php (lists all galleries, or all galleries whose gallery name contains a specified string)
- ShowGallery.php (public view of 1 gallery, or 1 photo within a gallery)
- inc folder (style sheet, plus footer and header includes to make the photo galleries look like the rest of your site)
- slir folder (Smart Lencioni Image Resizer...this is the toughest part to configure, as all sorts of nutty permissions and document root settings can mess it up)
- vipg folder (a bunch of PHP includes that make the 3 main PHP pages all work)
- VIPGalleries folder (where the gallery images get stored)
- the .htaccess settings in the root folder are critical, both for SLIR to work and for URL rewriting for SEO
- there are 2 MySQL database tables, one for the gallery names, and the other contains the mapping from images to captions
- meta descriptions, page titles, Open Graph markup, rel=canonical, etc. is all done for you in a parameterized way--you'll want to go through the header & footer includes and the 3 main PHP files carefully to set up your templates correctly there
- the globals file in the vipg folder is where you can configure your thumbnail image dimensions, your full-size image dimensions, database login info, etc.
Installation Steps
Let's call this step 0: it's the most important. BACK UP YOUR EXISTING SITE. Some .htaccess changes are needed to get this all to work, and as we all (probably) know from painful experience, .htaccess is a grenade, just sitting there waiting for one errant statement to blow up your entire site.
- unzip the file I've sent you that has the code into your root folder
- edit the header and footer inc files until managegalleries.php looks like the rest of your site
- in MySQL:
- create new database "vipg" (shared server: might be named something like [hostusername]_vipg)
- create new user for that database "vipgusr" (shared server: might be named something like [hostusername]_vipgusr)
- add user vipgusr to the new database vipg, with all privileges
- create tables "gallery" and "photo" using the scripts from the vipg/database folder (probably will need to remove 'vipg'. in scripts)
- in globals.php:
- update the login and password for the admin of the galleries (this is what you log in with on managegalleries.php)
- update the database connection settings
- check gallery width setting
- if you get "cannot create symlink" error from SLIR, look at this: http://code.google.com/p/smart-lencioni-image-resizer/issues/detail?id=41
- note that the .htaccess file in the root folder MUST contain index.php as one of the default documents
- make sure your RewriteRule in .htaccess is working
- when you're testing/debugging the SLIR installation, start with trying to just show one of your thumbnails on a new page by itself
- SLIR should be writing an error log if it has troubles...look there
- SLIR configuration settings that you might need to mess with are in /slir/slirconfigdefaults.class.php ($documentRoot is one I often need to override)