{PROJECT} /meta/stamm.ini {MENU} 00.03.04.01 {TITEL} Thumbnail Gallery (tngal) {CONTENT}
After looking for a simple no bells, no whistles PHP gallery and not finding one that fulfills my needs for simplicity I decided to set up my own and here it is, tngal.
tngal is a simple gallery application tailored for use with phpCMS. The main features are:
Especialy the final point was the main reason to write this little plugin. To test it you just need an installed and working phpCMS environment and a directory with a couple of pictures. Install the plugin where you like, preferably /parser/plugs, set up a template that includes {CONTENT_PLUGIN} at the place where you'd like to see the pictures and set up a content file in the directory that calls the plugin {PLUGIN FILE="/parser/plugs/tngal.php"} and you're ready to go.
Upon calling the page for the first time, the script will check if there is already a directory named .small with the thumbnails for the pictures. If not, it will try to generate a thumbnail image for each picture and store it in the .small directory. After this it will show the pictures in a simple table, six in a row.
Subdirs will be shown under the pictures. If the subdir has a .small directory, the first thumbnail will be shown, titled with the name of the dir. If there is a file called index.html or index.html this file will be referenced directly so you can add special comments to subdirectories, yet you will need to include the plugin in the subdir as well.
You may add some configuration stuff for each (base) directory by creating a file named tngal_settings.php there. This file will be parsed by the tngal script and allows you to override the default settings.
// Generate thumbnails?
$tng_thumbgen=true;
// Offer to download zip files?
$tng_zip_dl=false;
// Delete .zip files after unpacking/downloading?
$tng_zip_del=false;
// Offer to unpack zip files?
$tng_zip_up=false;
// Show dates of directories?
$tng_date=false;
// Show filenames?
$tng_filename=false;
// Number of columns per row
$tng_cols=6;
// Path to the picture placeholder (only shown when $tng_filename=true)
$tng_picpic="/images/pic.jpg";
// Path to the directory image placeholder
$tng_dirpic="/images/dir.jpg";
// Path to the zipfile image placeholder
$tng_zippic="/images/zip.jpg";
// Path to the pclzip.lib (needed for $tng_zip_up and $tng_zip_dl)
$tng_ziplib="/parser/plugs/pclzip.lib.php";
There are no pictures included! If you want to use placeholders you need to get your own - I have not yet found any pretty ones. The pclzip library is not included by default either but you may download it here.