]> git.mjollnir.org Git - moodle.git/commitdiff
Undoing Gustav's checkin from yesterday ...
authormoodler <moodler>
Mon, 31 May 2004 02:42:26 +0000 (02:42 +0000)
committermoodler <moodler>
Mon, 31 May 2004 02:42:26 +0000 (02:42 +0000)
Sorry, Gustav, but all those record_exists calls were too much overhead.

It's better done by a check in the delete page...  this will also
account for the case where a reply has been made since the post
was displayed on screen.

mod/forum/lib.php

index affd53e6bbc9b8f476d7c2e4f55d6669b78c69d5..a1771c23e3f7f95f4b30830e1eb87f1c6523181c 100644 (file)
@@ -1114,12 +1114,7 @@ function forum_make_mail_post(&$post, $user, $touser, $course,
 
     $age = time() - $post->created;
     if ($ownpost) {
-        if (!record_exists("forum_posts", "parent", $post->id)) {
-            $output .= "<a href=\"$CFG->wwwroot/mod/forum/post.php?delete=$post->id\">".get_string("delete", "forum")."</a>";
-            if ($reply) {
-                $output .= ' | ';
-            }
-        }
+        $output .= "<a href=\"$CFG->wwwroot/mod/forum/post.php?delete=$post->id\">".get_string("delete", "forum")."</a>";
         if ($reply) {
             $output .= "<a target=\"_blank\" href=\"$CFG->wwwroot/mod/forum/post.php?reply=$post->id\">".get_string("replyforum", "forum")."</a>";
         }
@@ -1257,13 +1252,11 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link
     }
     
     if ($ownpost or $isteacher) {
-        if (!record_exists("forum_posts", "parent", $post->id)) {
-            echo "<a href=\"$CFG->wwwroot/mod/forum/post.php?delete=$post->id\">$strdelete</a>";
-            if ($reply) {
-                echo " | ";
-            } else {
-                echo "&nbsp;&nbsp;";
-            }
+        echo "<a href=\"$CFG->wwwroot/mod/forum/post.php?delete=$post->id\">$strdelete</a>";
+        if ($reply) {
+            echo " | ";
+        } else {
+            echo "&nbsp;&nbsp;";
         }
     }
     if ($reply) {