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™

Displaying Membership Level on profile

s2Member Plugin. A Membership plugin for WordPress®.

Displaying Membership Level on profile

Postby nathardwick » August 8th, 2010, 9:12 am

Hi - I've recently installed the plugin (and pro plugin, too) and I'd like to display the member's membership grade on their profile - is this possible? And how might I achieve this...

Thanks in advance for any help on this,
N
User avatar
nathardwick
Registered User
Registered User
 
Posts: 25
Joined: August 8, 2010

Re: Displaying Membership Level on profile

Postby nathardwick » August 8th, 2010, 9:18 am

I obviously wasn't looking hard enough....! Found it in the docs... for anyone else who might be searching here for it... it's <?php echo S2MEMBER_CURRENT_USER_ACCESS_LABEL; ?>
User avatar
nathardwick
Registered User
Registered User
 
Posts: 25
Joined: August 8, 2010

Re: Displaying Membership Level on profile

Postby nathardwick » August 8th, 2010, 9:32 am

Spoke to soon - that's the current user label (obviously, duh!) but I'm after the displayed users membership grade? Anyone done this?
User avatar
nathardwick
Registered User
Registered User
 
Posts: 25
Joined: August 8, 2010

Re: Displaying Membership Level on profile

Postby nathardwick » August 16th, 2010, 1:09 pm

Anyone done this...?
User avatar
nathardwick
Registered User
Registered User
 
Posts: 25
Joined: August 8, 2010

Re: Displaying Membership Level on profile

Postby Jason Caldwell » August 17th, 2010, 5:14 pm

Hi there. I apologize for the delayed response.

Are you talking about the Membership "Level" ?
Code: Select all
<?php echo S2MEMBER_CURRENT_USER_ACCESS_LEVEL; ?>
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Displaying Membership Level on profile

Postby nathardwick » August 18th, 2010, 4:58 am

Hi all (and Jason)

Again Jason has come through for me - going over and above the usual level of support! Got the answer from him by email - if anyone else needs to add the displayed user level to a profile then use the following php:

Code: Select all
$user = new WP_User( bp_get_displayed_user_username() );
$level = ws_plugin__s2member_user_access_level($user);
$label = constant("S2MEMBER_LEVEL".$level."_LABEL");
echo $label;


Yay!
User avatar
nathardwick
Registered User
Registered User
 
Posts: 25
Joined: August 8, 2010

Re: Displaying Membership Level on profile

Postby Jason Caldwell » August 24th, 2010, 10:57 am

Thanks for posting this. Much appreciated!
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

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

cron