summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-01-05 15:18:39 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-01-05 15:18:39 +0100
commit66fc274f7ae4d70998e416917c9cfe2ba62add97 (patch)
tree0e333538a2514ba1f134d448682ef28bd296823d /phpfspot.class.php
parentfab120581e9289abfb7d2bffeccebac873227587 (diff)
issue90, display also photos which are not tagged
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php11
1 files changed, 6 insertions, 5 deletions
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;