diff --git a/demo/phpThumb.demo.gallery.php b/demo/phpThumb.demo.gallery.php
index 3e9e02e..f298f41 100644
--- a/demo/phpThumb.demo.gallery.php
+++ b/demo/phpThumb.demo.gallery.php
@@ -24,18 +24,21 @@
die('For security reasons, this demo is disabled by default. Please comment out line '.__LINE__.' in '.basename(__FILE__));
$docroot = realpath((getenv('DOCUMENT_ROOT') && preg_match('#^'.preg_quote(realpath(getenv('DOCUMENT_ROOT'))).'#', realpath(__FILE__))) ? getenv('DOCUMENT_ROOT') : str_replace(dirname(@$_SERVER['PHP_SELF']), '', str_replace(DIRECTORY_SEPARATOR, '/', dirname(__FILE__))));
-$basedir = '/demo/images/'; // webroot-relative path to main images directory (only this and subdirectories of this will be displayed)
-$thumb = '/demo/phpThumb.php'; // webroot-relative path to "phpThumb.php"
-$popup = '/demo/demo/phpThumb.demo.showpic.php'; // webroot-relative path to "phpThumb.demo.showpic.php" (only used if $use_popup == true)
-$thumbnailsize = 120; // size of thumbnails in pixels when browsing gallery
-$displaysize = 480; // size of large image display (popup or plain image) after clicking on thumbnail
-$use_popup = true; // if true, open large image in self-resizing popup window; if false, display larger image in main window
+$imgdir = '/images/'; // webroot-relative path to main images directory (only this and subdirectories of this will be displayed)
+$thumb = '/phpThumb.php'; // webroot-relative path to "phpThumb.php"
+$config = '/phpThumb.config.php'; // webroot-relative path to "phpThumb.php"
+$popup = '/demo/phpThumb.demo.showpic.php'; // webroot-relative path to "phpThumb.demo.showpic.php" (only used if $use_popup == true)
+$thumbnailsize = 120; // size of thumbnails in pixels when browsing gallery
+$displaysize = 480; // size of large image display (popup or plain image) after clicking on thumbnail
+$use_popup = true; // if true, open large image in self-resizing popup window; if false, display larger image in main window
//////////////////////////////////////////////////////////////
-$dirlimit = realpath($docroot.'/'.$basedir);
+require_once($docroot.$config);
-$captionfile = $docroot.'/'.$basedir.(@$_REQUEST['dir'] ? $_REQUEST['dir'].'/' : '').'captions.txt';
+$dirlimit = realpath($docroot.'/'.$imgdir);
+
+$captionfile = $docroot.'/'.$imgdir.(@$_REQUEST['dir'] ? $_REQUEST['dir'].'/' : '').'captions.txt';
if (file_exists($captionfile)) {
$filecontents = file($captionfile);
foreach ($filecontents as $key => $value) {
@@ -47,12 +50,12 @@
if (!empty($_REQUEST['pic'])) {
$alt = @$CAPTIONS[$_REQUEST['pic']] ? $CAPTIONS[$_REQUEST['pic']] : $_REQUEST['pic'];
- echo '
';
+ echo '
';
echo '
'; if ($use_popup) { - echo ''; + echo ''; } else { echo ''; } - echo ''; + echo ''; echo ' |