]> git.mjollnir.org Git - moodle.git/commitdiff
post table will be used for storing comments as well so the type has to be specified...
authortoyomoyo <toyomoyo>
Thu, 4 Jan 2007 02:51:21 +0000 (02:51 +0000)
committertoyomoyo <toyomoyo>
Thu, 4 Jan 2007 02:51:21 +0000 (02:51 +0000)
blog/lib.php

index f2c89f13786444f2d804cc4a24459ffbe4cabff9..9b2c34b7f1346ec08527242e546fb36db737cad3 100755 (executable)
     function fetch_entries($postid='', $fetchlimit=10, $fetchstart='', $filtertype='', $filterselect='', $tagid='', $tag ='', $sort='lastmodified DESC', $limit=true) {
 
         global $CFG, $USER;
+        
+        /// the post table will be used for other things too
+        $typesql = ' AND p.module = "blog" ';    
 
         /// set the tag id for searching
         if ($tagid) {
                         .$CFG->prefix.'user u
                         WHERE p.userid = u.id '.$tagquerysql.'
                         AND u.deleted = 0
-                        AND '.$permissionsql;
+                        AND '.$permissionsql.$typesql;
 
             break;
 
                         AND ra.contextid '.get_related_contexts_string($context).'
                         AND u.id = p.userid
                         AND u.deleted = 0
-                        AND '.$permissionsql;
+                        AND '.$permissionsql.$typesql;
 
             break;
 
                         WHERE '.groups_members_where_sql($filterselect, 'p.userid').'
                         AND u.id = p.userid
                         AND u.deleted = 0
-                        AND '.$permissionsql;
+                        AND '.$permissionsql.$typesql;
 
                         /*'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
                         .$CFG->prefix.'groups_members m, '.$CFG->prefix.'user u
                         AND u.id = p.userid
                         AND m.groupid = '.$filterselect.'
                         AND u.deleted = 0
+                        AND '.$permissionsql.$typesql;
                         AND '.$permissionsql;
                         */
             break;
                         WHERE p.userid = u.id '.$tagquerysql.'
                         AND u.id = '.$filterselect.'
                         AND u.deleted = 0
-                        AND '.$permissionsql;
+                        AND '.$permissionsql.$typesql;
             break;
         }