Merge pull request #758 from Zankaria/refactor-ban-log

Refactor ban log
This commit is contained in:
Lorenzo Yario 2024-05-22 23:15:30 -07:00 committed by GitHub
commit 878a67389a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -370,16 +370,14 @@ class Bans {
$query->bindValue(':post', null, PDO::PARAM_NULL); $query->bindValue(':post', null, PDO::PARAM_NULL);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
if (isset($mod['id']) && $mod['id'] == $mod_id) {
modLog('Created a new ' . $ban_len = $length > 0 ? preg_replace('/^(\d+) (\w+?)s?$/', '$1-$2', Format\until($length)) : 'permanent';
($length > 0 ? preg_replace('/^(\d+) (\w+?)s?$/', '$1-$2', Format\until($length)) : 'permanent') . $ban_board = $ban_board ? "/$ban_board/" : 'all boards';
' ban on ' . $ban_ip = filter_var($mask, FILTER_VALIDATE_IP) !== false ? "<a href=\"?/IP/$cloaked_mask\">$cloaked_mask</a>" : $cloaked_mask;
($ban_board ? '/' . $ban_board . '/' : 'all boards') . $ban_id = $pdo->lastInsertId();
' for ' . $ban_reason = $reason ? 'reason: ' . utf8tohtml($reason) : 'no reason';
(filter_var($mask, FILTER_VALIDATE_IP) !== false ? "<a href=\"?/IP/$cloaked_mask\">$cloaked_mask</a>" : $cloaked_mask) .
' (<small>#' . $pdo->lastInsertId() . '</small>)' . modLog("Created a new $ban_len ban on $ban_board for $ban_ip (<small># $ban_id </small>) with $ban_reason");
' with ' . ($reason ? 'reason: ' . utf8tohtml($reason) . '' : 'no reason'));
}
rebuildThemes('bans'); rebuildThemes('bans');