Page 1 of 1

Custom Capability Subscription?, Thanks!

PostPosted: March 22nd, 2011, 9:53 pm
by egleiser
I think I have this down as far as a work around goes but I have a few questions as well. Tell me if I'm wrong :P

On my site, We would like to have a journal and video modules that can be purchased.
In order to purchase the video modules I would like to have users at the Free Subscriber level.

To do this we would protect the page with with the modules to Free Subscriber or higher.
This would redirect to the "membership options" page. Correct?
On this page I would have links to purchase lvl. 1 access to the journal or create a lvl. 0 account.

One thing I really love about s2member is the ability to embed a user's profile settings with the short code "[s2Member-Profile /]" and do other stuff with the API
This allows for a more integrated user experience than giving users access to an user admin panel and makes additional variables easy to implement.
However, correct me if I'm wrong, but Specific Page/Post access is completely unrelated to any membership option or even a user account in my wordpress installation.
It uses IP address tracking from the computer that accessed the link from the email that was sent.
This email is sent from the email address used to checkout, yes?
Once s2member sees this IP address, it will keep track of it and "x" number of other devices that accessed the link.

The question I have: Is it is possible to link the page access to a user's account rather than an IP address?
Many people these days have multiple computers, smart phones, iPads, netbooks, high speed connections with changing IP addresses, crazy airport/school/work/cafe proxies etc. and I'm worried that the IP list could become filled pretty quickly and interrupt their service.
Also, I would like to display modules that have been purchased on a users "Login Welcome Page" as well as what their subscription status is. Could that be done?

To display the subscription status I would use the following code:

[s2If current_user_is(s2member_level1)]

Welcome [s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]!
Click <this would be a link> to go to the journal.

[/s2If]

But the only way I can think of to sell modules and display them on a page would be to use Scripting. <?I'm not afraid of php>
I don't see a command that links Specific Access to users login/membership status.

Is it possible to sell just Custom Capabilities after a user is logged in?
Example:
A user creates a free account.
Then decides he would like to buy a video module but not purchase a subscription.
Is it possible to create a PayPal button that simply adds adds a custom capability to a users current account?

I think I would use modify="2" and ccaps="vidmod1,vidmod2" together in a button.
Some how (If you could help me on this it would be great^^)

I also need the module to expire after 3 months. Would this be done with button shortcodes to have a Custom Capability that expires?

To boil it all down…
How could I sell a Custom Capability to a current member without affecting their current membership level and so the Custom Capability also expires separate from their membership level?

Thanks A Million!
-E

P.S. is it also possible to alert a user if the module is expiring soon? Or a subscription level?
Please pardon my spelling :P

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 1:50 am
by Cristián Lávaque
Hi! It's great to know that you're liking the plugin. :)

I'll answer your questions the best I can, and ask Jason about the rest.

egleiser wrote:e page with with the modules to Free Subscriber or higher.
This would redirect to the "membership options" page. Correct?
On this page I would have links to purchase lvl. 1 access to the journal or create a lvl. 0 account.

The page set to Level 0, would send the person to the membership options if he's not logged in. If the page is set to Level 1, it would do it with someone not logged in, or logged in with a free (Level 0) account. In the Membership Options Page you can show both purchasing options, or just the ones he's missing if you use the variables available WP Admin -> s2Member -> API / Scripting -> Membership Options Page / Variables.

egleiser wrote:Also, I would like to display modules that have been purchased on a users "Login Welcome Page" as well as what their subscription status is. Could that be done?

Yes. I suggest you look at the Advance Query Conditionals available WP Admin -> s2Member -> API / Scripting -> Advanced Query Conditionals. Further details and additional functions can be found inside: /s2member/includes/functions/api-functions.inc.php

egleiser wrote:Is it possible to sell just Custom Capabilities after a user is logged in?
Example:
A user creates a free account.
Then decides he would like to buy a video module but not purchase a subscription.
Is it possible to create a PayPal button that simply adds adds a custom capability to a users current account?

You can manage all access using custom capabilities, it's very flexible. Yes, you can use them with Level 0 accounts too, but when you edit their profile manually, not sure if buttons will require a Level 1. When you generate the button, you specify the EOT for what you sell with it. Check out these:
WP Admin -> s2Member -> API / Scripting -> Custom Capabilities (Packages)
http://www.s2member.com/custom-capabilities-video/

egleiser wrote:P.S. is it also possible to alert a user if the module is expiring soon? Or a subscription level?

