Requirements
- PHP version 5.2+
- The GD library plugin for PHP (this is installed on many servers by default)
- MySQL Database
Steps for a Fresh Installation
- Download and extract ThePhig to your local machine
- Edit config.php, filling out the information for your database (username, password, hostname, and database name)
- Upload the gallery files to your webserver
- Upload your albums to the gallery_images directory. Each album should be it's own directory (ie gallery_images/album1/image1.jpg, etc)
- Change the permissions of the uploaded album folders to 777 or read/write/execute
- Point your browser to the install.php file (ie http://www.website.com/gallery/install.php)
- Fill out all the details required, hit submit, and delete the install.php file
- You can now administrate your gallery by going to the admin.php page. From the admin page, you can add albums to the database, create the thumbnails, etc
- Visit index.php to view your new gallery
Steps for Upgrading to the Latest Version
- Backup your database and files as a precaution
- Download and extract ThePhig to your local machine
- Replace all files (or those listed in changelog) except for inc/config.php
- Run any upgrade scripts included. These upgrade scripts are important for updating the database.
- Delete install.php and upgrade-* scripts
Integrating Into A Pre-Existing Webpage
If you'd like to integrate ThePhig into a pre-existing site, you'll only need to create your own theme. In the templates/ directory, each directory is a separate theme.
Template Files
- albumEntry.php => Template for each individual album on the main page
- footer.php => Footer for the gallery
- header.php => Header for the gallery
- htmlHead.php => Additional scripts, css, etc in the head of the html
- imageEntry => Template for each individual image and exif info
- search.php => The search bar to tags. Can be used in other template pages
- singleImage.php => Template for specific image view (ex index.php?imageID=300)
- style.css => The CSS related to this specific theme
Available Template Variables
- $apiKey => Google's API Key for Google Maps
- $copyrightLink
- $copyrightOwner
- $elementsPerPage => The number of images or albums displayed on current page
- $galleryPath
- $galleryTitle
- $imageName
- $imagesPath
- $jsOverlay
- $tags => Tag that user searched for
- $theme
- $thumbnailName
- $version => thePhig version
- $albumDate
- $albumDesc => The album description provided in that admin panel for the album
- $albumFolder
- $albumIcon
- $albumID
- $albumLink => The link to the album (ie index.php?albumID=1)
- $albumName
- $albumProtected => If 1, then the album is protected and only specific users may view album
- $imageLink => Full path to the resized image (the image that the template links to)
- $originalImage => Full path to the original image
- $resizedImage => Full path to the resized image
- $thumbnailImage => Full path to the resized Image
- $imageInfo['albumID']
- $imageInfo['albumFolder']
- $imageInfo['albumName']
- $imageInfo['camera']
- $imageInfo['fstop']
- $imageInfo['geoCoords']
- $imageInfo['id'] => Image ID
- $imageInfo['imageDate']
- $imageInfo['imageName']
- $imageInfo['imageTitle']
- $imageInfo['iso']
- $imageInfo['orientation']
- $imageInfo['tags']
- $imageInfo['thumbnailName']
If you have any questions, make sure to check the FAQ, the forums, or submit questions to support@thephig.com