]> git.mjollnir.org Git - moodle.git/commitdiff
Fix for stupid bug causing old mails not to be marked as mailed
authormoodler <moodler>
Thu, 5 Aug 2004 18:08:20 +0000 (18:08 +0000)
committermoodler <moodler>
Thu, 5 Aug 2004 18:08:20 +0000 (18:08 +0000)
Also, forum email is now posted from old to new.

mod/forum/lib.php

index 330ff2eb547d6eb2874cd39f94952f9afa9f2ee9..afbd6d01e27ec65ff663c5f14dd6465ba772e4bd 100644 (file)
@@ -986,15 +986,16 @@ function forum_get_unmailed_posts($starttime, $endtime) {
                              WHERE p.mailed = 0
                                AND p.created >= '$starttime'
                                AND p.created < '$endtime'
-                               AND p.discussion = d.id");
+                               AND p.discussion = d.id
+                          ORDER BY p.modified ASC");
 }
 
 function forum_mark_old_posts_as_mailed($endtime) {
 /// Marks posts before a certain time as being mailed already
     global $CFG;
-    return modify_database("UPDATE prefix_forum_posts
-                               SET mailed = '1'
-                             WHERE created < '$endtime'");
+    return execute_sql("UPDATE {$CFG->prefix}forum_posts
+                           SET mailed = '1'
+                         WHERE created < '$endtime'");
 }
 
 function forum_get_user_posts($forumid, $userid) {