Not yet with s2Member, but you could create a cron job that checks the EOT of each user and alert them ahead of time. What I'd prefer doing, though, is tie s2Member to a list server and have one or more email messages sent to the member before expiration; check out WP Admin -> s2Member -> API / List Servers.

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 2:21 am
by Jason Caldwell
Thanks for the excellent questions.
~ and thank you for bringing this to my attention Cristián.


Let me start here.
To boil it all down…
How could I sell a Custom Capability to a current member without affecting their current membership level and so the Custom Capability also expires separate from their membership level?

Yes. Starting with s2Member v3.5+, it is now possible to sell additional Custom Capabilities, without affecting any Custom Capabilities that the Member may already have.

Taken from: Dashboard -> s2Member -> API Scripting -> Custom Capability ( Packages )
*New* By default, a Checkout Button or Form generated by s2Member is designed to set and/or reset a Member's Custom Capabilities to the ones you specify in the Button/Form Code. However, starting with s2Member v3.5+, you can tell s2Member to (ADD) additional Custom Capabilities to any that already exist for a particular Member. This is accomplished on a per Form/Button basis by preceding your comma-delimited list of Custom Capabilities with a (+) sign. For further details on this topic, click the [?] icon next to the Custom Capabilities field in any Button/Form Generator supplied by s2Member.

Now, if you want to take this a step further, and be sure that you're not changing the Membership Level either; you might do something like this ( i.e. pull their existing Level dynamically ).
Code: Select all
[s2Member-PayPal-Button ... ccaps="+music,videos" level="<?php echo c_ws_plugin__s2member_user_access::user_access_level(); ?>" modify="2" /]
* This Shortcode is abbreviated for clarity.

All of this being said, this technique is NOT the same as selling a Customer something extra without it affecting their paid Subscription. That is, even when you sell them additional Custom Capabilities ( i.e. use the + sign ), this DOES affect their paid Subscription terms/pricing. So it's best to use this technique in conjunction with a Subscription Modification Button or Modification Form ( via s2Member Pro ).

If your intention is to sell "Buy Now" products/services as "extras" to an existing Customer, without that purchase affecting their paid Subscription in any way. Then you'll need to go with Specific Post/Page Access for this. And yes, your assumption is correct, "Buy Now" transactions associated with Specific Post/Page Access are not tied to a Customer's Membership account in any way. We're working to make this possible in a future release. That is, we'd like to give site owners a way to list all "Buy Now" purchases that Members make through Specific Post/Page Access, but this is NOT possible yet. A developer could certainly help you integrate this though, if it's really important to you. It could be accomplished through Hooks made available by s2Member inside /s2member/includes/classes/paypal-notify-in.inc.php.

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 2:26 am
by Jason Caldwell
I also need the module to expire after 3 months. Would this be done with button shortcodes to have a Custom Capability that expires?

No, this is not possible yet. By default, all Custom Capabilities expire along with the paid Subscription that they are tied to. I've seen site owners do this through a CRON job though, making changes dynamically based on the API functions provided by s2Member for dates of purchase.

Taken from: Dashboard -> s2Member -> API Scripting -> Content Dripping.
Code: Select all
<?php
$time 
= s2member_registration_time (); // ... first registration time ( free or otherwise ).
$time = s2member_paid_registration_time (); // ... first "paid" registration and/or upgrade time.
$time = s2member_paid_registration_time ("level1"); // ... first "paid" registration or upgrade time at Level#1.
$time = s2member_paid_registration_time ("level2"); // ... first "paid" registration or upgrade time at Level#2.
$time = s2member_paid_registration_time ("level3"); // ... first "paid" registration or upgrade time at Level#3.
$time = s2member_paid_registration_time ("level4"); // ... first "paid" registration or upgrade time at Level#4.
?>

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 2:32 am
by Jason Caldwell
The question I have: Is it is possible to link the page access to a user's account rather than an IP address? Many people these days have multiple computers, smart phones, iPads, netbooks, high speed connections with changing IP addresses, crazy airport/school/work/cafe proxies etc. and I'm worried that the IP list could become filled pretty quickly and interrupt their service.

s2Member has gotten so complex in this regard that I've just gotten in the habit of trying to keep things simple/easy to understand, but I realize that's not always the best way to handle things. OK. So let me clarify this, so you can understand how things actually work behind the scene.

All features of s2Member are protected with s2Member's Unique IP Restrictions; with one exception, and that is for Advanced File Download Keys. Download Keys are tied to ONE specific IP address, and this works fine, because Download Keys are generated dynamically within the content of a page that a Customer is viewing. So not much of a problem with dynamic IP addresses here; as the key will change when a secure page is loaded; based on the IP of the Customer.

