Undoing Gustav's checkin from yesterday ...
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.
This commit is contained in:
+6
-13
@@ -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 " ";
|
||||
}
|
||||
echo "<a href=\"$CFG->wwwroot/mod/forum/post.php?delete=$post->id\">$strdelete</a>";
|
||||
if ($reply) {
|
||||
echo " | ";
|
||||
} else {
|
||||
echo " ";
|
||||
}
|
||||
}
|
||||
if ($reply) {
|
||||
|
||||
Reference in New Issue
Block a user