issue118, fix some problems with session vars for user-friendly urls
[phpfspot.git] / phpfspot.class.php
index 49d0c7df071da319c16c829bbc9d5be55a101d2e..6dcc8dee872d3d83453fed1b6424392bd57a86ea 100644 (file)
@@ -776,12 +776,12 @@ class PHPFSPOT {
                   <div style=\"display: table-cell;\">
                    <div style=\"display: table-row; text-align: center;\">
                     <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
                   <div style=\"display: table-cell;\">
                    <div style=\"display: table-row; text-align: center;\">
                     <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
-                     <img src=\"phpfspot_img.php?tagidx=". $tag ."\" />
+                     <img src=\"". $this->cfg->web_path ."/phpfspot_img.php?tagidx=". $tag ."\" />
                     </a>
                    </div>
                    <div style=\"display: table-row; text-align: center;\">
                     <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
                     </a>
                    </div>
                    <div style=\"display: table-row; text-align: center;\">
                     <a href=\"javascript:Tags('del', ". $tag .");\" title=\"". $this->tags[$tag] ."\">
-                     <img src=\"resources/underbar.png\" />
+                     <img src=\"". $this->cfg->web_path ."/resources/underbar.png\" />
                     </a>
                    </div>
                   </div>
                     </a>
                    </div>
                   </div>
@@ -1332,7 +1332,6 @@ class PHPFSPOT {
          if($last_page > 1)
             $this->tmpl->assign('page_selector', $page_select);
       }
          if($last_page > 1)
             $this->tmpl->assign('page_selector', $page_select);
       }
-
       
       $current_tags = $this->getCurrentTags();
       $extern_link = "index.php?mode=showpi";
       
       $current_tags = $this->getCurrentTags();
       $extern_link = "index.php?mode=showpi";
@@ -3129,6 +3128,7 @@ class PHPFSPOT {
                break;
             case 'tag':
                if(is_numeric($options[2])) {
                break;
             case 'tag':
                if(is_numeric($options[2])) {
+                  $this->session_cleanup();
                   $_GET['tags'] = $options[2];
                   $_SESSION['selected_tags'] = Array($options[2]);
                   return $this->showPhotoIndex();
                   $_GET['tags'] = $options[2];
                   $_SESSION['selected_tags'] = Array($options[2]);
                   return $this->showPhotoIndex();
@@ -3155,6 +3155,21 @@ class PHPFSPOT {
 
    } // is_user_friendly_url()
 
 
    } // is_user_friendly_url()
 
+   /**
+    * session cleanup
+    *
+    * this function will cleanup user's session information
+    */
+   private function session_cleanup()
+   {
+      unset($_SESSION['begin_with']);
+      $this->resetDateSearch();
+      $this->resetPhotoView();
+      $this->resetTagSearch();
+      $this->resetNameSearch();
+      $this->resetDateSearch();
+
+   } // session_cleanup()
 
 } // class PHPFSPOT
 
 
 } // class PHPFSPOT