mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* fixed when ban expires is unlimited
* moved Banished code to twig
This commit is contained in:
parent
cde42ec3fa
commit
23c1df72aa
@ -352,15 +352,15 @@ WHERE killers.death_id = '".$death['id']."' ORDER BY killers.final_hit DESC, kil
|
||||
$bannedUntil = '';
|
||||
$banned = array();
|
||||
if(tableExist('account_bans'))
|
||||
$banned = $db->query('SELECT `expires_at` as `expires` FROM `account_bans` WHERE `account_id` = ' . $account->getId() . ' and `expires_at` > ' . time());
|
||||
$banned = $db->query('SELECT `expires_at` as `expires` FROM `account_bans` WHERE `account_id` = ' . $account->getId() . ' and (`expires_at` > ' . time() . ' OR `expires_at` = -1);');
|
||||
else if (tableExist('bans')) {
|
||||
if (fieldExist('expires', 'bans'))
|
||||
$banned = $db->query('SELECT `expires` FROM `bans` WHERE (`value` = ' . $account->getId() . ' or `value` = ' . $player->getId() . ') and `active` = 1 and `type` != 2 and `type` != 4 and `expires` > ' . time());
|
||||
$banned = $db->query('SELECT `expires` FROM `bans` WHERE (`value` = ' . $account->getId() . ' or `value` = ' . $player->getId() . ') and `active` = 1 and `type` != 2 and `type` != 4 and (`expires` > ' . time() . ' OR `expires` = -1);');
|
||||
else
|
||||
$banned = $db->query('SELECT `time` as `time` FROM `bans` WHERE (`account` = ' . $account->getId() . ' or `player` = ' . $player->getId() . ') and `type` != 2 and `type` != 4 and `time` > ' . time());
|
||||
$banned = $db->query('SELECT `time` as `time` FROM `bans` WHERE (`account` = ' . $account->getId() . ' or `player` = ' . $player->getId() . ') and `type` != 2 and `type` != 4 and (`time` > ' . time() . ' OR `time` = -1);');
|
||||
}
|
||||
foreach($banned as $ban) {
|
||||
$bannedUntil = ' <font color="red">[Banished ' . ($ban['expires'] == "-1" ? 'forever' : 'until ' . date("d F Y, h:s", $ban['expires'])) . ']</font>';
|
||||
$bannedUntil = $ban['expires'];
|
||||
}
|
||||
|
||||
$account_players = $account->getPlayersList();
|
||||
|
@ -329,7 +329,13 @@
|
||||
{% set rows = rows + 1 %}
|
||||
<tr bgcolor="{{ getStyle(rows) }}">
|
||||
<td width="20%">Created:</td>
|
||||
<td>{{ account.getCustomField("created")|date("j F Y, g:i a") ~ bannedUntil|raw }}</td>
|
||||
<td>{{ account.getCustomField("created")|date("j F Y, g:i a") }}
|
||||
{% if bannedUntil matches '/^\\d+$/' or bannedUntil == '-1' %}
|
||||
<font color="red">[Banished {% if bannedUntil == '-1' %}forever{% else %}until {{ bannedUntil|date('d F Y, h:s') }}{% endif %}]</font>
|
||||
{% else %}
|
||||
{{ bannedUntil|raw }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{ hook(constant('HOOK_CHARACTERS_AFTER_ACCOUNT')) }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user