minor fixes for dbl / and index at last image
authorMarc MAURICE <dooblempub@positon.org>
Thu, 7 Oct 2010 22:48:13 +0000 (00:48 +0200)
committerMarc MAURICE <dooblempub@positon.org>
Thu, 7 Oct 2010 22:48:13 +0000 (00:48 +0200)
index.php
view.php

index b260d73..db2a590 100644 (file)
--- a/index.php
+++ b/index.php
@@ -93,7 +93,7 @@ foreach (scandir($realDir) as $file) if ($file != '.' and $file != '..')
        {
                $ext = strtolower(substr($file, -4));
                if ($ext == ".jpg" or $ext == ".png")
-                       $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => dirname($scriptUrlPath)."/view/$shortPath/$file" );
+                       $imageFiles[] = array( "name" => $file, "url" => getPreview("$realDir/$file"), "link" => dirname($scriptUrlPath)."/view$shortPath/$file" );
                else
                        $otherFiles[] = array( "name" => $file, "link" => dirname($scriptUrlPath)."/$realDir/$file" );
        }
index 99e7f9c..2d6aaa5 100644 (file)
--- a/view.php
+++ b/view.php
@@ -26,7 +26,7 @@ $prevImage = '';
 $nextImage = '';
 if ($pos > 0)
        $prevImage = $images[$pos-1];
-if ($pos < sizeof($images))
+if ($pos < sizeof($images)-1)
        $nextImage = $images[$pos+1];
 
 // template variables