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! Show profile field groups according to s2 membership?

s2Member Plugin. A Membership plugin for WordPress®.

Help! Show profile field groups according to s2 membership?

Postby candy » May 13th, 2011, 5:27 am

Hi,

Anyone please help!
I am using s2 with buddypress, and in the user profile (profile loop?) I need to show certain profile fields depending on membership level.

As you know buddypress offers those extended profile fields which we can organize in groups (those profile_group_id) - like basic user information goes to Group 1, Extended user information to Group 2, etc.

What I need to do is when a registered user browses the profiles of others users, in the other user's profile he should see the following:

if logged in user has s2_level0, when he looks at the profile of an other user he should only see that user's information contained in Group 1 (so only the basic information)

if the logged in user has s2_level1 than, when looking in other user's profiles he should see the profile information contained in Group1 & Group 2

and if for ex the logged in user has s2_level2 he should be able to see the full information in the profiles of the other users (so let's say all 5 definded field groups with their respective fields).

Could you guys please help me with this?

Thanks in advance
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Help! Show profile field groups according to s2 membersh

Postby Cristián Lávaque » May 13th, 2011, 8:59 am

Well, this is certainly custom...

You could try using s2Member's advanced conditionals to control what to show. WP Admin -> s2Member -> API / Scripting -> Advanced Conditionals and Advanced Query Conditionals
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

Re: Help! Show profile field groups according to s2 membersh

Postby candy » May 13th, 2011, 9:47 am

Hi Christian,

hmm ... I don't think I'll manage that :-(

Can you help me write the conditional please? I do not know the functions, and can't really write code either :-(

smth like

if s2member=level0 show buddypress profile_group_id = 1,2,3
else if s2member=level1 show buddypres profile_group_id=1,2,3,6,7
else profile_group_id =1,2,3,4,5,6,7

??!?

(not even sure how to write that profile_group_id = 1,2,3 to make it get all the groups that I need together)

The trick is also that it must only apply to "others'" profiles, not on his own ...

Help highly appreciated!

Thank you!
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Help! Show profile field groups according to s2 membersh

Postby Cristián Lávaque » May 13th, 2011, 11:31 am

I see, then my best suggestion would be that you get help from a freelance developer to create that. http://jobs.wordpress.net
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

Re: Help! Show profile field groups according to s2 membersh

Postby candy » May 13th, 2011, 8:27 pm

Getting closer ..cracked some stuff already but still stuck with this though ...

Any idea how I can identify myself in the profile-loop.php as "the current user" ? I need to differenciate between my own profile and "profile of others"

something like this myabe
<?php if ( bp_has_profile() )&& (I am the current user) ) : ?>

so the difference between <?php if ( bp_has_profile() ) ) : ?> and <?php if ( bp_has_profile() )&& (I am the current user logged in here) ) : ?> should be that in the second case it applies to me personally (so I can see all details about myself but other users cant see all that I can see)

I think that could solve my issue :-)
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Help! Show profile field groups according to s2 membersh

Postby Cristián Lávaque » May 13th, 2011, 9:54 pm

I honestly don't know BuddyPress to answer that off the top of my head. :|

You're doing good, keep at it, I'm sure you'll find it soon. ;)
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

Re: Help! Show profile field groups according to s2 membersh

Postby candy » May 14th, 2011, 10:31 am

well, I really don't know what's going on here ...

All guys I asked so far told me this is a complicated thing to do and I need a buddypress/wordpress developer to do the job ... and the ones I happened to ask about the job said they need something like a month to the get it done

Still ... with almost zero programming knowledge I manage to get this done in one day ...

It's either that something is really wrong with the wide world, or I am a genius ... :ugeek:

But I'd definitely not go for the second one ...

For the curious guys out there, getting the current user (myself) in the profile-loop (and I guess elsewhere as well) can be achieved by using:

bp_is_my_profile()
User avatar
candy
Registered User
Registered User
 
Posts: 102
Joined: November 16, 2010

Re: Help! Show profile field groups according to s2 membersh

Postby Cristián Lávaque » May 14th, 2011, 11:32 am

Very well done, Candy! :D
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: Bing [Bot], Google [Bot] and 0 guests

cron