/* return all available photos */
$query_str = "
- SELECT p.id
+ SELECT DISTINCT p.id
FROM photos p
LEFT JOIN photo_tags pt
ON p.id=pt.photo_id
$query_str.= "WHERE ". $additional_where_cond ." ";
if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) {
- if(isset($additional_where_cond))
- $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')";
- else
- $query_str.= "WHERE t.name IN ('".implode("','",$this->cfg->show_tags). "')";
+ if(isset($additional_where_cond))
+ $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')";
+ else
+ $query_str.= "WHERE t.name IN ('".implode("','",$this->cfg->show_tags). "')";
}
if(isset($order_str))