For everything else, s2Member's Unique IP Restrictions are used as the basis for determining how many unique IPs are actually allowed to view any single point of entry. So when we talk about things being tied to a particular IP Address, what we really mean is that it's tied to the Unique IP Restrictions configured by the site owner. In other words, in the case of Specific Post/Page Access, a link is only valid for a specific number of IP addresses accessing that one point of entry.

So let me break this down so you can see how s2Member works internally:
  • Customer pays for Post ID# 121.
  • s2Member generates a Specific Post/Page Access Link for them, taking them to Post ID #121; and also emails this link.
  • The first time a Customer hits this link, s2Member records 1 unique IP address that has gained access through that specific link.
  • The next time a Customer hits this link, if their IP is different, s2Member will record 2 unique IP addresses having gained access through that specific link.
If enough unique IPs gain access through this one single entry point they were given access to ( i.e. they've shared their link! ), then s2Member's security protection kicks in and locks everyone out of this link. This behavior can be configured under: s2Member -> General Options -> Unique IP Restrictions.

So this prevents a Customer from spreading their link, or blogging it, and then everyone getting in. However, it still leaves room for a Customer to have multiple IPs they access the system from ( possibly from a laptop at work, and then a home computer on a different IP ). Or, possibly a Customer on a network with dynamic IP assignment.

The site owner can also gain control over this by re-configuring the default settings that s2Member uses for Unique IP Restrictions. In rare cases, s2Member's Unique IP Restrictions can also be disabled completely, by choosing "unlimited" from the drop-down menu in that configuration panel.

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 9:19 am
by egleiser
That You so much Jason and Cristián. I truly appreciate it :)
The support that you two have shown here really shows how wonderful the staff at primothemes are.

I will talk to my client about the options and see if I should use CRON with the s2member functions or expiring links.

But just one more question.

Is it possible to send in the confirmation email the expiration date of the link?
Again, Thank You
Best Wishes,
E

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 4:29 pm
by Jason Caldwell
You're very welcome.
~ thanks for the kudos!

Yes, it is possible to include this information in the Confirmation Email after checkout if you like. Please check your Dashboard under: s2Member -> PayPal Options -> Specific Post/Page Email Confirmation. You can use this Replacement Code in your email: %%sp_access_exp%%

%%sp_access_exp%% = Human readable expiration for %%sp_access_url%%.
Ex: ( link expires in %%sp_access_exp%% ).

You can also use these special Replacement Codes if you need them:

* %%sp_access_url%% = The full URL ( generated by s2Member ) where the Customer can gain access.
* %%sp_access_exp%% = Human readable expiration for %%sp_access_url%%. Ex: ( link expires in %%sp_access_exp%% ).
* %%txn_id%% = The PayPal® Transaction ID. PayPal® assigns a unique identifier for every purchase.
* %%amount%% = The full Amount that you charged for Specific Post/Page Access. This value will always be > 0.
* %%first_name%% = The First Name of the Customer who purchased Specific Post/Page Access.
* %%last_name%% = The Last Name of the Customer who purchased Specific Post/Page Access.
* %%full_name%% = The Full Name ( First & Last ) of the Customer who purchased Specific Post/Page Access.
* %%payer_email%% = The Email Address of the Customer who purchased Specific Post/Page Access.
* %%item_number%% = The Item Number. Ex: sp:13,24,36:72 ( translates to: sp:comma-delimited IDs:expiration hours ).
* %%item_name%% = The Item Name ( as provided by the desc="" attribute in your Shortcode, which briefly describes the Item Number ).

Custom Replacement Codes can also be inserted using these instructions:

* %%cv0%% = The domain of your site, which is passed through the `custom` attribute in your Shortcode.
* %%cv1%% = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: custom="localhost|cv1|cv2|cv3". You can have an unlimited number of custom variables that track IP addresses, affiliate IDs, etc. In some cases you may need to use PHP code to insert a value into the custom field dynamically. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.

This example uses cv1 to track a User's IP address:
( The IP address could be referenced using %%cv1%% )
custom="localhost|<?php echo $_SERVER["REMOTE_ADDR"]; ?>"

Re: Custom Capability Subscription?, Thanks!

PostPosted: March 23rd, 2011, 9:48 pm
by egleiser
Haha Thanks,
I missed that short code in the documentation :P
Have an nice day,
E