1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-26 06:58:26 +01:00

bans.php: simplify modLog string

This commit is contained in:
Zankaria 2024-05-22 22:14:08 +02:00
parent 9236e10f37
commit 8963ebfce9

View File

@ -371,14 +371,13 @@ class Bans {
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));
if (isset($mod['id']) && $mod['id'] == $mod_id) { 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');