Page 1 of 1

Help With Displaying Additional Data On Profiles

PostPosted: September 16th, 2011, 4:48 am
by godrob
Hi Guys,

What I am trying to achieve is to display additional data on members buddypress profile pages.

I am using the code below in my themes functions file:

Code: Select all
function ShowInfo() {

echo "Username:         " . S2MEMBER_CURRENT_USER_LOGIN . "<br>";
echo "Membership Level: " . S2MEMBER_CURRENT_USER_ACCESS_LABEL . "<br>";
echo "Registration IP:  " . S2MEMBER_CURRENT_USER_REGISTRATION_IP . "<br>";
echo "Current IP:       " . S2MEMBER_CURRENT_USER_IP . "<br>";
echo "Logins:           " . S2MEMBER_CURRENT_USER_LOGIN_COUNTER . "<br>";

}
add_action( 'bp_before_member_header_meta', 'ShowInfo' ); // show additional profile info


The problem is, that this displays the logged in users details as opposed the members profile that is being displayed. For example, I am 'admin', looking at members 'fayes' profile. Instead of 'fayes' additional details being echoed, I get mine.

Any help please?

Thanks
Rob

Re: Help With Displaying Additional Data On Profiles

PostPosted: September 26th, 2011, 1:20 am
by Cristián Lávaque
Hi Rob. You may want to use the get_userdata function for that. http://codex.wordpress.org/Function_Ref ... t_userdata