issue59, remove HTML table from main skeleton
[phpfspot.git] / phpfspot.class.php
index 9e78d1dcfe7ba06000fa5a7a19f1215cf3ac1eb0..0ce73936b10b8a66a62bcd7b2a07b11f92cff6cd 100644 (file)
@@ -165,10 +165,10 @@ class PHPFSPOT {
                   $_SESSION['start_action'] = 'showp';
                }
                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 'export':
@@ -866,13 +866,14 @@ class PHPFSPOT {
 
       /* return all available photos */
       $query_str = "
-         SELECT DISTINCT photo_id
-            FROM photo_tags pt
-         INNER JOIN photos p
+         SELECT p.id
+         FROM photos p
+         LEFT JOIN photo_tags pt
             ON p.id=pt.photo_id
-         INNER JOIN tags t
+         LEFT JOIN tags t
             ON pt.tag_id=t.id
       ";
+
       if(isset($additional_where_cond)) 
          $query_str.= "WHERE ". $additional_where_cond ." ";
 
@@ -885,7 +886,7 @@ class PHPFSPOT {
 
       $result = $this->db->db_query($query_str);
       while($row = $this->db->db_fetch_object($result)) {
-         array_push($matched_photos, $row['photo_id']);
+         array_push($matched_photos, $row['id']);
       }
       return $matched_photos;
 
@@ -1094,6 +1095,8 @@ class PHPFSPOT {
       $this->tmpl->assign('rss_link', $rss_link);
       $this->tmpl->assign('count', $count);
       $this->tmpl->assign('width', $this->cfg->thumb_width);
+      $this->tmpl->assign('thumb_container_width', $this->cfg->thumb_width+20);
+      $this->tmpl->assign('thumb_container_height', $this->cfg->thumb_height);
       $this->tmpl->assign('images', $images);
       $this->tmpl->assign('img_width', $img_width);
       $this->tmpl->assign('img_height', $img_height);
@@ -1441,12 +1444,14 @@ class PHPFSPOT {
       $this->get_tags();
 
       $_SESSION['searchfor'] = $searchfor;
+
       if($from != 0)
-         $_SESSION['from_date'] = strtotime($from);
+         $_SESSION['from_date'] = strtotime($from ." 00:00:00");
       else
          unset($_SESSION['from_date']);
+
       if($to != 0)
-         $_SESSION['to_date'] = strtotime($to);
+         $_SESSION['to_date'] = strtotime($to ." 23:59:59");
       else
          unset($_SESSION['to_date']);