diff --git a/system/libs/pot/OTS_Account.php b/system/libs/pot/OTS_Account.php index ce0fd656..0ac36107 100644 --- a/system/libs/pot/OTS_Account.php +++ b/system/libs/pot/OTS_Account.php @@ -358,6 +358,10 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable return round(($this->data['premend'] - time()) / (24 * 60 * 60), 2); } + if($this->data['premdays'] == 0) { + return 0; + } + global $config; if(isset($config['lua']['freePremium']) && getBoolean($config['lua']['freePremium'])) return -1; return $this->data['premdays'] - (date("z", time()) + (365 * (date("Y", time()) - date("Y", $this->data['lastday']))) - date("z", $this->data['lastday'])); diff --git a/system/templates/account.management.html.twig b/system/templates/account.management.html.twig index 5a67727f..9b5baa8b 100644 --- a/system/templates/account.management.html.twig +++ b/system/templates/account.management.html.twig @@ -52,9 +52,14 @@

My account

Welcome to your account page, {{ account }}
{% if config.lua.freePremium %} - You have unlimited premium account. + You have unlimited Premium Account. {% else %} - You have {{ account_logged.getPremDays() }} days remaining premium account. + {% set premiumDays = account_logged.getPremDays() %} + {% if premiumDays == 0 %} + You don't have Premium Account + {% else %} + You have {{ account_logged.getPremDays() }} days remaining Premium Account. + {% endif %} {% endif %}