used AND to add a show_tag constrait, but in case there hasn't been issued
[phpfspot.git] / phpfspot.class.php
index cbb6fed1241b72c6edccb63398a4968d48f52450..03fe9d487b79112e5e0c91877c892a2ced2ca0ec 100644 (file)
@@ -877,7 +877,10 @@ class PHPFSPOT {
          $query_str.= "WHERE ". $additional_where_cond ." ";
 
       if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) {
-         $query_str.= "AND 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))