summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index ec041bf..c56ecec 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -2535,11 +2535,26 @@ class PHPFSPOT {
{
$all = Array();
- $result = $this->db->db_query("
- SELECT id
- FROM photos
- ");
-
+ $query_str = "
+ SELECT p.id
+ FROM photos p
+ ";
+
+ /* if show_tags is set, only return details for photos which
+ are specified to be shown
+ */
+ if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) {
+ $query_str.= "
+ INNER JOIN photo_tags pt
+ ON p.id=pt.photo_id
+ INNER JOIN tags t
+ ON pt.tag_id=t.id
+ WHERE
+ t.name IN ('".implode("','",$this->cfg->show_tags)."')";
+ }
+
+ $result = $this->db->db_query($query_str);
+
while($row = $this->db->db_fetch_object($result)) {
array_push($all, $row['id']);
}