refix some introduced template-errors in the HTML code
[phpfspot.git] / phpfspot.class.php
index 1e07ccc586ec146aa34fcc0c857b0e265e5b8c0d..00b3af4a08f402fedcaf6e1ba162adf6c30bce3c 100644 (file)
@@ -311,8 +311,8 @@ class PHPFSPOT {
          $this->tmpl->assign('date_search_enabled', true);
 
       $this->tmpl->register_function("sort_select_list", array(&$this, "smarty_sort_select_list"), false);
-      $this->tmpl->assign('from_date', $this->get_calendar('from'));
-      $this->tmpl->assign('to_date', $this->get_calendar('to'));
+      $this->tmpl->assign('search_from_date', $this->get_calendar('from'));
+      $this->tmpl->assign('search_to_date', $this->get_calendar('to'));
 
       $this->tmpl->assign('preset_selected_tags', $this->getSelectedTags());
       $this->tmpl->assign('preset_available_tags', $this->getAvailableTags());
@@ -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] ."\">
-                     <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] ."\">
-                     <img src=\"resources/underbar.png\" />
+                     <img src=\"". $this->cfg->web_path ."/resources/underbar.png\" />
                     </a>
                    </div>
                   </div>
@@ -1332,7 +1332,6 @@ class PHPFSPOT {
          if($last_page > 1)
             $this->tmpl->assign('page_selector', $page_select);
       }
-
       
       $current_tags = $this->getCurrentTags();
       $extern_link = "index.php?mode=showpi";
@@ -1641,7 +1640,7 @@ class PHPFSPOT {
     */
    public function get_meta_informations($file)
    {
-      return @exif_read_data($file);
+      return exif_read_data($file);
 
    } // get_meta_informations()
 
@@ -2711,7 +2710,9 @@ class PHPFSPOT {
     */
    private function ts2str($timestamp)
    {
-      return strftime("%Y-%m-%d", $timestamp);
+      if(!empty($timestamp) && is_numeric($timestamp))
+         return strftime("%Y-%m-%d", $timestamp);
+
    } // ts2str()
 
    /**
@@ -3129,6 +3130,7 @@ class PHPFSPOT {
                break;
             case 'tag':
                if(is_numeric($options[2])) {
+                  $this->session_cleanup();
                   $_GET['tags'] = $options[2];
                   $_SESSION['selected_tags'] = Array($options[2]);
                   return $this->showPhotoIndex();
@@ -3155,6 +3157,21 @@ class PHPFSPOT {
 
    } // 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