PHP Coding Tips to Enhance s2member
Posted: March 1st, 2011, 8:28 pm
In this forum, there's a mix of people who code ad those who don't. For those of us who consider using s2member for the heavy lifting of membership management but what to enhance it's capabilities via PHP, it is difficult to find straight-forward tips and tricks. Hopefully, others will add their suggestions into this thread.
As an administrator, I had a need to display the EOT for a member (i.e. not for/to a currently logged-in member). The s2member_auto_eot_time value is encoded so presenting it in a human-readable format became the challenge. I found the following code snippet quite useful:
You can output different formats for the date by referencing http://php.net/manual/en/function.date.php
As an administrator, I had a need to display the EOT for a member (i.e. not for/to a currently logged-in member). The s2member_auto_eot_time value is encoded so presenting it in a human-readable format became the challenge. I found the following code snippet quite useful:
- Code: Select all
$auto_eot_time = get_user_option ("s2member_auto_eot_time", $uid);
$auto_eot_time = ($auto_eot_time) ? date ("m-d-y", $auto_eot_time) : "";
echo $auto_eot_time;
You can output different formats for the date by referencing http://php.net/manual/en/function.date.php