From 4c627190011f46bcf1c8601e94c2a0e05f7fb7a4 Mon Sep 17 00:00:00 2001 From: gustav_delius Date: Sun, 30 May 2004 14:42:04 +0000 Subject: [PATCH] Delete links on forum post now only show if post has no children --- mod/forum/lib.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index eaa19b7036..26282b8ddc 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1114,7 +1114,12 @@ function forum_make_mail_post(&$post, $user, $touser, $course, $age = time() - $post->created; if ($ownpost) { - $output .= "wwwroot/mod/forum/post.php?delete=$post->id\">".get_string("delete", "forum").""; + if (!record_exists("forum_posts", "parent", $post->id)) { + $output .= "wwwroot/mod/forum/post.php?delete=$post->id\">".get_string("delete", "forum").""; + if ($reply) { + $output .= ' | '; + } + } if ($reply) { $output .= " | wwwroot/mod/forum/post.php?reply=$post->id\">".get_string("replyforum", "forum").""; } @@ -1246,11 +1251,13 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link } } if ($ownpost or $isteacher) { - echo "wwwroot/mod/forum/post.php?delete=$post->id\">$strdelete"; - if ($reply) { - echo "| "; - } else { - echo "  "; + if (!record_exists("forum_posts", "parent", $post->id)) { + echo "wwwroot/mod/forum/post.php?delete=$post->id\">$strdelete"; + if ($reply) { + echo " | "; + } else { + echo "  "; + } } } if ($reply) { -- 2.39.5