diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2008-10-15 21:48:06 +0200 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2008-10-15 21:48:06 +0200 |
commit | c26dd6eb3b24421abef1be71435b96aef6fe5548 (patch) | |
tree | 3a362e8153e5583d76080e60596cc111afd87bc2 /phpfspot.class.php | |
parent | f79d6ba1ebdd17a6d9e6e64f58ab05c898463d62 (diff) | |
parent | ad8f72f790097776757dfcd3eda84272fb17d142 (diff) |
Merge branch 'master' of /var/cache/git/phpfspot
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r-- | phpfspot.class.php | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index edfed95..11b5292 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -410,7 +410,7 @@ class PHPFSPOT { $query_str=" SELECT DISTINCT t1.id as id, t1.name as name - FROM + FROM photo_tags pt1 INNER JOIN photo_tags pt2 ON pt1.photo_id=pt2.photo_id @@ -2585,7 +2585,7 @@ class PHPFSPOT { error_log($text); break; case 'logfile': - error_log($text, 3, $his->cfg->log_file); + error_log($text, 3, $this->cfg->log_file); break; } @@ -3145,30 +3145,36 @@ class PHPFSPOT { { $all = Array(); - $query_str = " - SELECT p.id - FROM photos p - INNER JOIN photo_tags pt - ON p.id=pt.photo_id - "; - if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { $query_str.= " - INNER JOIN tags t - ON pt.tag_id=t.id - "; + SELECT + DISTINCT pt1.photo_id as id + FROM + photo_tags pt1 + INNER JOIN photo_tags + pt2 ON pt1.photo_id=pt2.photo_id + INNER JOIN tags t1 + ON t1.id=pt1.tag_id + INNER JOIN tags t2 + ON t2.id=pt2.tag_id + WHERE + pt1.tag_id LIKE '". $tagidx ."' + AND + t2.name IN ('".implode("','",$this->cfg->show_tags)."') + ORDER BY + t1.sort_priority ASC"; + } + else { + $query_str = " + SELECT + p.id + FROM + photos p + INNER JOIN photo_tags pt + ON p.id=pt.photo_id + WHERE + pt.tag_id LIKE '". $tagidx ."'"; } - $query_str.= " - WHERE - pt.tag_id LIKE '". $tagidx ."' - "; - - /*if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { - $query_str.= " - AND - t.name IN ('".implode("','",$this->cfg->show_tags)."') - "; - }*/ $result = $this->db->db_query($query_str); |