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™

Different Membership Option pages?

s2Member Plugin. A Membership plugin for WordPress®.

Different Membership Option pages?

Postby cassel » April 16th, 2011, 6:30 pm

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)
Last edited by Cristián Lávaque on April 16th, 2011, 6:36 pm, edited 1 time in total.
Reason: Improve code readability. http://www.primothemes.com/forums/viewtopic.php?f=36&t=2780
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: Different Membership Option pages?

Postby Cristián Lávaque » April 16th, 2011, 6:44 pm

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.
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: Different Membership Option pages?

Postby cassel » April 16th, 2011, 6:51 pm

Thanks. Out to read.
I"ll be back when i have more questions! (i probably WILL)
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: Different Membership Option pages?

Postby Cristián Lávaque » April 16th, 2011, 6:54 pm

Good. :)
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: Different Membership Option pages?

Postby cassel » April 17th, 2011, 6:28 am

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?
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: Different Membership Option pages?

Postby Cristián Lávaque » April 17th, 2011, 1:02 pm

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 :)
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: Different Membership Option pages?

Postby cassel » April 17th, 2011, 1:18 pm

I guess you are right. I just posted a job where you suggested. Thanks for directing me there.
User avatar
cassel
Experienced User
Experienced User
 
Posts: 442
Joined: February 17, 2011

Re: Different Membership Option pages?

Postby Cristián Lávaque » April 17th, 2011, 2:48 pm

I'm happy I could help. Let me know when you have new questions. :)
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: No registered users and 1 guest

cron