X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=d67c7e39dc4f1b1543296ce209ed7e0071a4beaa;hp=15697ad78fd73df8bcdf325ac0f2de191318c2a0;hb=5ea211de598c1e02a9f5ccb04b83a81ed9b41117;hpb=ba2bd867f7c0d549761efd0677abdea919212b99 diff --git a/phpfspot.class.php b/phpfspot.class.php index 15697ad..d67c7e3 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -46,7 +46,7 @@ class PHPFSPOT { /* set application name and version information */ $this->cfg->product = "phpfspot"; - $this->cfg->version = "1.1"; + $this->cfg->version = "1.2"; /* Check necessary requirements */ if(!$this->checkRequirements()) { @@ -253,13 +253,7 @@ class PHPFSPOT { INNER JOIN tags t ON pt.tag_id=t.id WHERE p.id='". $idx ."' - AND t.name IN ( - "; - foreach($this->cfg->show_tags as $tag) { - $query_str.= "'". $tag ."',"; - } - $query_str = substr($query_str, 0, strlen($query_str)-1); - $query_str.= ")"; + AND t.name IN ('".implode("','",$this->cfg->show_tags)."')"; } else { $query_str.= " @@ -666,11 +660,7 @@ class PHPFSPOT { $query_str.= "AND ". $additional_where_cond ." "; if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { - $query_str.= "AND t.name IN ("; - foreach($this->cfg->show_tags as $tag) { - $query_str.= "'". $tag ."',"; - } - $query_str = substr($query_str, 0, strlen($query_str)-1) . ")"; + $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags)."')"; } if(isset($order_str)) @@ -704,11 +694,7 @@ class PHPFSPOT { $query_str.= "AND ". $additional_where_cond ." "; if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { - $query_str.= "AND t.name IN ("; - foreach($this->cfg->show_tags as $tag) { - $query_str.= "'". $tag ."',"; - } - $query_str = substr($query_str, 0, strlen($query_str)-1) . ")"; + $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags)."')"; } if(isset($order_str)) @@ -763,11 +749,7 @@ class PHPFSPOT { $query_str.= "AND ". $additional_where_cond; if(isset($this->cfg->show_tags) && !empty($this->cfg->show_tags)) { - $query_str.= "AND t.name IN ("; - foreach($this->cfg->show_tags as $tag) { - $query_str.= "'". $tag ."',"; - } - $query_str = substr($query_str, 0, strlen($query_str)-1) . ")"; + $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')"; } if(isset($order_str)) @@ -795,11 +777,7 @@ 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 ("; - foreach($this->cfg->show_tags as $tag) { - $query_str.= "'". $tag ."',"; - } - $query_str = substr($query_str, 0, strlen($query_str)-1) . ")"; + $query_str.= "AND t.name IN ('".implode("','",$this->cfg->show_tags). "')"; } if(isset($order_str)) @@ -1997,14 +1975,15 @@ class PHPFSPOT { */ public function get_thumb_path($width, $photo) { - $sub_path = substr($this->getMD5($photo), 0, 2); + $md5 = $this->getMD5($photo); + $sub_path = substr($md5, 0, 2); return $this->cfg->thumb_path . "/" . $sub_path . "/" . $width . "_" - . $this->getMD5($photo); + . $md5; } // get_thumb_path()