[Solved] CCK field in uprofile
Hi,
This is probably obvious for everyone.....
How can I display a CCK field from the content type 'uprofile' for a specific user?
In the file node-uprofile.tpl.php I can display the CCK filed from 'uprofile': 'field_full_name' with this code:
$node->content['field_full_name']['#value']
That is because we are at the node which contain the info of a specific user.
But how can I get the full name of a specific user anywhere else on the site? For example if I want to display the full name of user with uid=10. Then I want to get the 'field_full_name' that user uid=10 has saved in the content type 'uprofile'.
Thanks!
Tim
this works: <?php$account =
this works:
<?php$account = node_load(array('type'=>'uprofile', 'uid'=>$object->uid));
$fullname = $account->field_full_name[0]['value'];
?>
Tim
Cool
You beat me to it :)
Michelle
So, to display the first
So, to display the first name of a buddy in a user's buddylist, I tried putting:
<?php$account = node_load(array('type'=>'uprofile', 'uid'=>$object->uid));
$firstname = $account->field_first_name[0]['value'];
?>
at the bottom of the "views-list-buddylist_of_uid.tpl.php" file.
this didn't work unfortunately
where am i going wrong?
many thanks
about adding that code..
i think i have the same problem but, what i cannot do is "PHP" itself :)
a newbie..
so would you please tell me where to put this code? before or after smth.. or in my situation, there would be another settings or smth??
please help thanks! :)