From 1f3066f1977cf9ba36bb2583597af8bc53eb7d0f Mon Sep 17 00:00:00 2001 From: Michael de Raadt Date: Tue, 2 Sep 2014 09:57:36 +0800 Subject: [PATCH] MDL-46619 Forum: link to the discussion only if users cannot see posts. --- mod/forum/lib.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 7938e9dddb6..1ec53b45ea7 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3883,14 +3883,18 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring="" echo ''; $usedate = (empty($post->timemodified)) ? $post->modified : $post->timemodified; // Just in case - $parenturl = (empty($post->lastpostid)) ? '' : '&parent='.$post->lastpostid; + $parenturl = ''; $usermodified = new stdClass(); $usermodified->id = $post->usermodified; $usermodified = username_load_fields_from_object($usermodified, $post, 'um'); + + // Show link to last poster and their post if user can see them. if ($canviewparticipants) { echo ''. fullname($usermodified).'
'; + $parenturl = (empty($post->lastpostid)) ? '' : '&parent='.$post->lastpostid; } + echo ''. userdate($usedate, $datestring).''; echo "\n";