Merge branch '0.9' into develop

This commit is contained in:
slawkens 2023-08-12 13:28:07 +02:00
commit 6c8961638e
2 changed files with 18 additions and 6 deletions

View File

@ -272,7 +272,7 @@ else if (isset($_REQUEST['search'])) {
</li>
<?php endif;
if ($db->hasTable('store_history')) : ?>
if ($db->hasTable('store_history') && $db->hasColumn('store_history', 'time')) : ?>
<li class="nav-item">
<a class="nav-link" id="accounts-store-tab" data-toggle="pill" href="#accounts-store">Store History</a>
</li>
@ -523,7 +523,7 @@ else if (isset($_REQUEST['search'])) {
} ?>
</div>
<?php endif;
if ($db->hasTable('store_history')) { ?>
if ($db->hasTable('store_history') && $db->hasColumn('store_history', 'time')) { ?>
<div class="tab-pane fade" id="accounts-store">
<?php $store_history = $db->query('SELECT * FROM `store_history` WHERE `account_id` = "' . $account->getId() . '" ORDER BY `time` DESC')->fetchAll(); ?>
<table class="table table-striped table-condensed table-responsive d-md-table">

View File

@ -50,7 +50,8 @@ if(!$bansQuery->rowCount())
$nextPage = false;
$i = 0;
$bans = $bansQuery->fetchAll();
$bans = $bansQuery->fetchAll(PDO::FETCH_ASSOC);
foreach ($bans as $id => &$ban)
{
if(++$i > $configBansPerPage)
@ -69,11 +70,22 @@ foreach ($bans as $id => &$ban)
$accountId = $ban['account_id'];
}
$ban['player'] = getPlayerLink(getPlayerNameByAccount($accountId));
$playerName = 'Unknown';
if ($configBans['hasType']) {
$ban['type'] = getBanType($ban['type']);
if ($ban['type'] == 2) { // namelock
$playerName = getPlayerNameById($accountId);
}
else {
$playerName = getPlayerNameByAccount($accountId);
}
}
else {
$playerName = getPlayerNameByAccount($accountId);
}
$ban['player'] = getPlayerLink($playerName);
$expiresColumn = 'expires_at';
if ($db->hasColumn('bans', 'expires')) {
@ -104,7 +116,7 @@ foreach ($bans as $id => &$ban)
}
}
else {
$addedBy = getPlayerLink(getPlayerNameByAccount($ban['banned_by']));
$addedBy = getPlayerLink(getPlayerNameById($ban['banned_by']));
}
if ($db->hasColumn('bans', 'added')) {