Hi all.
This mod is not bad, but don't work for me.
Uploader and settings in admin are OK.
I use SEO url mod and I don't want to install other SEO mod.
Problem:
The page that contains gallery (main_page=gallery or main_page=define_gallery) do not work properly.
The problem is in gallery/index.php. Gallery page shows only pieces of php code (no thumbnails), because php script stops near $im = $this -> open($file);
I tried to find a solution to repair index.php, but unfortunately failed.
Then I decide to ignore gallery/index.php and include php file indexer.
With few lines of code I realized almost all needed functions.
In tpl_gallery_default.php switch
include "/gallery/index.php";
with
<?php
$imagetypes = array("image/jpeg", "image/gif");
function getImages($dir) {
global $imagetypes;
// array to hold return value
$retval = array();
// add trailing slash if missing
if(substr($dir, -1) != "/") $dir .= "/";
$dir = "PATH_TO_MY_GALLERY";
// full server path to directory
$fulldir = "{$_SERVER['DOCUMENT_ROOT']}/$dir";
$d = @dir($fulldir) or die("getImages: Failed opening directory $dir for reading");
while(false !== ($entry = $d->read())) {
// skip hidden files
if($entry[0] == ".") continue;
// check for image files
if(in_array(mime_content_type("$fulldir$entry"), $imagetypes)) { $retval[] = array( "file" => "/$dir$entry", "size" => getimagesize("$fulldir$entry") ); } } $d->close(); return $retval; }
?>
<?PHP
// fetch image details
$images = getImages("images");
// display on page
foreach($images as $img) {
echo "<div class=\"photo\">";
echo "<a href=\"{$img['file']}\" rel=\"lightbox\"><img src=\"{$img['file']}\" {$img['size'][3]} alt=\"\"></a><br>\n";
//echo "<a href=\"{$img['file']}\" rel=\"lightbox\">",basename($img['file']),"</a><br>\n";
//echo "({$img['size'][0]} x {$img['size'][1]} pixels)";
echo "</div>\n"; }
?>
If you want you can add pagination.
If you want you can add folder "big" in folder "gallery" and edit link of image to show image with same name in folder "big"
You can set width and height to resize image (thumbnail) and when click on it Lightbox show image in full size.
If you want you can use admin controls for width and height of thumb.
You can adjust divs in css.
Click over image activates Lightbox.
Sorry for my English and I hope that this post will be useful for someone.