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™

Make content visible/not visible based on EOT?

s2Member Plugin. A Membership plugin for WordPress®.

Make content visible/not visible based on EOT?

Postby MarRxK » November 12th, 2011, 3:52 pm

Hi.

I've been reviewing some of the code here: http://www.primothemes.com/forums/viewtopic.php?f=4&t=14842&hilit=eot+display but can seem to find a way to create a code to do what I would like within a post (using either the exc-php or php-execution plugins).

We use s2member pro to run a membership-based association. Automatic EOT is manually set for December 31st each year. Our members may renew starting November 1 for the following year. I've put a "Buy Now" button on the "Welcome" page that purchases the same level of membership for a one year, non-renewing term with the s2member option to extend remaining EOT set to on (i.e., a purchase extends their membership to December 31 of the following year). I would like, upon returning to the welcome page after renewing, that button to disappear. If there a way to code it such that if the days to EOT are 60 or less, the button appears, but if not, it is not visible?

Thanks!

Mark
User avatar
MarRxK
Registered User
Registered User
 
Posts: 4
Joined: October 7, 2011

Re: Make content visible/not visible based on EOT?

Postby Eduan » November 12th, 2011, 4:00 pm

You could try content dripping.
WP Admin -> s2Member -> API / Scripting -> s2Member Content Dripping.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Make content visible/not visible based on EOT?

Postby MarRxK » November 12th, 2011, 8:02 pm

Thanks for the suggestion. I did try that. However, it would appear that one (or just me) cannot make a PayPal button appear within a PHP script. I get all of the text and formatting. However, the PayPal button shows as its text-based shortcode.
User avatar
MarRxK
Registered User
Registered User
 
Posts: 4
Joined: October 7, 2011

Re: Make content visible/not visible based on EOT?

Postby MarRxK » November 12th, 2011, 9:12 pm

Never mind. Fixed the above button display problem using do_shortcode.
User avatar
MarRxK
Registered User
Registered User
 
Posts: 4
Joined: October 7, 2011

Re: Make content visible/not visible based on EOT?

Postby Eduan » November 12th, 2011, 9:48 pm

OK, do you have the Exec-PHP plugin installed?
You can't do it without that plugin installed.
Now officially accepting Professional s2Member installations along with Bruce C (a.k.a. Ace).

If you're interested in a Professional s2Member Installation, or a Custom Coding Job, you can send your request here.
User avatar
Eduan
Experienced User
Experienced User
 
Posts: 1154
Joined: August 27, 2011
Location: Taxco de Alarcón, Guerrero, México.

Re: Make content visible/not visible based on EOT?

Postby MarRxK » November 13th, 2011, 9:32 am

Yep. I tried it with both Exec-PHP and PHP-Execution with variable success. I ended up writing a short code to do it. It's not perfect as it uses "echo" instead of "return" to execute the PayPal button, forcing the content to appear at the top of the page. I am not a PHP guru so if anyone wants to help me change from "echo" to "return" so I can place the short code where I would really like it to appear in a post, I'd appreciate it:

Code: Select all
$startdiv '<div class="with-round-borders with-extra-padding with-box-shadows" style="text-align: center; width: 400px; margin-right: auto; margin-left: auto;">You can now renew on-line using PayPal, a credit card, or a debit card! Click the PayPal button below to renew now.<p style="padding-top: 10 px;">';
$enddiv '</p></div>';
        if (
$days get_user_option('s2member_auto_eot_time'))
    {
        
$days ceil(($days time()) / 86400);

        if (
$days 60)
            echo 
$startdiv do_shortcode('[s2Member-PayPal-Button ... /]') , $enddiv;
        else
            echo 
'<strong><center>Thank-you for renewing your membership.</center></strong>';
    }
}
add_shortcode('driprenew''driprenew');
/*end dripping renewal shortcode*/ 
User avatar
MarRxK
Registered User
Registered User
 
Posts: 4
Joined: October 7, 2011


Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron