From d078ee9bf4e20acd552f3be794eae90d64fff591 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 29 Jun 2004 03:46:17 +0000 Subject: [PATCH] Slight changes to prunng code (first post now assumes discussion name) --- mod/forum/post.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mod/forum/post.php b/mod/forum/post.php index 1d767dabbe..d03a469a1c 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -355,7 +355,13 @@ error('Could not create new discussion'); } - set_field('forum_posts', 'parent', 0, 'id', $post->id); + $post->parent = 0; + $post->name = $name; + + if (!update_record("forum_posts", $post)) { + error('Could not update the original post'); + } + forum_change_discussionid($post->id, $newid); // set timemodified to time of last post in each discussion @@ -375,22 +381,21 @@ add_to_log($discussion->course, "forum", "prune post", "discuss.php?d=$newid", "$post->id", $cm->id); - redirect(forum_go_back_to("discuss.php?d=$newid"), - get_string("prunedpost", "forum"), 1); + redirect(forum_go_back_to("discuss.php?d=$newid"), get_string("prunedpost", "forum"), 1); } else { // User just asked to prune something $course = get_record('course', 'id', $forum->course); $strforums = get_string("modulenameplural", "forum"); print_header("$course->shortname: $discussion->name: $post->subject", "$course->fullname", - "id>$course->shortname -> - id\">$strforums -> - id\">$forum->name -> - id\">$post->subject -> ". + "id>$course->shortname -> + id\">$strforums -> + id\">$forum->name -> + id\">$post->subject -> ". get_string("prune", "forum"), '', "", true, "", navmenu($course, $cm)); print_heading(get_string('pruneheading', 'forum')); - echo '
'; + echo '
'; include('prune.html'); -- 2.39.5