The object
$bp->displayed_user contains the data for the user whose profile is being displayed (see
http://codex.buddypress.org/developer-docs/the-bp-global/). So if you want to get, say, the user ID, you can use the function
bp_displayed_user_id().
Then you could use something like this:
- Code: Select all
<?php
$id = bp_displayed_user_id();
$user = new WP_User( $id );
if ( $user->has_cap( 's2member_level4') ) :
$membership = 'Platinum';
elseif ( $user->has_cap( 's2member_level3') ) :
$membership = 'Gold';
And so on, until you've listed all your membership levels and their corresponding names. Then you'd round up with something like this:
- Code: Select all
else :
$membership = 'Free Membership';
endif ?>
Then you could add a div to display the info:
- Code: Select all
<div class="membership-info">
Current membership level: <?php echo $membership ?>
</div>
There's probably a better way of doing this, but this works!