X-Git-Url: http://positon.org/gitweb/?p=bizou.git;a=blobdiff_plain;f=index.php;h=195ca3b2b16cce634909548d937485fa1ea809e0;hp=09ba285a74bffa6819e5a5afe0eb4d6650969ca5;hb=6e8404aef25b35cf9371586ce9d74b7ffcd1207c;hpb=d7db66cc2dc4da43e4c996ebc5656f309b822131 diff --git a/index.php b/index.php index 09ba285..195ca3b 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@ define('THUMB_SIZE', 100); define('DATA_DIR', 'data'); define('IMAGES_DIR', 'images'); +define('USE_VIEWER', true); function getPreview($imgFile, $maxSize = THUMB_SIZE) { @@ -94,10 +95,17 @@ foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..') else { $ext = strtolower(substr($file, -4)); - if ($ext == ".jpg" or $ext == ".png") - $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => dirname($scriptUrlPath)."/view.php$shortPath/$file" ); - else + if ($ext == ".jpg" or $ext == ".png") { + if (USE_VIEWER) + $link = dirname($scriptUrlPath)."/view.php$shortPath/$file"; + else + $link = dirname($scriptUrlPath)."/$realDir/$file"; + + $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => $link ); + + } else { $otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" ); + } } }