diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 07064aeeff..5041861e90 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3680,16 +3680,18 @@ function display_user_link($user_id, $name, $origin = '', $in_title = '') /** * This function displays the user image from the profile, with a link to the user's details. * @param int User's database ID - * @param str User's name + * @param string User's name + * @param string the origin where the forum is called (example : learnpath) * @return string An HTML with the anchor and the image of the user * @author Julio Montoya */ function display_user_image($user_id, $name, $origin = '') { $userInfo = api_get_user_info($user_id); - $link = ''; + + $link = ''; + if ($user_id != 0) { - return $link.''.$name.''; } else { return $link.''.$name.''; diff --git a/main/forum/viewforum.php b/main/forum/viewforum.php index 883a831f0d..f3a2115b95 100755 --- a/main/forum/viewforum.php +++ b/main/forum/viewforum.php @@ -495,7 +495,7 @@ if (is_array($threads)) { ); } - $html .= '
' . display_user_image($row['user_id'], $name) . '
'; + $html .= '
' . display_user_image($row['user_id'], $name, $origin) . '
'; $html .= ''; $html .= '
'; $html .= Display::tag(