CAPTIVATE 1.0 - released August 2004 ---------------------------------------------------------------------------------- Copyright 2004 by Julie Thompson http://scripts.deadly-nightshade.net/ Usage ---------------------------------------------------------------------------------- Captivate 1.0 is free for non-commercial use and may be modified for personal use. Contact me for permission before using this script for commercial purposes. Please do not distribute modified copies of this script without my permission. You may not sell this script or modified versions of it under any circumstances. Description ---------------------------------------------------------------------------------- Captivate 1.0 is a simple PHP image gallery. It is designed with screencaps in mind, so it is most suitable for large galleries of images of the same size, requiring no individual image descriptions. It's very easy to use - just upload your screencaps to an images folder, edit a few settings in the config file, run the thumbnail creation script, and your gallery will be automatically generated. Thumbnail creation is optional. If you have already made thumbs or your server can't create them (GD 2 is required), just upload them to the thumbnails folder instead of running the creation script and your gallery is ready. Read the instructions below for more info. Requirements ---------------------------------------------------------------------------------- PHP 4 or higher GD 2 with JPEG support (only for thumbnail creation) These are fairly common features so if you pay for webhosting you will most likely be able to use this script. Scroll down to "Support" to learn how to check for PHP and GD. Contents ---------------------------------------------------------------------------------- You should have these six files: readme.txt (this file) gallery.php config.php create.php sample.php header.jpg Instructions ---------------------------------------------------------------------------------- STEP 1) Open config.php in notepad or an HTML editor and change the labelled variables to your liking. Note: Don't edit the file in a WYSIWYG editor like Frontpage, as it might alter the code! STEP 2) Upload all files (gallery.php, config.php, create.php, and sample.php) to your site and in THE SAME directory, create two folders: one called "images" and one called "thumbs". Notes: You can safely rename gallery.php and the "images" and "thumbs" folders, but you must change the corresponding variables in config.php! IF YOU AREN'T USING THUMBNAIL CREATION, you don't have to upload create.php or sample.php - just upload your thumbnails to the "thumbs" folder and skip to step 5! STEP 3) CHMOD the "thumbs" folder to 755. Note: In WS_FTP LE, highlight the folder, right-click on it, and choose chmod(unix). Check read, write, and execute under owner, read and execute under group, and read and execute under other. Click OK and you're done. If you don't use WS_FTP LE, your FTP client should have a chmod option, so check the help file if you aren't sure. You may also be able to CHMOD files using your web hosting control panel. STEP 4) Go to create.php in your browser! If the thumbnail preview looks good to you, click "create thumbnails" and you will be shown a progress screen. When your thumbnail creation is complete, you'll be given a link to the gallery, which will be ready to go. Note: There is a short processing time before the progress screen appears, do don't worry if it takes a minute. Thumbnail creation speed will vary, depending on your server and your connection. The script is designed to prevent server timeout. STEP 5) Go to your gallery! It's ready to use. Tweak the gallery display settings in config.php if necessary. Config Details ---------------------------------------------------------------------------------- If you aren't familiar with editing variables, here's how it works. The variable looks something like this: $variable = "value"; You just replace the the word value. If there are quotes around the word, make sure you don't delete them. Numbers usually do not have quotes. If there are no quotes, do not add them! PHP is very sensitive to even the slightest error so take care not to delete any characters but the actual value. The first set of variables is the Display Config. These variables can all be changed at any time - even after you have set up the gallery. So if you aren't sure what you want, you can try all the options until you find what you like. In the Display Config, there are three options to open the large images: - newwindow Image opens by itself in a new browser window (target="_blank"). It is not a popup. - samepage Image opens by itself in the same page, replacing the thumbnails (not recommended). - gallery Image opens in the same page, replacing the thumbnails, but with navigation and a link back to the thumbnails. The second set of variables is the Thumbnail Config. These variables must be set BEFORE thumbnails are created. Changing them will not affect any existing thumbnails (delete existing ones first if you need to make changes). The only exception is the $increment variable, which sets the number of thumbnails made in each batch. If you have trouble with the script timing out while you are creating thumbnails, lower this number. It will not affect any thumbnails you have already made. When setting max size and width, take note that the script will keep the aspect ratio of the original image and use only one of the two maximum sizes. An 800x600 image with a max height of 100 and a max width of 100 would become a 100x75 thumbnail. A thumbnail quality of 85 or 90 is recommended for quality. Lower numbers may show artifacting. A 100x55 thumbnail at 90 quality and 1.2 gamma correction is roughly 2.5 KB. The optional gamma correction is great for thumbnails of dark screencaps, which can become hard to see when small. This will only brighten the thumbs, not the large images. 1.2-1.3 is generally effective for even very dark images. Anything higher than 1.5 will probably be too bright and look bad. The last set of variables is the Optional Config. You may change these at any time, but do not change them unless you have renamed the images or thumbs folder or changed the name of gallery.php! Customizing Your Gallery ---------------------------------------------------------------------------------- Open gallery.php and a few lines down you will find an HTML comment telling you where to edit the header. The easiest way to customize the gallery is to just edit this header and remove or replace the header image to your liking. You could also completely replace this header with your own, or if you use PHP includes for your header, just replace the existing header with your PHP include. Scroll down to the very bottom of the page to find more HTML comments where you need to edit or replace the footer. This script as is is XHTML 1.0 Transitional compliant and is tested to work in Mozilla Firefox and IE6. Support ---------------------------------------------------------------------------------- To test for PHP and GD: paste the following into notepad and save it as test.php Upload test.php to your webspace and view it in your browser. If you see the entire code, tags and all, you DO NOT have PHP support. Contact your webhost if you are not sure. If you do have PHP, you will see a long list of features and stats. At the very top will be your version of PHP. Scroll down and look for gd (you may want to do a page search). Check that it's enabled, the version is 2 or higher and that JPG support is enabled. If you can't find gd, contact your host - you may be able to turn it on with .htaccess or your control panel. You MUST have PHP for this script to work. Please do not email me unless you are SURE you have PHP (and also GD 2 support if you are having problems creating thumbnails). Thanks!