mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* fixed displaying premium account days
* function OTS_Account:getPremDays will now return -1 if there's freePremium configurable enabled on the server
This commit is contained in:
parent
087988dde3
commit
85083f5979
@ -358,6 +358,8 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
return round(($this->data['premend'] - time()) / (24 * 60 * 60), 2);
|
||||
}
|
||||
|
||||
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']));
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,12 @@
|
||||
<div id="two">
|
||||
<h1>My account</h1>
|
||||
<p>Welcome to your account page, {{ account }}<br>
|
||||
You have {{ account_logged.getPremDays() }} days remaining premium account.</p>
|
||||
{% if config.lua.freePremium %}
|
||||
You have unlimited premium account.
|
||||
{% else %}
|
||||
You have {{ account_logged.getPremDays() }} days remaining premium account.
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
{# if account dont have recovery key show hint #}
|
||||
{% if recovery_key is empty %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user