Page 1 of 1

Can Access Levels be set via script? (ie., without payments)

PostPosted: February 8th, 2011, 6:57 pm
by dougR
I have a need to use s2member in a "non-monetary" mode, meaning that I want to use the convenient access level controls of 0, 1, 2, 3, and 4, but do not want to require any form of payment/monetary transaction for a user to achieve a certain access level. Instead, I want access to be set based on their entry of an invitation code that I would provide select users (clients that we are engaged with thru other channels, who we would allow to receive premium content as a perk). This invitation code could be entered by the user at registration or later by entering it into a special invitation code field in their profile, for example. I envision creating a script that checks for invitation codes in their profile field, and then sets the official s2member access level accordingly (there would be one or more unique codes per level). Then, they would have access to all content set for that level, and all lower levels, just as s2member is intended to work. The problem is, I have found no mention of being able to set the access levels for a user through php scripts (without the need for a paypal or some other payment transaction).

Can this be done? There would seem to be a need for this by people like me, but I'm amazed that I've found no one asking this... Again, I am not so concerned about how to set up/check invitation code entries ( I know that can be done via existing features and scripts), but rather how can I set a user to a certain access level directly via PHP?

Thanks in advance for any insights...

Doug

Re: Can Access Levels be set via script? (ie., without payme

PostPosted: February 15th, 2011, 9:04 pm
by stowe39
Setting up free registrations with different levels is detailed in the thread http://www.primothemes.com/forums/viewtopic.php?f=4&t=934 (the second post shows how to implement it.)

Perhaps you could email them a direct link that enabled them to get the membership level you want them to have.... sure they could forward on the email and let other ppl sign up too, but they could do that with a code as well.

Cheers

Kym

Re: Can Access Levels be set via script? (ie., without payme

PostPosted: February 17th, 2011, 1:13 pm
by dougR
Kym,

Many thanks for pointing out that post. My prior searches had been focused on "access level" and somehow that post didn't come to my attention. I think that link-based approach could be a viable workaround method for me if I can find no other way.

I am still holding out hope that s2member provides some sort of hook to allow direct "setting" of access level via my own scripted logic, as that would open up so many more customization possibilities, like my invitation code concept. It's almost as if this is not supported by design, as some sort of access level integrity/protection philosophy... Aside from that reasoning, it seems like it would be such an obvious feature to want to provide, given that the value of the plugin is centered on use of these access levels.

- Doug

Re: Can Access Levels be set via script? (ie., without payme

PostPosted: February 17th, 2011, 6:14 pm
by stowe39
Hi Doug

S2Member Pro supports coupon codes.... among the other extra capabilities.

I'm not sure if it will do what you want because I only have the free version.

*****Huge disclaimer - the ideas below this line are only a theory - and are dependent on your own coding ability/time/persistence******

you may be able to code a form that allows a member to enter a code that would triger the upgrade of their membership level.

From my understanding, the info in the forum post I linked to earlier is the equivalent to the $link that would come back from paypal after someone has purchased a subrcription (and it's encrypted which makes it a bit harder to debug)

So if you had a "please enter your code here" type form that checked the code was valid and returned the $link, it should upgrade your member's level.

**********

Of course - if the Pro version can do what you want, it would be a lot easier and quicker to buy it, instead of swearing at code :)

Cheers

Kym

Re: Can Access Levels be set via script? (ie., without payme

PostPosted: February 17th, 2011, 6:32 pm
by dougR
Kym,

Your form theory sounds interesting... I'll have to look into that.. thanks!

I did read a bit about coupon codes... as I recall, they don't quite fit the bill because they only work by reducing a paypal amount by x, but the remaining amount owed still has to be more than 0, I think.