|
|
|
|
@ -3461,18 +3461,19 @@ 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 array |
|
|
|
|
* @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 = '') |
|
|
|
|
function display_user_image($user_id, $name, $origin = '', $attributes = array()) |
|
|
|
|
{ |
|
|
|
|
$userInfo = api_get_user_info($user_id); |
|
|
|
|
$link = '<a href="'.$userInfo['profile_url'].'" '.(!empty($origin) ? 'target="_self"' : '').'>'; |
|
|
|
|
if ($user_id != 0) { |
|
|
|
|
|
|
|
|
|
return $link.'<img src="'.$userInfo['avatar'].'" alt="'.$name.'" title="'.$name.'" /></a>'; |
|
|
|
|
return $link.'<img src="'.$userInfo['avatar'].'" alt="'.$name.'" title="'.$name.'" class="'. $attributes['class'] .'" /></a>'; |
|
|
|
|
} else { |
|
|
|
|
return $link.'<img src="'.api_get_path(WEB_CODE_PATH)."img/unknown.jpg".'" alt="'.$name.'" title="'.$name.'" /></a>'; |
|
|
|
|
return $link.'<img src="'.api_get_path(WEB_CODE_PATH)."img/unknown.jpg".'" alt="'.$name.'" title="'.$name.'" class="'. $attributes['class'] . '" /></a>'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|