MicroAlbum v2.4 By Gaby Vanhegan, 20080414 http://vanhegan.net/software/microalbum/ A photo gallery script written in PHP, with an emphasis on simplicity, ease of installation and usage. It does not have a million features, nor does it have a thousand configurations, skins or plugins. It is intended to be small, simple and fast. It works on the principle that you create one folder for each photo album, and you put the pictures you want into that folder. The script does the rest. Features * Just One Fileā„¢, minimal configuration and installation required * Just create a folder of images for each album, simplicity itself * Automatic building/rebuilding of thumbnails and previews * Customisable CSS, html header and footer * 'Most popular images' smart-album * Rotate individual images, add captions * Sort albums by date, filename or custom order * Password protected administration functions Changes in V2.0: Completely rewritten as a class. Much cleaner, more manageable code. 2008-04-01 * Added better error messages for unwritable folders * Added lockfile to stop the serialisation process from squashing data * Image dimensions are now cached to the album data * Fixed multiple lock file issue * All images sizes are now read from the data cache * New option to live-build previews and thumbnails 2008-04-04 * Much quicker preview skip on pre-generated images * Much lighter image build process now, doesn't touch config files * Completely re-written as a class instead of a bunch of functions * Automatic upgrade to newer data file format * Main image displays in same window rather than opening a new one * Uses fastimagecopyresampled() for image generation Changes in V2.1: 2008-04-14 * New variables for image quality in previews and thumbnails * Fixed: now shows message when live_build is off but a rebuild is needed * Performance improved when building thumbs/previews * Page build time calculated and put as a comment * Debugging log facility built-in * Better checks for required functions and folders at startup * Fixed: shutter speed calculation normalised MicroAlbum offers some customisation features to let you change the look and feel of the album; you can add your own stylesheet, and customise the headers and footers. The software is BSD licensed, so you can do what you want. See LICENSE.txt for more informaiton. Quick Installation -------------------- 1. Download and place the script in your web folder. 2. Open the script and set base_folder, gen_folder and admin_pass. 3. Create your albums, one per folder, inside base_folder. 4. Create gen_folder, and ensure that the web server can write to it. 5. All done! For more detailed instructions see the full install guide. Requirements -------------------- There are very few requirements for MicroAlbum: * A webserver * PHP 4 or higher * The gd extension for PHP, to create thumbnails and previews of images * The exif extension for PHP, to read the EXIF image data from jpeg images Most installations of PHP will have these options already, and later versions of PHP come with GD built-in. It does not require a database connection, or any external packages, other than those listed above. Full Installation Guide 1. Download the micralbum.php script and save it somewhere in your webspace. 2. Open up the script in a text editor. At the top of the script you should be able to configure the script to suit. As a bare minimum, you should set: * base_folder, the full path to the folder that contains your photo albums * gen_folder, where generated previews and thumbnails go. IMPORTANT: THIS FOLDER MUST BE INSIDE base_folder!!! * admin_pass, required for editing albums and pictures. 3. Make sure that gen_folder exists in base_folder, and that the user that the web server runs as can write to this folder. For example, if your web server runs as user www, and that user is in group www, then this is advisable: # mkdir generated/ # chgrp www generated/ # chmod g+w generated/ This creates the folder 'generated', changes it's group to www, and then allows users in group www to write to it. This will allow the webserver to save your thumbnail, previews and album data in this folder. 4. That's it. Now go to the page in a web browser and check that it works. Creating new albums -------------------- MicroAlbum expects each folder in base_folder to be a photo album, and for it to contain the photos you want in that album. To create a new album, just create a new folder in base_folder, the name of the folder being the name that you want the album to have. For example, to create an album called 'My Holiday Album', just create a folder with the name 'My Holiday Album', and put your holiday snaps into it. MicroAlbum will do the rest for you. Basic Configuration -------------------- The basic nuts and bolts that you have to set before you can use the software safely. * base_folder, the folder that contains the albums you wish to display. This folder must be readable by the script. * gen_folder, where the generated thumbnails and previews are stored, as well as the data files for the individual albums. IMPORTANT: THIS FOLDER MUST BE INSIDE base_folder!!! The script must be able to write to this folder or you will not be able to generate any thumbnails or previews. * admin_pass, the password required to edit album data, or use any of the admin functions. Tips -------------------- There are a number of access keys built in that enable you to navigate around albums using the keyboard. On a Mac, you press the control key and the access key (ctrl-n for example), and on Windows you press the alt key and the access key (alt-n). When viewing an album in preview mode Key Action a Toggle between viewing all photos in the album or page by page s Start viewing the album as a slideshow. n Go to the next page of photos. p Go to the previous page of photos. f Skip to the first page of photos. l Skip to the last page of photos. b Go back to the list of albums. e Go to the edit screen for the album. When viewing a picture n Go to the next picture in the album. p Skip to the previous picture in the album. f Skip to the first picture in the album. l Skip to the last picture in the album. b Go back to the whole album view. s Start or stop the slideshow. v View the current picture at full size (in a new window). When editing an album s Go to the album sorting screen. c Go to the caption editing screen. r Go to the picture rotation screen. b Go back to viewing the album. When editing the album list b Go back to the list of albums. Customisation -------------------- There are a number of ways to customise the album to make it fit in with your site design, from changing the title of the album to adding custom CSS, headers and footers. * custom_css, the relative path to a CSS file, which will be included in the HTML headers of the script. Set to false for no custom css (default) * custom_header, a block of HTML that is inserted before any of the page HTML is output, but just before the HTML for the album begins, but after the opening tag. Set to false for no header (default) * custom_footer, a block of HTML that is inserted after all the album HTML is output, but inside the closing tag. Set to false for no footer (default) * page_title, the title shown at the top of the page, before the name of the album. * home_link, optional text for a link back to another site, displayed before the title. Set to false for no home link (default) * home_url, URL for the optional link back to another site. * thumb_per_row, number of thumbnail images to display per row. (default 4) * thumb_per_page, number of thumbnail images to display per page. (default 12) * slide_time, number of seconds to display each slide for in slideshow mode (default 4 seconds) * most_popular, number of images to display in the "most viewed" album (default 50) Advanced Customisation -------------------- There are some advanced configuration options, but most of the time you won't want to set these as the defaults are sensible. * thumb_x, max width of thumbnail images in pixels (default 160) * thumb_y, max height of thumbnail images in pixels (default 120) * thumb_quality, generated thumbnail quality (2-5). 2 is low quality but fast build, 5 is excellent quality but slower build. Somewhere between 2.5 and 3 is about right for most people. * preview_x, max width of preview images in pixels (default 640) * preview_y, max height of preview images in pixels (default 480) * preview_quality, generated preview quality (2-5). 2 is low quality but fast build, 5 is excellent quality but slower build. Somewhere between 2.5 and 3 is about right for most people. * valid_types, an array of file extensions that are detected as images. All other files types are ignored by MicroAlbum. * valid_orders, what types of sorting are available for lists of albums and images. Don't change this unless you're ready to start hacking the code.