PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Help With Displaying Additional Data On Profiles

s2Member Plugin. A Membership plugin for WordPress®.

Help With Displaying Additional Data On Profiles

Postby godrob » September 16th, 2011, 4:48 am

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
User avatar
godrob
Registered User
Registered User
 
Posts: 33
Joined: August 26, 2011

Re: Help With Displaying Additional Data On Profiles

Postby Cristián Lávaque » September 26th, 2011, 1:20 am

Hi Rob. You may want to use the get_userdata function for that. http://codex.wordpress.org/Function_Ref ... t_userdata
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 5 guests

cron