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™

Display account variables in theme

s2Member Plugin. A Membership plugin for WordPress®.

Re: Display account variables in theme

Postby Cristián Lávaque » April 29th, 2011, 9:32 pm

You'd use 's2member_last_payment_time' instead of 's2member_auto_eot_time', and you'd change the math to figure out the days left.
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Display account variables in theme

Postby adriarichards » May 3rd, 2011, 11:35 pm

Thanks to theone and artEV, I was able to make this nifty looking notice to let a member know when their plan would expire!

http://screencast.com/t/zJyabJ3hX
Image




theone wrote:That's the ticket! Thanks so much for the assistance, greatly appreciated!

For anyone who stumbles upon this thread and wants to cut to the chase.......

Code: Select all
<?php
       if ($days = get_user_option('s2member_auto_eot_time'))
    {
        $days = ceil(($days - time()) / 86400);

        if ($days < 1)
            echo 'Your subscription has expired.';
        elseif ($days == 1)
            echo 'Your subscription will end tomorrow!';
        else
            echo 'You have ', $days, ' days left.';
    }
?>
User avatar
adriarichards
Registered User
Registered User
 
Posts: 24
Joined: March 22, 2011

Re: Display account variables in theme

Postby Cristián Lávaque » May 3rd, 2011, 11:54 pm

That's great, Adria! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Display account variables in theme

Postby vigneshrajesh » December 4th, 2011, 3:30 am


Code: Select all
<?php
       if ($days = get_user_option('s2member_auto_eot_time'))
    {
        $days = ceil(($days - time()) / 86400);

        if ($days < 1)
            echo 'Your subscription has expired.';
        elseif ($days == 1)
            echo 'Your subscription will end tomorrow!';
        else
            echo 'You have ', $days, ' days left.';
    }
?>


I just pasted this code in my my account page HTML..

but not working for me..i already installed php execution plugin..

What i need to do work..There is no output coming for me..
User avatar
vigneshrajesh
Registered User
Registered User
 
Posts: 5
Joined: December 2, 2011

Previous

Return to s2Member Plugin

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 2 guests

cron