From 66035aafd901061d16b13462091a295e7ac38812 Mon Sep 17 00:00:00 2001 From: vyshane Date: Mon, 25 Sep 2006 05:00:36 +0000 Subject: [PATCH] Merged fix for MDL-6521 --- mod/forum/lib.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 55a446287a..7cac0ccb3f 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1993,10 +1993,12 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link } } + $forumtype = get_field('forum', 'type', 'id', $post->forum); + $age = time() - $post->created; /// Hack for allow to edit news posts those are not displayed yet until they are displayed if (!$post->parent - && get_field('forum', 'type', 'id', $post->forum) == 'news' + && $forumtype == 'news' && get_field_sql("SELECT id FROM {$CFG->prefix}forum_discussions WHERE id = $post->discussion AND timestart > ".time())) { $age = 0; } @@ -2007,7 +2009,9 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link } } - if (has_capability('mod/forum:splitdiscussions', $modcontext) and $post->parent) { + if (has_capability('mod/forum:splitdiscussions', $modcontext) + && $post->parent && $forumtype != 'single') { + $commands[] = ''.$strprune.''; } @@ -3276,6 +3280,7 @@ function forum_print_discussion($course, $forum, $discussion, $post, $mode, $can } $post->forum = $forum->id; // Add the forum id to the post object, later used by forum_print_post + $post->forumtype = $forum->type; $post->subject = format_string($post->subject); -- 2.39.5