X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=05532044dbfa2015d63bdc8f6082c712238312e7;hp=99f5a173f97601e899b4ae593dcfb00aa0f32ef1;hb=66fc274f7ae4d70998e416917c9cfe2ba62add97;hpb=fab120581e9289abfb7d2bffeccebac873227587 diff --git a/phpfspot.class.php b/phpfspot.class.php index 99f5a17..0553204 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -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;