From: Andreas Unterkircher Date: Sat, 5 Jan 2008 14:18:39 +0000 (+0100) Subject: issue90, display also photos which are not tagged X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=commitdiff_plain;h=66fc274f7ae4d70998e416917c9cfe2ba62add97 issue90, display also photos which are not tagged --- 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;