From 8f2e80600bf0fc220b92706907fb3d683602e5c2 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 26ec87e1acd..35d8e002d11 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -3703,14 +3703,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";