Page 1 of 1

Different Membership Option pages?

PostPosted: April 16th, 2011, 6:30 pm
by cassel
I tried to follow the threa by cdavignon, and maybe i am just much less experienced but despite some helpful reply to the requests, i cannot clearly follow so i will have to ask the question going back way before.

I am looking at the Custom Capability Packages. The video was quite helpful, although when the coding is mentioned, that is a stretch for my brain (not familiar with coding in php at all). In the video, it gave this kind of coding (sorry, i dont know how to put it in a box):

Code: Select all
         if(has_tag("music") && !current_user_can ("access_s2member_ccap_music"))
             {
                    
header ("location: ".S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL);
                    exit ();
             } 


From there, i have 2 questions:
1- is the "S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL" a standard variable or something based on the actual site structure?

2- if i have a custom package that requires a free registration, but a different package requiring a different "payment", how can i direct the viewer to a different "membership option" page? Maybe one could say "oops, you need to be a registered member to access this content; registration is free. Please click here to register", but another one could say "To view the tutorials, you can purchase a membership at the price of..." and have a paypal button there, for example. How would i do that? (please, consider me VERY newbie)

Re: Different Membership Option pages?

PostPosted: April 16th, 2011, 6:44 pm
by Cristián Lávaque
Hi Cassel. :)

I fixed your code so it's inside code tags. You can read how it's done here viewtopic.php?f=36&t=2780.

S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL is what's called a constant in PHP. Unlike variables, which have their value vary, constants have their value constant after being defined. In this case it's the page you choose for the Membership Options Page at WP Admin -> s2Member -> General Options -> Membership Options Page.

Yes, you can show different things depending on why they were sent to that page. For that you'd use the variables available for it and you can read about them here WP Admin -> s2Member -> API / Scripting -> Membership Options Page / Variables.

Re: Different Membership Option pages?

PostPosted: April 16th, 2011, 6:51 pm
by cassel
Thanks. Out to read.
I"ll be back when i have more questions! (i probably WILL)

Re: Different Membership Option pages?

PostPosted: April 16th, 2011, 6:54 pm
by Cristián Lávaque
Good. :)

Re: Different Membership Option pages?

PostPosted: April 17th, 2011, 6:28 am
by cassel
I knew i would be back, didn't i say so? Trying to understand your replies, i am probably more newbie than expected because some things are still unclear, so be patient with me :)

- when you state that S2MEMBER_MEMBERSHIP_OPTIONS_PAGE_URL is a constant, does that mean it would be written exactly the same whether it is for my site or my neighbour's site? Is it something that is typed the same no matter what? If not, and if it changes from site to site, but to stay constant once it is set, how is it set initially? (told you i need VERY basic!)

- now trying to read (and hopefully understand) the WP Admin -> s2Member -> API / Scripting -> Membership Options Page / Variables it SEEMS to me that it will give only a one sentence message to the user whether they are supposed to be logged in, or have a specific level, or custom packaged purchased, but i was thinking of more of a different page for each scenario (like if the viewer should be registered, have also a list of the benefits of registration). Maybe i am making things too complicated though, but in all the examples, i didn't see how to redirect to a specific page (that i can hide otherwise) and if it refers to a constant like the previous question, how to set it?

Re: Different Membership Option pages?

PostPosted: April 17th, 2011, 1:02 pm
by Cristián Lávaque
No problem. :)

About the constant, you don't need to worry about it.

Regarding changing the message shown to the person depending on what he tried to view, you'd use the MOP Variables I mentioned earlier. You'll see that they're passed (the variables) in the URL when the person is redirected to the Membership Options Page (MOP).

With these variables now available in the MOP page, you can create conditionals to decide what message you show. Since this is advanced for you, it may be best that you get help. There are freelance developers familiar with WordPress that should be able to set this up the way you want it in little time. viewforum.php?f=37 :)

Re: Different Membership Option pages?

PostPosted: April 17th, 2011, 1:18 pm
by cassel
I guess you are right. I just posted a job where you suggested. Thanks for directing me there.

Re: Different Membership Option pages?

PostPosted: April 17th, 2011, 2:48 pm
by Cristián Lávaque
I'm happy I could help. Let me know when you have new questions. :)