Community Support Forums — WordPress® ( Users Helping Users ) — 2010-10-29T13:40:57-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=1110 2010-10-29T13:40:57-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4397#p4397 <![CDATA[Re: Dripping By Member Level]]>

In other words, the "custom" value is always updated to the one reflected by the PayPal Button that a Customer uses to initiate a new Subscription, and/or a Subscription Modification.

That is why I suggest reserving the next four spaces for CV1,2,3 & 4, then they will be in the correct position each time PayPal returns the IPN, no matter which level they are in, and the explode routine will allow me to determine what the timestamp is for each level, equal to or less than the current level.

The model I would use is that instead of merely reserving the first position for the domain name as you have, I would reserve five and use them as described below (See post viewtopic.php?f=4&t=1110#p4320 for the "if-then" routine used to evaluate the timestamps).
Code:
$custom = get_user_option("s2member_custom");
list($domain, $timestamp1, $timestamp2, $timestamp3, $timestamp4) = preg_split("/\|/", $custom);

If a timestamp slot is empty, then there has been no enrollment at that level and there is nothing to age at that level. And, as you say, I am left with an unlimited number of positions (after those first five). By reserving the first five positions for the domain and four timestamps, I have a standard model that will not be broken by PayPal, only by me if I fail to follow that model.

That help clarify any? Think it will work?

Statistics: Posted by KirkWard — October 29th, 2010, 1:40 pm


]]>
2010-10-29T07:13:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4391#p4391 <![CDATA[Re: Dripping By Member Level]]>
I missed reading about the meta boxes. Combining those with the script example you gave looks like something I can understand. I don't understand what hooks are and am lost when it comes to using filters, so that script may be the way to go.

Thanks again.

Statistics: Posted by KirkWard — October 29th, 2010, 7:13 am


]]>
2010-10-29T03:12:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4388#p4388 <![CDATA[Re: Dripping By Member Level]]>

What I am concerned about is keeping each lower level on the product release schedule it was already on when a member upgrades to a new level.
Gotchya. I think this might be a better way to deal with this: viewtopic.php?f=4&t=1091#p4382


$level = ws_plugin__s2member_user_access_level();
echo $level; // Is this the current level only?

Yes, that is a representation of the current Membership Access Level. This will always be an integer. Possible values include: -1 through positive 4. -1 if not logged in. 0 if logged in as a Free Subscriber.


That way, if I set a script to release content every thirty days of a membership, a user will not revert to the first issue when they start a new level. I created a CV pipe for each button in a standard layout to do that.

I'm not sure I understand completely, but I should warn you that the "custom" field is modified by s2Member's IPN processor after a successful Subscription Modification. In other words, the "custom" value is always updated to the one reflected by the PayPal Button that a Customer uses to initiate a new Subscription, and/or a Subscription Modification. So this might not work in your case.

As stated above, I think you'll have better luck handling it this way:
viewtopic.php?f=4&t=1091#p4382

Otherwise, another possibility is for you to maintain your own internal user fields by Hooking into s2Member's IPN processing routines. There are MANY Hooks/Filters available through s2Member's IPN processing routines, inside this file: /s2member/includes/functions/separates/paypal-notify.inc.php

Statistics: Posted by Jason Caldwell — October 29th, 2010, 3:12 am


]]>
2010-10-28T10:44:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4359#p4359 <![CDATA[Re: Dripping By Member Level]]>
Thanks for the review and feedback, but I am wondering if you missed what I was trying to do.

What I am concerned about is keeping each lower level on the product release schedule it was already on when a member upgrades to a new level. By reserving the first 4 CVs after the URL as individual timestamps for each level, I can maintain track of the enrollment period at each level.

That way, if I set a script to release content every thirty days of a membership, a user will not revert to the first issue when they start a new level. I created a CV pipe for each button in a standard layout to do that.

In another thread, you stated that s2 did not have a way to keep track of each level independently. That is why I created a different different button for each level, as I don't see that your code provides a place to record the start date for each level.

