Page 1 of 1

Account details and upgrade in BuddyPress

PostPosted: March 28th, 2011, 3:29 pm
by scottgould
Hi

Second question - is there a plugin or function that someone has written that enables a user to see their own membership level, days left in cycle, purchase amount, etc, within the Buddypress profile section?

I am otherwise about to get around to writing it but wanted to check first.

Thanks all,
Scott

Re: Account details and upgrade in BuddyPress

PostPosted: March 28th, 2011, 6:29 pm
by Cristián Lávaque
I don't know about someone that has yet.

You may want to check the section WP Admin -> s2Member -> API / Scripting, particularly the sections Advanced Query Conditionals and s2Member PHP/API Constants may be helpful. Further details and additional functions can be found inside /s2member/includes/functions/api-functions.inc.php.

Let us know if there's anything we can help you with. :)

Re: Account details and upgrade in BuddyPress

PostPosted: March 28th, 2011, 6:41 pm
by scottgould
Ok, thanks Cristián. I'm familiar with Wordpress but not BuddyPress, so I have to get my head around the specific hooks.

Re: Account details and upgrade in BuddyPress

PostPosted: March 31st, 2011, 4:31 am
by Jason Caldwell
Hi Scott. Try running this test code so you can see the information that's available in your installation.

Code: Select all
<?php
$user_id 
= "123";
$user = new WP_User($user_id);
print_r($user);
?>
This will provide you with an array of all user data, including all meta fields, and all s2Member data as well.

Other related articles:
http://codex.wordpress.org/Function_Ref ... rrent_user
http://codex.wordpress.org/get_currentuserinfo
http://codex.wordpress.org/Function_Ref ... t_userdata

Re: Account details and upgrade in BuddyPress

PostPosted: March 31st, 2011, 2:21 pm
by scottgould
Thanks Jason.

This is a *seriously* impress plugin. if you know Wordpress well, you can really do some cool stuff.

Thank you!

Scott

Re: Account details and upgrade in BuddyPress

PostPosted: March 31st, 2011, 6:04 pm
by Cristián Lávaque
I totally agree with you, Scott. :)