Page 1 of 1

Hide profile menu items to basic members

PostPosted: July 22nd, 2011, 3:08 am
by johnegg
Hi guys

Again, I cant get over how good this plugin is, and its free! :D

Im using s2member + buddypress. Anyway, I have 2 memberships set up. Both paid but both have a 'media' tab in profile page that can add video & audio. This is only available to premim package but the tab still appears for basic members.

Is it possible to hide the 'media' link in teh profile page sidebar on the basic members profile pages?

Image

Re: Hide profile menu items to basic members

PostPosted: July 22nd, 2011, 2:40 pm
by Cristián Lávaque
I'm very glad you're liking it so much. :)

For that you could try using the advanced conditionals in your template. WP Admin -> s2Member -> API / Scripting -> Advanced/PHP Conditionals and Advanced/PHP Query Conditionals

I hope that helps.

Re: Hide profile menu items to basic members

PostPosted: July 22nd, 2011, 4:19 pm
by johnegg
Thanks again Cristian. Unfortunately I dont know php very well! :(

Re: Hide profile menu items to basic members

PostPosted: July 22nd, 2011, 11:03 pm
by Cristián Lávaque
Oh, that's fine, many don't. You can get a freelance developer from websites like jobs.wordpress.net, oDesk or eLance. :)

Re: Hide profile menu items to basic members

PostPosted: July 23rd, 2011, 1:16 am
by johnegg
Cool, think I have a guy that can do it anyway. Cheers for the support!

Re: Hide profile menu items to basic members

PostPosted: July 25th, 2011, 1:52 pm
by Cristián Lávaque
:)

Re: Hide profile menu items to basic members

PostPosted: July 25th, 2011, 3:04 pm
by johnegg
Got this sorted!

Here is the code the programmer put in to functions.php in case anyone needs it

Code: Select all
/* Place this code in wp-content/plugins/buddypress/bp-themes/buddyboss/functions.php to 
 * remove the 'Media' link from appearing on non-premium profile pages. You can paste it around line 26.
 */

// Remove the 'Media' link from the menu appearing on the left-hand side of the profile page, 
// *if* the profile owner isn't a premium member.

//Load the user associated with the profile we're browsing.
$user_profile = new WP_User$bp->displayed_user->id );

//Check profile owner's access level. This depends on the s2member plugin.
if(!$user_profile->data->wp_capabilities['s2member_level2']){
  unset(
$bp->bp_nav['media']);
}
// END
 

Re: Hide profile menu items to basic members

PostPosted: July 26th, 2011, 2:51 am
by Cristián Lávaque
That's great! And thanks for sharing the solution! :)

Re: Hide profile menu items to basic members

PostPosted: July 26th, 2011, 3:15 am
by johnegg
No problemo!