From 9518a9b5226a2ab1eb96c52439bfc383cf457dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Tue, 23 Feb 2016 14:06:22 -0500 Subject: [PATCH 1/3] Fix Click the user img in thread list it redirect to the full page of chamilo when the forum is in LP - Refs #8104 --- main/forum/forumfunction.inc.php | 7 +++++-- main/forum/viewforum.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index 07064aeeff..a3b58f0e3a 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3680,14 +3680,17 @@ 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 of the forum call (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.''; 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( From d47d0e3861f1b85cd9a6ad60c00d50bb875a9a85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Tue, 23 Feb 2016 15:16:17 -0500 Subject: [PATCH 2/3] minor code fix --- main/forum/forumfunction.inc.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index a3b58f0e3a..b2c4db7832 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3681,7 +3681,7 @@ 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 string User's name - * @param string the origin of the forum call (example : learnpath) + * @param string the origin where the forum is call (example : learnpath) * @return string An HTML with the anchor and the image of the user * @author Julio Montoya */ @@ -3692,7 +3692,6 @@ function display_user_image($user_id, $name, $origin = '') $link = ''; if ($user_id != 0) { - return $link.''.$name.''; } else { return $link.''.$name.''; From cc27d59653ebb41c0ce8a7dad8ba7239b0f3ed79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Tue, 23 Feb 2016 15:17:39 -0500 Subject: [PATCH 3/3] fix param comment --- main/forum/forumfunction.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index b2c4db7832..5041861e90 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3681,7 +3681,7 @@ 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 string User's name - * @param string the origin where the forum is call (example : learnpath) + * @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 */