Community Support Forums — WordPress® ( Users Helping Users ) — 2011-06-14T09:48:00-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=10140 2011-06-14T09:48:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10140&p=20700#p20700 <![CDATA[Re: API: Determine Which Membership Level a Page Is Set To]]>

Statistics: Posted by Cristián Lávaque — June 14th, 2011, 9:48 am


]]>
2011-06-14T08:58:38-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10140&p=20698#p20698 <![CDATA[Re: API: Determine Which Membership Level a Page Is Set To]]>
Aarrgh. You are right! Shows I didn't read the full info:

"When/if the Page IS protected, the return array will include one of these keys ["s2member_(level|sp|ccap)_req"] indicating the Level #..."

Thanks much Cristian. I will try this out. Cheers.

Statistics: Posted by skinnytires — June 14th, 2011, 8:58 am


]]>
2011-06-14T02:37:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10140&p=20682#p20682 <![CDATA[Re: API: Determine Which Membership Level a Page Is Set To]]>

About checking the restriction, why isn't that function enough? Here's the documentation for it viewtopic.php?f=40&t=9015&src_doc_v=110605#src_doc_is_page_protected_by_s2member%28%29

What exactly do you need?

Statistics: Posted by Cristián Lávaque — June 14th, 2011, 2:37 am


]]>
2011-06-13T17:03:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=10140&p=20628#p20628 <![CDATA[API: Determine Which Membership Level a Page Is Set To]]>
Within my theme templates, how do I programmatically determine what that value is? I see 'is_page_protected_by_s2member()' but I'm in need of something more like: 'page_membership_level() ' so that I can test for MembershipLevel 0 case as well as the NULL case.

I'm setting up some Drip Content logic and wondering how to access that info. Looked through the API but couldn't find an answer.

Code:
// If page's membership level is NULL or level 0, define drip dates by when user became a free member
if ($page_membership_level >= 0) {
  $days_since_member = S2MEMBER_CURRENT_USER_REGISTRATION_DAYS;
 
} else {
  // If page's membership level is >= level 1, define drip dates by when user became a paying member
  $days_since_member = S2MEMBER_CURRENT_USER_PAID_REGISTRATION_DAYS;
}


Loving this plugin so far! Working through it. Very impressed so far. Thank you!

Statistics: Posted by skinnytires — June 13th, 2011, 5:03 pm


]]>