some style fixes
[phpfspot.git] / phpfspot.class.php
index dbefee8b37f52ec13bd2bb61cf7529df3fa3d8cf..36ac8ce2f5fa66d7169bdc8cc503f23254faa4b4 100644 (file)
@@ -38,11 +38,9 @@ class PHPFSPOT {
 
    public function show()
    {
-
-      $this->tmpl->assign('tags', $this->tags);
+      $this->tmpl->assign('page_title', $this->cfg->page_title);
       $this->tmpl->show("index.tpl");
 
-
    } // show()
 
    private function get_tags()
@@ -118,16 +116,33 @@ class PHPFSPOT {
 
    public function showPhoto($photo)
    {
+      $all_photos = $this->getAllTagPhotos();
+
+      foreach($all_photos as $all_photo) {
+         
+         if($get_next) {
+            $next_img = $all_photo;
+            break;
+         }
+
+         if($all_photo == $photo) {
+            $get_next = 1;
+         }
+         else {
+            $previous_img = $all_photo;
+         }
+      }
+
       if(isset($photo)) {
          $this->tmpl->assign('image_url', 'phpfspot_img.php?idx='. $photo ."&width=". $this->cfg->photo_width);
       }
 
-      if($photo > 0) {
-         $this->tmpl->assign('previous_url', "javascript:showImage(". ($photo-1) .");");
+      if($previous_img) {
+         $this->tmpl->assign('previous_url', "javascript:showImage(". $previous_img .");");
       }
 
-      if($photo < count($this->photos)) {
-         $this->tmpl->assign('next_url', "javascript:showImage(". ($photo+1) .");");
+      if($next_img) {
+         $this->tmpl->assign('next_url', "javascript:showImage(". $next_img .");");
       }
 
       $this->tmpl->show("single_photo.tpl");
@@ -159,8 +174,6 @@ class PHPFSPOT {
 
       }
 
-      print "<a href=\"javascript:Tags('reset', 0);\">Reset Tags</a>";
-
    } // getSelectedTags()
 
    public function addTag($tag)