added text how to open phpfspot in the browser
[phpfspot.git] / phpfspot.class.php
index e500dbe41c09dd427ca872202c51a672f4ea8adb..b82fbeef01d5333f4d2477591c1a6e6f257ab4d5 100644 (file)
@@ -115,10 +115,10 @@ class PHPFSPOT {
                $_SESSION['selected_tags'] = $this->extractTags($_GET['tags']);
             }
             if(isset($_GET['from_date']) && $this->isValidDate($_GET['from_date'])) {
-               $_SESSION['from_date'] = strtotime($_GET['from_date']);
+               $_SESSION['from_date'] = strtotime($_GET['from_date'] ." 00:00:00");
             }
             if(isset($_GET['to_date']) && $this->isValidDate($_GET['to_date'])) {
-               $_SESSION['to_date'] = strtotime($_GET['to_date']);
+               $_SESSION['to_date'] = strtotime($_GET['to_date'] ." 23:59:59");
             }
             break;
          case 'showp':
@@ -126,7 +126,7 @@ class PHPFSPOT {
                $_SESSION['selected_tags'] = $this->extractTags($_GET['tags']);
                $_SESSION['start_action'] = 'showp';
             }
-            if(isset($_GET['id'])) {
+            if(isset($_GET['id']) && is_numeric($_GET['id'])) {
                $_SESSION['current_photo'] = $_GET['id'];
                $_SESSION['start_action'] = 'showp';
             }
@@ -1442,9 +1442,9 @@ class PHPFSPOT {
     */
    private function get_calendar($mode)
    {
-      $year = $_SESSION[$mode .'_date'] ? date("Y", strtotime($_SESSION[$mode .'_date'])) : date("Y");
-      $month = $_SESSION[$mode .'_date'] ? date("m", strtotime($_SESSION[$mode .'_date'])) : date("m");
-      $day = $_SESSION[$mode .'_date'] ? date("d", strtotime($_SESSION[$mode .'_date'])) : date("d");
+      $year = $_SESSION[$mode .'_date'] ? date("Y", $_SESSION[$mode .'_date']) : date("Y");
+      $month = $_SESSION[$mode .'_date'] ? date("m", $_SESSION[$mode .'_date']) : date("m");
+      $day = $_SESSION[$mode .'_date'] ? date("d", $_SESSION[$mode .'_date']) : date("d");
 
       $output = "<input type=\"text\" size=\"3\" id=\"". $mode ."year\" value=\"". $year ."\"";
       if(!isset($_SESSION[$mode .'_date'])) $output.= " disabled=\"disabled\"";
@@ -1623,9 +1623,8 @@ class PHPFSPOT {
       if(isset($_SESSION['current_photo']) && $_SESSION['start_action'] == 'showp') {
          return "show_photo";
       }
-      elseif((isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags'])) ||
-         (isset($_SESSION['from_date']) && isset($_SESSION['to_date']))) {
-         return "showpi";
+      elseif(isset($_SESSION['selected_tags']) && !empty($_SESSION['selected_tags'])) {
+         return "showpi_tags";
       }
       elseif(isset($_SESSION['start_action']) && $_SESSION['start_action'] == 'showpi') {
          return "showpi";