used AND to add a show_tag constrait, but in case there hasn't been issued
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 6 Jan 2008 16:52:37 +0000 (17:52 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 6 Jan 2008 16:52:37 +0000 (17:52 +0100)
a WHERE query already a WHERE needs to be used instead of the AND

Signed-off-by: Arun Persaud <arun@nubati.net>
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
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.= "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))
       }
  
       if(isset($order_str))