- $title
The title of your gallery. This will be on every page of the gallery, both in the title tag and the h1 tag.
Default Value >
$title = 'Test Gallery';
- $maxthumbwidth
If the GD extension is installed, this variable controls the maximum width of generated thumbnails, in
pixels.
Default Value >
$maxthumbwidth = 120;
- $maxthumbheight
-
If the GD extension is installed, this variable controls the maximum height of generated thumbnails, in
pixels.
Default Value >
$maxthumbheight = 120;
- $thumbquality
-
Quality of the generated thumbnails, higher the number the better the quality, upto a max of 100.
Default Value >
$thumbquality = 75;
- $cat_thumbs
If set to false, then a simple listing of directories/sub folders will be shown. If set to true, a random image from the relevant directory will be shown next to the sub-folder name.
Warning: If a directory does not contain an image, an error may be generated.
Default Value >
$cat_thumbs = false;
- $thumb_applyunsharpmask
The algorithm used by Enhanced Simple PHP Gallery to create thumbnails can produce images that appear soft. If $thumb_applyunsharpmask is true, an unsharp mask (USM) filter is applied to each thumbnail. Unsharp mask (USM) can restore sharpness to the thumbnails, making them appear crisper and more defined. USM does this by increasing contrast along edges in the image. (Please note that USM cannot refocus out-of-focus images. By increasing edge contrast, USM merely enhances sharpness that already exists.)
The USM settings in Enhanced Simple PHP Gallery mimic those in advanced image editing programs such as Adobe Photoshop and Jasc Paint Shop Pro:
- Radius - specifies the width of the affected area around each edge. This needn't be a whole number. Values that are too high can result in "halos" around the light and dark portions of the image.
- Amount - specifies the strength of the sharpening affect applied.
- Threshold - specifies how much difference must exist between adjacent pixels before they are considered an edge.
Longer-winded explanations of USM can be found on The Luminous Landscape and Thom Hogan's website.
Default Values >
// Unsharp mask settings for thumbnails
$thumb_applyunsharpmask = true;
$thumb_amount = 50;
$thumb_radius = 0.5;
$thumb_threshold = 2;
Note: The unsharp mask code is taken from the phpThumb() package available on Sourceforge.
- $resize
-
Why bother resizing all of your pictures by hand, when you can let Enhanced Simple PHP Gallery do it for you
automatically? Setting this option to true will enable image resizing.
Note that this option will not work if either $maxwidth or $maxheight is less than or equal to 0, or if
your version of GD is older than 2.0.
Default Value >
$resize = false;
- $maxwidth
If $resize is true, this variable controls the maximum width of resized images, in pixels.
Default Value >
$maxwidth = 640;
- $maxheight
If $resize is true, this variable controls the maximum height of resized images, in pixels.
Default Value >
$maxheight = 640;
- $resizequality
Quality of the resized images, higher the number the better the quality, upto a max of 100.
Default Value >
$resizequality = 75;
- $resize_applyunsharpmask
If true, an unsharp mask filter (see above) is applied to resized images.
Default Values >
// Unsharp mask settings for resized images
$resize_applyunsharpmask = true;
$resize_amount = 50;
$resize_radius = 0.5;
$resize_threshold = 2;
- $modrewrite
This variable controls whether the script outputs query string links or mod_rewrite links. If your server
supports mod_rewrite, and you have uploaded or appended the included .htaccess file, this should be set
to true. If your server does not support mod_rewrite, if you don't want to use mod_rewrite, or if you
just have no idea what this is about and would prefer not to fool with it, set it to false.
The difference in this script output looks like this:
$modrewrite = true; > links look like this:
<a href="galleryroot/folder/dir/subdir/subsubdir/>"
$modrewrite = false; > links look like this:
<a href="galleryroot/sp_index.php?dir=./dir/subdir/subsubdir/">
Using mod_rewrite links is nice because it hides the technology and overlays a virtual directory structure
over your physical directories. The user never leaves the index file, but it looks to them as if they
were navigating a directory tree. mod_rewrite links are also nice because they are easier to remember and
link directly.
Default Value >
$modrewrite = false;
- $cachethumbs
-
This variable controls whether the Enhanced Simple PHP Gallery should cache the thumbnails it generates. If
caching is on, each thumbnail will only be generated once, then saved to the server. When a thumnail is
requested, the script will automatically detect whether it has previously generated the thumbnail. If it
has, it will serve the file on disk, rather than generate a new thumbnail. Setting this to true takes a
large burden off of the server, so you probably want to leave it set to the default. If caching fails
for any reason (usually inability to read/write the cache folder), caching will be disabled, regardless
of this setting. If you change this variable to false after thumbnails have already been cached, the
cache folder (specified below) and all contents will be deleted automatically.
Also note that enabling thumbnail caching will also cause Enhanced Simple PHP Gallery to generate a file in the
cache folder named cache.ini. This file is meant to be used in conjunction with Dan Benjamin's "Better
Image Rotator".
Default Value >
$cachethumbs = true;
- $cachefolder
-
If $cachethumbs is true, this variable sets the folder that the thumbnails should be saved into. This
folder is created in the same directory as sp_index.php and will not show up as a folder in your gallery.
Note that if caching is enabled, but the cache folder does not exist, the script will attempt to create
it and chmod it to 755.
Default Value >
$cachefolder = 'cache';
- $cacheresized
If $resize is true, this variable controls whether Enhanced Simple PHP Gallery should cache the resized images it
generates. If caching is on, each image will only be resized once, then saved to the server. When an
image is requested, the script will automatically detect whether it has previously resized the image. If
it has, it will serve the file on disk, rather than generate a new resized image. Setting this to true
takes a large burden off of the server, so you probably want to leave it set to the default. If caching
fails for any reason (usually inability to read/write the cache folder), caching will be disabled,
regardless of this setting. If you change this variable to false after thumbnails have already been
cached, the cache folder (specified below) and all contents will be deleted automatically.
Default Value >
$cacheresized = true;
- $cacheresizedfolder
-
If $cacheresized is true, this variable sets the folder that the resized images should be saved into.
This folder is created in the same directory as sp_index.php and will not show up as a folder in your
gallery. Note that if caching is enabled, but the cache folder does not exist, the script will attempt
to create it and chmod it to 755.
Default Value >
$cacheresizedfolder = 'rcache';
- $precache
-
When viewing single images, enabling this option will cause the previous and next images to load into the
background, so that they will already be in the browser's cache when visitors click the "Previous" or
"Next" buttons. This gives the appearance of near-instantaneous image loading for your visitors. Note
that this feature will not work if $resize is true and $cacheresized is false.
Default Value >
$precache = true;
- $hidefolders[]
This is a special setting, an array of folder names that should not show up in your gallery. Just add a
line for each folder you wish to hide. Follow this format:
$hidefolders[] = 'hiddenfolder1';
$hidefolders[] = 'hiddenfolder2';
...and so on.
Folders named 'cgi-bin' are hidden by default.
Default Value >
$hidefolders[] = 'cgi-bin';
- $allowdeleting
Allow the deleting of images and directories
Default Value >
$allowdeleting = true;
- $allowmaking
Allow uploading of images, and creation of new sub folders
Default Value >
$allowmaking = true;
- $max_size
Max image upload size default is 150Kb or 153600 bytes
Default Value >
$max_size = 153600;
- $limit
The number of thumbnails to appear per page
Default Value >
$limit = 20;
- $showcomments
-
This variable controls whether the comments are allowed. If set to true, amendments are need in the comment.php script. See that file for details.
Default Value >
$showcomments = false;
- $showfolderdetails
-
This variable controls whether the number of images and folders appears in parentheses next to links to
subfolders.
Default Value >
$showfolderdetails = true;
- $showimgtitles
This variable controls whether image titles appear below thumbnails. If an image title for a particular
thumbnail cannot be found in sp_descriptions.ini, the filename will be used instead.
Default Value >
$showimgtitles = true;
- $showdatesonthumbspage
This variable controls whether the date a picture was added, if set, will appear on the below the thumbnail.
Default Value >
$showdatesonthumbspage = false;
- $alignimages
This variable controls whether thumbnails should be aligned into columns, regardless of their width.
When set to false, thumbnails will float left and bunch up accordingly.
Default Value >
$alignimages = true;
- $image_fade_in
This variable controls whether the resized image is viewed with a small loading screen, which fades the image in slowly.
Default Value >
$image_fade_in = true;
- $sortfoldersbytitle
This variable controls whether the directories are sorted by title (true) or folder name (false)
Default Value >
$sortfoldersbytitle = false;
- $gd_version
You will notice that this option is not initially found in sp_config.php. Enhanced Simple PHP Gallery will detect
this setting automatically and attempt to append a line similar to the following to sp_config.php:
$gd_version = '//your GD version here';
If Enhanced Simple PHP Gallery is unable to write to sp_config.php, it will simply re-detect the version every
time the script is loaded. This is a minor additional burden on your server. If sp_config.php is not
writeable on your server, you may wish to add this setting manually.
To manually set $gd_version, upload the file named gd_detect.php to your server and load it into your
browser. The proper line of code to add to sp_config.php will be automatically generated for you.