- 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 {