MDL-46619 Forum: link to the discussion only if users cannot see posts.

Conflicts:
	mod/forum/lib.php
This commit is contained in:
Michael de Raadt
2014-09-02 10:15:32 +08:00
committed by Damyon Wiese
parent b2b8d932f1
commit a80ed84ed3
+5 -1
View File
@@ -3792,15 +3792,19 @@ function forum_print_discussion_header(&$post, $forum, $group=-1, $datestring=""
echo '<td class="lastpost">';
$usedate = (empty($post->timemodified)) ? $post->modified : $post->timemodified; // Just in case
$parenturl = (empty($post->lastpostid)) ? '' : '&amp;parent='.$post->lastpostid;
$parenturl = '';
$usermodified = new stdClass();
$usermodified->id = $post->usermodified;
$usermodified->firstname = $post->umfirstname;
$usermodified->lastname = $post->umlastname;
// Show link to last poster and their post if user can see them.
if ($canviewparticipants) {
echo '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$post->usermodified.'&amp;course='.$forum->course.'">'.
fullname($usermodified).'</a><br />';
$parenturl = (empty($post->lastpostid)) ? '' : '&amp;parent='.$post->lastpostid;
}
echo '<a href="'.$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.$parenturl.'">'.
userdate($usedate, $datestring).'</a>';
echo "</td>\n";