Show current User picture and user details in custom block
Categories
Component ID
2102021
Component name
Show current User picture and user details in custom block
Component type
module
Maintenance status
Development status
Component security advisory coverage
not-covered
Component created
Component changed
Component body
step 1:) Create custom mudule..
function modulename_theme(){
return array(
'article_node_form'=> array(
'render element'=> 'form',
'template'=> 'article_node_form'
),
);
}
function modulename_form_alter(&$form,&$form_state,$form_id)
{
print $form_id;
}
function searchform(){
global $user;
print_r($user);
$fid = $user->picture;
$file = file_load($fid);
if($file !=''){
$printss = theme('user_picture', array('account' => $user , 'path' => $file->uri,));
//$title = theme('image_style', array('style_name' => 'thumbnail', 'path' => $file->uri,));
//return ("hello Mr. ".$user->name.$user->picture);
return ('Hello '.$user->name.'<br/>'.$printss.'<br/>'.$user->roles[2]);
}
}
And than call custom function " searchform()" in our custom block body.
