]> git.mjollnir.org Git - moodle.git/commitdiff
An initial effort at making posts return to correct context
authormoodler <moodler>
Fri, 20 Jun 2003 06:35:09 +0000 (06:35 +0000)
committermoodler <moodler>
Fri, 20 Jun 2003 06:35:09 +0000 (06:35 +0000)
mod/forum/lib.php
mod/forum/post.php

index fad723916628680047b91d0a1c73576471e09d64..fd5a377ea8906f20d36cc2f3156620ee726a6c60 100644 (file)
@@ -857,6 +857,7 @@ function forum_make_mail_post(&$post, $user, $touser, $course,
 function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link=false, $rate=false, $footer="") {
     global $THEME, $USER, $CFG;
 
+    echo "<a name=\"$post->id\"></a>";
     if ($post->parent) {
         echo "<TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 CLASS=\"forumpost\">";
     } else {
index a3676c13cf31bf23a5412601d276494de5f6cabd..091c2e341aa9b4672f49b23fadcdb943fa5c4fdb 100644 (file)
@@ -38,7 +38,7 @@
                 if ($subscribemessage = forum_post_subscription($post)) {
                     $timemessage = 2;
                 }
-                redirect(forum_go_back_to("discuss.php?d=$post->discussion"), $message.$subscribemessage, $timemessage);
+                redirect(forum_go_back_to("discuss.php?d=$post->discussion#$post->id"), $message.$subscribemessage, $timemessage);
 
             } else {
                 error(get_string("couldnotupdate", "forum"), $errordestination); 
@@ -55,7 +55,7 @@
                     $timemessage = 4;
                 }
 
-                redirect(forum_go_back_to("discuss.php?d=$post->discussion"), $message.$subscribemessage, $timemessage);
+                redirect(forum_go_back_to("discuss.php?d=$post->discussion#$post->id"), $message.$subscribemessage, $timemessage);
 
             } else {
                 error(get_string("couldnotadd", "forum"), $errordestination); 
         }
 
         forum_set_return();
+        unset($SESSION->fromdiscussion);
 
     } else if (isset($edit)) {  // User is editing their own post
 
         $post->forum  = $forum->id;
 
         forum_set_return();
+        unset($SESSION->fromdiscussion);
 
 
     } else if (isset($delete)) {  // User is deleting a post