That is why I have ...
%cv1% = start date for level 1
%cv2% = start date for level 2
%cv3% = start date for level 3
%cv4% = start date for level 4

and, why I think the php to extract this information would more likely be ...
Code:
$custom = get_user_option("s2member_custom");
list($domain, $timestamp1, $timestamp2, $timestamp3, $timestamp4) = preg_split("/\|/", $custom);
$level = ws_plugin__s2member_user_access_level();
echo $timestamp1;
echo $timestamp2;
echo $timestamp3;
echo $timestamp4;
echo $level;      // Is this the current level only?

Statistics: Posted by KirkWard — October 28th, 2010, 10:44 am


]]>
2010-10-27T23:52:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4351#p4351 <![CDATA[Re: Dripping By Member Level]]> Hi Kirk. Thanks for the great question. I don't really see anything wrong with this, except to say it appears to be a little convoluted to me. Here's how I might go about this; and I would try to keep your pipe delimited list of "custom" variables to a standard that is easy to follow ~ leaving plenty of room for you to get more elaborate in the future, in case you need to add something else.

Code:
[s2Member-PayPal-Button ... custom="www.example.com|<?php echo time(); ?>" /]
You will need the Exec-PHP plugin installed for this to work inside a Post or Page.

Code:
$custom = get_user_option("s2member_custom");
list(
$domain, $timestamp) = preg_split("/\|/", $custom);
$level = ws_plugin__s2member_user_access_level();
echo $timestamp; // A Unix timestamp.
echo $level; // Numeric Level number.          
* Note the use of `ws_plugin__s2member_user_access_level()`, which is built into the s2Member plugin; so you don't need to use a custom variable for that part.

Statistics: Posted by Jason Caldwell — October 27th, 2010, 11:52 pm


]]>
2010-10-27T16:06:25-05:00 http://www.primothemes.com/forums/viewtopic.php?t=1110&p=4320#p4320 <![CDATA[Dripping By Member Level]]> viewtopic.php?f=4&t=602#p2620 led me to wondering if his solution could be used to solve the problem of tracking multiple levels of "drip" content.

First caveat, I am NOT a coder, I just copy and paste, and pjay with ideas I get from those who can. To wit, I came up with the following thoughts,, and am wondering if this can be used to create and store the variables needed to track multiple levels of "drip" content. Please let me know if it is on the right track, and if you iz a coder, please help with a finished product.
Putting the information into Wordpress ...

Level 1 Button

Code:
[s2Member-PayPal-Button ... custom="www.example.com|TIMESTAMP|%cv2%|%cv3%|%cv4%" /]


Level 2 Button

Code:
[s2Member-PayPal-Button ... custom="www.example.com|%cv1%|TIMESTAMP|%cv3%|%cv4%" /]


Level 3 Button

Code:
[s2Member-PayPal-Button ... custom="www.example.com|%cv1%|%cv2%|TIMESTAMP|%cv4%" /]


Level 4 Button

Code:
[s2Member-PayPal-Button ... custom="www.example.com|%cv1%|%cv2%|%cv3%|TIMESTAMP" /]



Getting the information from Wordpress ...

Code:
$custom = get_user_option("s2member_custom");
list($domain, $timestamp1, $timestamp2, $timestamp3, $timestamp4) = preg_split("/\|/", $custom);

if (($timestamp4 == "") && ($timestamp3 == "") && ($timestamp2 == ""))
     { echo $timestamp1;}

   elseif (($timestamp4 == "") && ($timestamp3 == ""))
     { echo $timestamp1;
       echo $timestamp2;}

   elseif ($timestamp4 == "")
     { echo $timestamp1;
       echo $timestamp2;
       echo $timestamp3;}

   else
     { echo $timestamp1;
       echo $timestamp2;
       echo $timestamp3;
       echo $timestamp4;}

Statistics: Posted by KirkWard — October 27th, 2010, 4:06 pm


]]>