From: moodler Date: Wed, 19 Nov 2003 16:45:20 +0000 (+0000) Subject: Changes to use the new fullname function X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=1b26d5e74ee1f52158ffe62040ac1c4c0338b213;p=moodle.git Changes to use the new fullname function --- diff --git a/mod/forum/lib.php b/mod/forum/lib.php index d02bcdfb3d..f6e81a758f 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -249,7 +249,7 @@ function forum_cron () { $canreply = forum_user_can_post($forum, $userto); - $by->name = "$userfrom->firstname $userfrom->lastname"; + $by->name = fullname($userfrom, isteacher($course->id, $userto->id)); $by->date = userdate($post->modified, "", $userto->timezone); $strbynameondate = get_string("bynameondate", "forum", $by); @@ -397,7 +397,8 @@ function forum_print_recent_activity($course, $isteacher, $timestart) { $content = true; } $date = userdate($post->modified, $strftimerecent); - echo "

$date - $post->firstname $post->lastname
"; + $fullname = fullname($post, $isteacher); + echo "

$date - $fullname
"; echo "\"wwwroot/mod/forum/$log->url\">"; if ($log->action == "add discussion") { echo "$post->subject"; @@ -439,7 +440,8 @@ function forum_print_recent_instance_activity($forum, $timestart, $detail=false) echo $post->subject; echo "

"; echo ""; - $by->name = "wwwroot/user/view.php?id=$post->userid&course=$post->course\">$post->firstname $post->lastname"; + $fullname = fullname($post); + $by->name = "wwwroot/user/view.php?id=$post->userid&course=$post->course\">$fullname"; $by->date = userdate($post->modified); print_string("bynameondate", "forum", $by); echo "

"; @@ -1029,9 +1031,12 @@ function forum_make_mail_post(&$post, $user, $touser, $course, $output .= "

"; $output .= "$post->subject
"; $output .= ""; - $by->name = "wwwroot/user/view.php?id=$user->id&course=$course->id\">$user->firstname $user->lastname"; + + $fullname = fullname($user, isteacher($course->id)); + $by->name = "wwwroot/user/view.php?id=$user->id&course=$course->id\">$fullname"; $by->date = userdate($post->modified, "", $touser->timezone); $output .= get_string("bynameondate", "forum", $by); + $output .= "

"; $output .= "cellcontent2\" width=10>"; $output .= " "; @@ -1122,9 +1127,12 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link echo "

"; echo "$post->subject
"; echo ""; - $by->name = "wwwroot/user/view.php?id=$post->userid&course=$courseid\">$post->firstname $post->lastname"; + + $fullname = fullname($post, isteacher($courseid)); + $by->name = "wwwroot/user/view.php?id=$post->userid&course=$courseid\">$fullname"; $by->date = userdate($post->modified); print_string("bynameondate", "forum", $by); + echo "

"; echo "cellcontent2\" class=\"forumpostside\" width=\"10\">"; echo " "; @@ -1249,8 +1257,9 @@ function forum_print_discussion_header(&$post, $courseid, $datestring="") { echo "\n"; // User name + $fullname = fullname($post, isteacher($courseid)); echo "cellcontent2\" class=\"forumpostheadername\" align=left nowrap>"; - echo "wwwroot/user/view.php?id=$post->userid&course=$courseid\">$post->firstname $post->lastname"; + echo "wwwroot/user/view.php?id=$post->userid&course=$courseid\">$fullname"; echo "\n"; // Replies @@ -1810,7 +1819,8 @@ function forum_print_user_discussions($courseid, $userid) { if ($discussions = forum_get_user_discussions($courseid, $userid)) { $user = get_record("user", "id", $userid); echo "
"; - print_heading( get_string("discussionsstartedbyrecent", "forum", "$user->firstname $user->lastname") ); + $fullname = fullname($user, isteacher($courseid)); + print_heading( get_string("discussionsstartedbyrecent", "forum", $fullname) ); $replies = forum_count_discussion_replies(); foreach ($discussions as $discussion) { $countdiscussions++; @@ -2174,7 +2184,7 @@ function forum_print_posts_threaded($parent, $course, $depth, $ratings, $reply) } echo "
"; } else { - $by->name = "$post->firstname $post->lastname"; + $by->name = fullname($post, isteacher($course->id)); $by->date = userdate($post->modified); echo "
  • id\">discussion&parent=$post->id\">$post->subject "; print_string("bynameondate", "forum", $by);