Fórum

get user picture

safa safa, modificado 7 Anos atrás.

get user picture

New Member Postagens: 6 Data de Entrada: 06/10/16 Postagens Recentes
hello . i want to get user connected picture
i use template vm. i search a lot i find this code but it dosen't work with me

#set ($profilePicUrl = $request.theme-display.path-image + "/user_")
#if ($user.isFemale())
  #set ($profilePicUrl = $profilePicUrl + "female")
#else
  #set ($profilePicUrl = $profilePicUrl + "male")
#end

#set ($profilePicUrl = $profilePicUrl + "_portrait?img_id=")
#set ($profilePicUrl = $profilePicUrl + $user.getPortraitId())
portarait:$user.getPortraitId()
 #set ($profilePicUrl = $profilePicUrl + "&img_id_token=")
 #set ($DigesterUtil = $portal.getClass().forName("com.liferay.portal.kernel.util.DigesterUtil"))
 
         #set ($profilePicUrl = $profilePicUrl +$httpUtil.encodeURL($DigesterUtil.digest($user.getPortraitId())))

<img src="$profilePicUrl">

$httpUtil.encodeURL($DigesterUtil.digest($user.getPortraitId()) he couldn't recognize this code
could anyone can help me please.thanks
safa safa, modificado 7 Anos atrás.

RE: get user picture

New Member Postagens: 6 Data de Entrada: 06/10/16 Postagens Recentes
liferay version 6.2 CE
thumbnail
Amos Fong, modificado 7 Anos atrás.

RE: get user picture

Liferay Legend Postagens: 2047 Data de Entrada: 07/10/08 Postagens Recentes
Hm...maybe try using $utilLocator to find digesterUtil