How to calculate the days left for membership in SocialEngine?

Any idea how can I get the remaining membership days for a user in my SocialEngine site?

Add Comment
1 Answer(s)
Best answer

Here is a working code to get a member’s subscription date, so you can use it to further calculate the remaining days for their subscription:

$table = Engine_Api::_()->getDbtable('subscriptions', 'payment');
$select = $table->select()->where('user_id = ?', $user_id);
$arr2 = $table->fetchAll($select);
if ($arr2['expiration_date']=="NULL")
$exp = "NEVER";
echo $exp;


Geraldine Stevens Answered on November 20, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.