Wednesday, October 24, 2007

Displaying "full name" of author from the user Profile

You need to add in an extra line to "initialise" or load up the profile.module details..i.e. profile_load_profile($account)

Where $account = the $user->uid of the current user.

I haven't tried this..but, it should be as simple as this:

($user->uid); ?>
print $user->profile_fullname; ?>

Where $user->uid is the current user and profile_fullname is the name of the profile field that stores the users full name.


Original Post: http://drupal.org/node/47308

2 comments:

Mindwraps said...

I ended up here, because I was trying to find out how I could load user profile data into the user object. Seeing that google might bring some more people here with the same question, I just want to make a minor correction.

The profile_load_profile() function expects the $user object itself as a parameter. Not just the uid.

You probably know this by now, but others might not :)

Thanks for sharing the knowledge !

glassdimly said...

This link provides the code that works:
http://drupal.org/node/271543