mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-29 09:44:28 +01:00
%length% in public ban messages
This commit is contained in:
parent
8edf7c7958
commit
8daaaf350a
@ -879,8 +879,10 @@
|
||||
|
||||
// Check public ban message by default
|
||||
$config['mod']['check_ban_message'] = false;
|
||||
// Default public ban message
|
||||
// Default public ban message.
|
||||
// In public ban messages, %length% is replaced with "for x days" or "permanently" (with %LENGTH% being the uppercase equivalent).
|
||||
$config['mod']['default_ban_message'] = 'USER WAS BANNED FOR THIS POST';
|
||||
// $config['mod']['default_ban_message'] = 'USER WAS BANNED %LENGTH% FOR THIS POST'; // Include length in ban message
|
||||
// What to append to the post for public bans ("%s" is the message)
|
||||
$config['mod']['ban_message'] = '<span class="public_ban">(%s)</span>';
|
||||
|
||||
|
@ -1152,6 +1152,9 @@ function mod_ban_post($board, $delete, $post, $token = false) {
|
||||
|
||||
if (isset($_POST['public_message'], $_POST['message'])) {
|
||||
// public ban message
|
||||
$length_english = parse_time($_POST['length']) ? 'for ' . until(parse_time($_POST['length'])) : 'permanently';
|
||||
$_POST['message'] = str_replace('%length%', $length_english, $_POST['message']);
|
||||
$_POST['message'] = str_replace('%LENGTH%', strtoupper($length_english), $_POST['message']);
|
||||
$query = prepare(sprintf('UPDATE `posts_%s` SET `body` = CONCAT(`body`, :body) WHERE `id` = :id', $board));
|
||||
$query->bindValue(':id', $post);
|
||||
$query->bindValue(':body', sprintf($config['mod']['ban_message'], utf8tohtml($_POST['message'])));
|
||||
|
Loading…
Reference in New Issue
Block a user