Merge pull request #1027 from jloguercio/8104

Fix Click the user img in thread list it redirect to the full page of chamilo when the forum is in LP - Refs #8104
1.10.x
José Loguercio 10 years ago
commit 783f2b1fb8
  1. 8
      main/forum/forumfunction.inc.php
  2. 2
      main/forum/viewforum.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 <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>';
} else {
return $link.'<img src="'.api_get_path(WEB_CODE_PATH)."img/unknown.jpg".'" alt="'.$name.'" title="'.$name.'" /></a>';

@ -495,7 +495,7 @@ if (is_array($threads)) {
);
}
$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(

Loading…
Cancel
Save