latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Changing field visibility automatically

Home Forums Community Forum Changing field visibility automatically

This topic contains 6 replies, has 2 voices. Last updated by  Steven John Robson 3 years, 2 months ago.

Topic Author Topic
Posted: Monday Nov 4th, 2013 at 5:12 am #60828

I’m creating a site that is primarily about the information shown on the users’ profiles.

The profile will have a lot of different information on it which will show while they’re level 1 members.

If they stop paying I want most of the information to be hidden.

I was working on with:

[s2If current_user_can(access_s2member_level1)]
show information here.
[/s2If]

But then I realised that only works for anyone signed in. I want this to work for the general public.

Hope I’ve explained this properly!

List Of Topic Replies

Viewing 6 replies - 1 through 6 (of 6 total)
Author Replies
Author Replies
Posted: Monday Nov 4th, 2013 at 9:38 am #60832
cassel
Username: cassel

For a condition to work, whether it is for a level or a ccap (custom capability), the system has to have a way to know who is looking for the specific information, and there is no way for the system to know without the member to be logged in.

You might want to have something like this:

[s2If !is_user_logged_in()]
 If you are looking for your particular account information, please, log in.
 (you can also post some content here that can be accessible by anyone, like the general public)
 [/s2If] 

[s2If current_user_can(access_s2member_level1)]
 show information here.
 [/s2If] 

If this does not address the issue you are having, could you explain what kind of information you would want the general public to see?

Posted: Monday Nov 4th, 2013 at 9:44 am #60834

Thanks for trying Cassel but it’s not exactly what I need.

I think I know how to go about it, but it’s doing it right that’s the problem. The user can change the field visibility if the admin lets them, so it’s either let admin see, public or logged in users.

I’m thinking there must be a way for the system to know that if the editor is not on level 1 anymore to automatically change the field visibility to admin in only?

The idea is the user is signing up for a profile which will be hosted for as long as it’s paid for, but as soon as it’s not it’ll only show minimal information ie first name, last name, date of birth etc.

does that help?

Posted: Monday Nov 4th, 2013 at 9:55 am #60838
cassel
Username: cassel

Ok, maybe something like this would work?

[s2If !is_user_logged_in()]
 If you are looking for your particular account information, please, log in.
 [/s2If] 

[s2If is_user_logged_in() AND !current_user_can(access_s2member_level1)]
post the basic information accessible to anyone LOGGED IN, but without the proper access for paying members
 [/s2If] 
[s2If current_user_can(access_s2member_level1)]
post the rest  of the information for paying member.
 [/s2If]
Posted: Monday Nov 4th, 2013 at 10:01 am #60840

Unfortunately not, because it still involves having to login to see the data.

Let’s see if I can put it more clearly;

Lets say I want to view your profile to see your CV online, and you’re paying me to keep it up. As long as you’re paying, me, you and anyone else can see your CV online (even if not logged in.)

Now, you get a job, and decide to stop paying me to host your CV online, so I then take your CV offline, except I still leave your name and address online for people to find.

That’s kind of what I’m after, so I need the system to recognise that you’ve stopped paying and to change the visibility depending on your subscription level.

Posted: Monday Nov 4th, 2013 at 10:15 am #60841
cassel
Username: cassel

I see. I don’t think that is possible as it is not targeting the “paying client”, but I have been wrong in the past and maybe someone more knowledgeable of the programming under the hood might know of a way to get around it.

Sorry I could not help more.

Posted: Monday Nov 4th, 2013 at 10:16 am #60842

Thank you for trying all the same. I’m in the process of trying to write my own function to use, but I’d feel a lot more confident if I had help with it.

Cheers.

Viewing 6 replies - 1 through 6 (of 6 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.