MDL-62618 forum: Made full names displayed consistent

This commit is contained in:
Michael Hawkins 2018-06-18 10:12:09 +08:00
parent f61ee4e857
commit 26cee43786

View File

@ -3819,6 +3819,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
$post->subject = format_string($post->subject,true);
$canviewfullnames = has_capability('moodle/site:viewfullnames', $modcontext);
$timeddiscussion = !empty($CFG->forum_enabletimedposts) && ($post->timestart || $post->timeend);
$timedoutsidewindow = '';
if ($timeddiscussion && ($post->timestart > time() || ($post->timeend != 0 && $post->timeend < time()))) {
@ -3856,7 +3857,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
echo '</span>';
// User name
echo '<div class="media-body">';
$fullname = fullname($postuser, has_capability('moodle/site:viewfullnames', $modcontext));
$fullname = fullname($postuser, $canviewfullnames);
echo '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$post->userid.'&amp;course='.$forum->course.'">'.$fullname.'</a>';
echo '</div>';
echo '</div>';
@ -3924,7 +3925,7 @@ function forum_print_discussion_header(&$post, $forum, $group = -1, $datestring
// In QA forums we check that the user can view participants.
if ($forum->type !== 'qanda' || $canviewparticipants) {
echo '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$post->usermodified.'&amp;course='.$forum->course.'">'.
fullname($usermodified).'</a><br />';
fullname($usermodified, $canviewfullnames).'</a><br />';
$parenturl = (empty($post->lastpostid)) ? '' : '&amp;parent='.$post->lastpostid;
}