X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=0ce73936b10b8a66a62bcd7b2a07b11f92cff6cd;hp=9e78d1dcfe7ba06000fa5a7a19f1215cf3ac1eb0;hb=a8c8bd8ee5c29db5512230eaeb65e44794e21b89;hpb=aed571db7a6edcc6078a2d77ef1f60928bab79ca diff --git a/phpfspot.class.php b/phpfspot.class.php index 9e78d1d..0ce7393 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -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']);