From c274b0e0f586d2257ca3d7b205118b02bd744d73 Mon Sep 17 00:00:00 2001 From: moodler Date: Thu, 5 Aug 2004 18:08:20 +0000 Subject: [PATCH] Fix for stupid bug causing old mails not to be marked as mailed Also, forum email is now posted from old to new. --- mod/forum/lib.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 330ff2eb54..afbd6d01e2 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -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) { -- 2.39.5