Skip to Content Skip to Menu

User expiration date on CB Subscription Module

  • dewittds
  • dewittds
  • OFFLINE
  • Posts: 15
  • Thanks: 0
  • Karma: 0
10 years 1 month ago #249129 by dewittds
If found the following bit of code here in a topic with subject "Display Expiration Date in CB Subscription Module" It works great for active subscribers, but if a user's subscription has expired it give a date of December 31, 1969. I check the db and the test expired user has a status of X and a valid(expired) date/time in the expired column. Any one have any ideas?
Thanks,
David

<div id="expiry_notice">
< ?php

$db = JFactory::getDbo();
$query = $db->getQuery( true );

$query = "SELECT expiry_date FROM #__cbsubs_subscriptions WHERE user_id = '" . $_CB_framework->myId() . "' AND status = 'A'";

$db->setQuery($query);

$result = $db->loadResult();

$dt = strtotime($result);

echo "Membership Valid Until: <br />" . date("F j, Y", $dt);

?>
< /div><!--#expiry_notice-->

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum