issue67, when called from an external link, also check the consider-date-search-box...
[phpfspot.git] / phpfspot.class.php
index e5954ceea9c377a074be0210d638744331951802..9d3f548a2f38e7d714687e9cbabf0c52375aa598 100644 (file)
@@ -147,6 +147,9 @@ class PHPFSPOT {
             break;
       }
 
+      if(isset($_SESSION['from_date']) && isset($_SESSION['to_date']))
+       $this->tmpl->assign('date_search_enabled', true);
+
       $this->tmpl->assign('from_date', $this->get_calendar('from'));
       $this->tmpl->assign('to_date', $this->get_calendar('to'));
       $this->tmpl->assign('sort_field', $this->get_sort_field());
@@ -564,8 +567,8 @@ class PHPFSPOT {
       $matched_photos = Array();
 
       if(isset($_SESSION['from_date']) && isset($_SESSION['to_date'])) {
-         $from_date = strtotime($_SESSION['from_date']);
-         $to_date = strtotime($_SESSION['to_date']);
+         $from_date = strtotime($_SESSION['from_date'] ." 00:00:00");
+         $to_date = strtotime($_SESSION['to_date'] ." 23:59:59");
          $additional_where_cond = "
                p.time>='". $from_date ."'
             AND