From 7a065517afecaf0ca45df09c86c1ada201800a25 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 4 Oct 2008 09:07:59 +0200 Subject: error logging to file fails because of typo, fixes #80 Signed-off-by: William Juul --- phpfspot.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index 92c0fd2..18c1c52 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -2579,7 +2579,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; } -- cgit v1.2.3-18-g5258 From ad8f72f790097776757dfcd3eda84272fb17d142 Mon Sep 17 00:00:00 2001 From: Andreas Unterkircher Date: Sat, 4 Oct 2008 09:43:22 +0200 Subject: make get_random_tag_photo() behave correct when show_tags is set, fixes #81 Signed-off-by: Andreas Unterkircher --- phpfspot.class.php | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'phpfspot.class.php') diff --git a/phpfspot.class.php b/phpfspot.class.php index 18c1c52..ba33c89 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -404,7 +404,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 @@ -3139,30 +3139,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); -- cgit v1.2.3-18-g5258