Hi,
I have been trying to search for the answer how to retrieve user profile and display in a block.
The user profile is created with CCK profile(as a node) and I would like to display the node author(as a block) next to the node.
However, I'm having trouble retrieving the node author profile because author profile is created as a 'node'.

I was wondering if someone has done it before and can kindly show me the code to achieve this?

I have this in my block, but is returning all "0"s.

display all the variables:

$author = user_load(array('uid'=>$node->uid));

print_r($author);

this is the result:

display all the variables: stdClass Object ( [uid] => 0 [name] => [pass] => [mail] => [mode] => 0 [sort] => 0 [threshold] => 0 [theme] => [signature] => [signature_format] => 0 [created] => 0 [access] => 0 [login] => 0 [status] => 0 [timezone] => [language] => [picture] => [init] => [data] => [timezone_name] => [roles] => Array ( [1] => anonymous user ) )

Comments

roger.ajith’s picture

Hello,

If you want to display the author next to the node, you can use seperate node-nodetype.tpl.php file for your specified content type and you can change the format as you wish.
But still If you want to display the author name as block, you can create dynamic block using views module.
In that views block add node(nid) as an argument and add author(cck fields what you have added) as field.
enable that block next to content region.
It will display the author name for the corresponding node.

Hope It will help..

radiofranky2009’s picture

thanks.

I tried several thing already. My problem is that I don't know how to retrieve profile info created with CCK profile that associated with the node. Basically, display node with it's author cck profile info created during registration.

Is there a working sample code that I can try or play with? I tried at least +10 different codes by searching through the site, but no luck so far. Thanks

ahana’s picture

hi
i've used the core profile module, and extended it. i would like to display all user profile details to the left of my page in a block or panel,how can i go about this?