]> git.mjollnir.org Git - moodle.git/commitdiff
fix for 5257
authortoyomoyo <toyomoyo>
Thu, 20 Apr 2006 02:33:04 +0000 (02:33 +0000)
committertoyomoyo <toyomoyo>
Thu, 20 Apr 2006 02:33:04 +0000 (02:33 +0000)
blocks/blog_tags/block_blog_tags.php

index 22d9e224a1650a0d0a49893b14a2e1e1b0c56d2f..b478efdc35157c32896aa75c3ded32c7ec396e9b 100644 (file)
@@ -70,8 +70,10 @@ class block_blog_tags extends block_base {
         $timewithin = $this->config->timewithin * 24 * 60 * 60; /// convert to seconds
         
         $sql  = 'SELECT t.*, COUNT(DISTINCT bt.id) as ct ';
-        $sql .= "FROM {$CFG->prefix}tags as t, {$CFG->prefix}blog_tag_instance as bt ";
+        $sql .= "FROM {$CFG->prefix}tags as t, {$CFG->prefix}blog_tag_instance as bt, {$CFG->prefix}post as p ";
         $sql .= 'WHERE t.id = bt.tagid ';
+        $sql .= 'AND p.id = bt.entryid ';
+        $sql .= 'AND (p.publishstate = "site" or p.publishstate="public") ';
         $sql .= "AND bt.timemodified > {$timewithin} ";
         $sql .= 'GROUP BY bt.tagid ';
         $sql .= 'ORDER BY ct DESC, t.text ASC ';