TFT Gallery Manual

http://tftgallery.sourceforge.net


  1. Introduction
  2. Installation
    1. Where to get TFT-Gallery
    2. Requirements
    3. Step-by-step installation
  3. Using TFT-Gallery
    1. Features
    2. Config.inc reference
    3. Customizing a subfolder
    4. Styling guide
  4. Troubleshooting
  5. Example gallery
  6. Credits & License

1. Introduction

TFT Gallery is a PHP-based Web image gallery. The project has been started by me because I've needed a simple, easy to handle gallery. All the galleries I've found on the web either needed a database or missed some important features.

After the first release on freshmeat.net, I got a mail from Mike Scalora, who had some very good ideas how to improve TFT-Gallery and added some nice features, too. He joined the team, and now we both work together to make TFT-Gallery the best gallery ever ;-)

2. Installation

2.1. Where to get TFT-Gallery

The easiest way to get TFT-Gallery to take a look the homepage. Or get the files directly from Sourceforge.net.
Which way you may prefer, make sure that you always get the latest version, to take advantage of all the new features!

2.2. Requirements

There aren't much things you need to run TFT-Gallery:

  1. PHP ≥ 4
  2. either GD or ImageMagick

2.3. Step-by-step installation

  1. Download and unpack package:
    Download the actual version of TFT Gallery from our website and unpack the package.
  2. Upload the files to your webserver:
    Upload all the files from the package to your webserver.
  3. Configure the gallery:
    With the configuration tool you can easily create and modify the local_config.inc and create the album and data directory.
  4. Make sure the script has write-permission to the album- and data-directory:
    This is a very important step, otherwise the script cannot create the thumbnails and you get a lot of errors.
  5. Setup logging:
    You have to give write-permission to the 'gallery.log'-file.
  6. Secure the admin-panel:
    The standard password for the admin-panel is 'admin'. We recommend to change this standard password immediately after installation. Do to so, go to the panel (use the link in the footer or add 'admin/' to your gallery's URL e.g. 'http://your-domain.com/gallery/admin/') and use the 'password protection' to generate a new password file for the admin-directory.
  7. Upload your pictures:
    Either you upload your files via FTP or you use the upload script located in the admin area.
  8. Create a description of your images or directories:
    For describe the whole directory just add a file description to your image directory. If you want to describe a single image, store the description in (image-name).txt in the same directory.
    For your convenience we added a description form so you may alter the description when using the gallery (for security reasons only if you entered the admin area and went back using the link "TFT Gallery Home")

3. Using TFT-Gallery

3.1. Features

If you miss an important feature, submit a Feature-Request on Sourceforge.net or send us a mail.

3.2. Config.inc reference

For your convenience we have added a configuration script located in the administration area. But if you want to edit the local_config.inc yourself, here are the commands of the file:

$album_directory
The relative path to the directory in which the pictures are stored.
$data_directory
The relative path to the directory where the thumbnails and scaled previews are created.
$thumb_height, _width, _quality
Define the maximum dimensions of a thumbnail. The thumbnails don't lose the aspect ration when scaled down. The quality is a number between 0-100 (100 is best quality).
$rows_per_page, $pics_per_row
How many rows and columns should the thumbnailview have.
$show_filenames_with_thumbnails
Show the filennames under the thumbnails? Can be true or false.
$max_picture_height, _width
Here you can define the maximum size of the pictures that will be shown. If the original picture is bigger than these values it will be scaled down and a link to the fullsize picture will appear under the scaled down one. Very useful if you want to make sure that the picture fits into the browser-window.
$max_picture_scaling
Generate scaled version on server if original is this much greater.
$server_scaled_quality
Quality of the jpegs created for server scaled images
$server_scaled_caching
Cache scaled version of pictures?
$standard_style
The name of the css-file you want to use.
$language
Defines which string.inc should be included. Set to 'en' to include 'string.en.inc'.
Note that this setting should not be taken for granted. If the user configured his browser to get some other language and you provide the right string.*.inc, then this language is used.
$standard_style
The name of the css-file you want to use.
$table_layout
Do you want to have a <table>-based layout or not. The default is true, if you use MS Internet Explorer.
$pic_extensions
Defines, what types of files should be displayed as thumbnails
$other_extensions
What other files should be displayed using default thumbnails?
$gd_available
Select which image converter you want to use on your web server:
0: no GD at all; You have to create the thumbnails by yourself
1: GD 1.x; Not so nice thumbnails
2: GD 2.x; Nice looking thumbnails (default)
10: ImageMagick: You have to specify the folder the gallery can find the converter (see below).
$im_path
(only needed when using ImageMagick) Here you have to enter the full path for the converter (e. g. /usr/bin/convert)
$log_level
Define the logging-level. Valid values are:
0: disable logging (default)
1: only log errors
2: log errors and warnings
3: verbose logging (recommended just for debugging)
$thumb_map
This option maps the filetypes to the default thumbnails.

3.3. Customizing a subfolder

album.css and album.inc:

You can override the global settings from style.css and config.inc for each subfolder by just adding a album.css and/or a album.inc file into this directory.

description, description.txt and description.html:

If you add one of this files to a subfolder, this file will be shown. This can for example be used as album descriptions etc.

picture descriptions:

You can assign descriptions to single files. Example: Pic1.jpg -> Pic1.jpg.txt. The txt-file contains the description.

Album passwords:

You can protect single albums by using the file passwd. You can create such a file in the admin interface (http://your-domain.com/gallery/admin/)
In the same way you can change the password of the admin interface.

3.4. Styling guide

You can change the complete appearance and even the layout of your gallery by editing 'style.css'. A good reference is HTML Utopia: Designing Without Tables Using CSS. And have a look at the additional style-files to get an impression on how to style your gallery to your needs.
Maybe I'll write a Howto on this topic some day but for now you are on your own...
If you've created a new style and want it to be included in the next release, send it to me.

4. Troubleshooting

Before you move on, make sure you have the latest version of TFT-Gallery which includes all the new bugfixes.
If you have trouble with TFT-Gallery have a look at the Forum/FAQ. Also feel free to send me a mail.

5. Example gallery

A TFT-Gallery was created on a comercial linux hosting server. The default web site is contained in a directory named "public_html" in the home directory. All of the uploading, folder creation and permission setting were done with the FileZilla ftp client software running on Windows.

  1. The TFT-Gallery distribution was unzipped on a Windows computer
  2. A directory named "gallery" was created inside "public_html".
  3. The contents of the package was uploaded into the "gallery" folder.
  4. The "data", "albums", "albums/Center Ring" and "albums/Side Show" directories were created.
  5. The permissions of the "data" directory were set to 777 or rwxrwxrwx.
  6. The photos were uploaded to the respective folders.
  7. The local_config.inc was created and uploaded. The example local_config.inc file in section 2.3.2 was used.

If the hosted domain were cirque-du-photo.com, the URL for the gallery would be http://cirque-du-photo.com/gallery/ or http://www.cirque-du-photo.com/gallery/.


Key:

   Files and folders that are part of the TFT-Gallery package

   Files and folders manually created

   Permissions manually set

   Photos uploaded

   Files and folders created automatically



bash$ ls -R -l gallery



gallery:

drwxr-xr-x  2 ftpuser ftpuser  4096 Jul  2 20:49 admin

drwxr-xr-x  4 ftpuser ftpuser  4096 Jul  2 21:46 albums

drwxrwxrwx  3 ftpuser ftpuser  4096 Jul  2 21:58 data

drwxr-xr-x  3 ftpuser ftpuser  4096 Jul  2 20:48 doc

drwxr-xr-x  2 ftpuser ftpuser  4096 Jul  2 20:49 images

drwxr-xr-x  2 ftpuser ftpuser  4096 Jul  2 20:49 language

drwxr-xr-x  2 ftpuser ftpuser  4096 Jul  2 20:49 styles

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 config.inc

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 footer.php

-rw-r--r--  1 ftpuser ftpuser 15468 Jul  2 22:01 functions.inc

-rwxrwxrwx  1 ftpuser ftpuser  1843 Jul  2 20:48 gallery.log

-rw-r--r--  1 ftpuser ftpuser  3625 Jul  2 22:01 index.php

-rw-r--r--  1 ftpuser ftpuser    62 Jul  2 21:59 local_config.inc

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 location.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 navigation.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 picture.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 scale.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 settingsform.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 settings.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 thumbcommon.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 thumbnails.php

-rw-r--r--  1 ftpuser ftpuser  1843 Jul  2 20:48 thumb.php



gallery/admin:

-rw-r--r--  1 ftpuser ftpuser  815 Jul  2 20:48 admincache.php

-rw-r--r--  1 ftpuser ftpuser  815 Jul  2 20:48 index.php

-rw-r--r--  1 ftpuser ftpuser  815 Jul  2 20:48 mkpasswd.php

-rw-r--r--  1 ftpuser ftpuser  815 Jul  2 20:48 passwd

-rw-r--r--  1 ftpuser ftpuser  815 Jul  2 20:48 phpinfo.php



gallery/albums:

drwxr-xr-x  2 ftpuser ftpuser 4096 Jul  2 21:58 Center Ring

drwxr-xr-x  2 ftpuser ftpuser 4096 Jul  2 21:57 Side Show



gallery/albums/Center Ring:

-rw-r--r--  1 ftpuser ftpuser 6596 Jul  2 21:58 clown.jpg

-rw-r--r--  1 ftpuser ftpuser 8053 Jul  2 21:58 ringmaster.jpg

-rw-r--r--  1 ftpuser ftpuser 5760 Jul  2 21:58 trapeze.jpg



gallery/albums/Side Show:

-rw-r--r--  1 ftpuser ftpuser 7920 Jul  2 21:57 dancing-bear.jpg



gallery/doc:

-rw-r--r--  1 ftpuser ftpuser 10060 Jul  2 20:48 manual.html



gallery/images:

-rw-r--r--  1 ftpuser ftpuser 875 Jul  2 20:48 default_audio.gif

-rw-r--r--  1 ftpuser ftpuser 657 Jul  2 20:48 default_error.gif

-rw-r--r--  1 ftpuser ftpuser 539 Jul  2 20:48 default_GDerror.gif

-rw-r--r--  1 ftpuser ftpuser 854 Jul  2 20:48 default_photo.gif

-rw-r--r--  1 ftpuser ftpuser 539 Jul  2 20:48 default_unknown.gif

-rw-r--r--  1 ftpuser ftpuser 657 Jul  2 20:48 default_video.gif



gallery/language:

-rw-r--r--  1 ftpuser ftpuser 1674 Jul  2 20:48 lang.inc

-rw-r--r--  1 ftpuser ftpuser 1674 Jul  2 20:48 strings.de.inc

-rw-r--r--  1 ftpuser ftpuser 1718 Jul  2 20:48 strings.en.inc

-rw-r--r--  1 ftpuser ftpuser 1697 Jul  2 20:48 strings.fr.inc

-rw-r--r--  1 ftpuser ftpuser 1697 Jul  2 20:48 strings.it.inc

-rw-r--r--  1 ftpuser ftpuser 1697 Jul  2 20:48 strings.pl.inc



gallery/styles:

-rw-r--r--  1 ftpuser ftpuser 1718 Jul  2 20:48 babyblue.css

-rw-r--r--  1 ftpuser ftpuser 2036 Jul  2 20:48 simplegrey.css

-rw-r--r--  1 ftpuser ftpuser 1509 Jul  2 20:48 slickgreen.css



gallery/data:

drwxr-xr-x  4 nobody nobody 4096 Jul  2 21:59 data



gallery/data/thumbs/:

drwxr-xr-x  2 nobody nobody 4096 Jul  2 21:59 Center Ring

drwxr-xr-x  2 nobody nobody 4096 Jul  2 21:59 Side Show



gallery/data/thumbs/Center Ring:

-rw-r--r--  1 nobody nobody 3536 Jul  2 21:59 clown.jpg.jpg

-rw-r--r--  1 nobody nobody 4008 Jul  2 21:58 ringmaster.jpg.jpg

-rw-r--r--  1 nobody nobody 4392 Jul  2 21:58 trapeze.jpg.jpg



gallery/data/thumbs/Side Show:

-rw-r--r--  1 nobody nobody 3759 Jul  2 21:59 dancing-bear.jpg.jpg

6. Credits & License

TFT-Gallery is developed and maintained by:

Translations by:

This program is released under the terms of the GNU General Public License.