Skip to content

Commit

Permalink
Fix Click the user img in thread list it redirect to the full page of…
Browse files Browse the repository at this point in the history
… chamilo when the forum is in LP - Refs #8104
  • Loading branch information
jloguercio committed Feb 23, 2016
1 parent 977f9da commit 9518a9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions main/forum/forumfunction.inc.php
Expand Up @@ -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 <gugli100@gmail.com>
*/
function display_user_image($user_id, $name, $origin = '')
{
$userInfo = api_get_user_info($user_id);
$link = '<a href="'.$userInfo['profile_url'].'" '.(!empty($origin) ? 'target="_self"' : '').'>';

$link = '<a href="'.(!empty($origin) ? '#' : $userInfo['profile_url']).'" '.(!empty($origin) ? 'target="_self"' : '').'>';

if ($user_id != 0) {

return $link.'<img src="'.$userInfo['avatar'].'" alt="'.$name.'" title="'.$name.'" /></a>';
Expand Down
2 changes: 1 addition & 1 deletion main/forum/viewforum.php
Expand Up @@ -495,7 +495,7 @@
);
}

$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name) . '</div>';
$html .= '<div class="thumbnail">' . display_user_image($row['user_id'], $name, $origin) . '</div>';
$html .= '</div>';
$html .= '<div class="col-md-10">';
$html .= Display::tag(
Expand Down

0 comments on commit 9518a9b

Please sign in to comment.