Maked max smilies in PM configurable (#189)

This commit is contained in:
Roman Kelesidis 2023-06-18 19:48:55 +07:00 committed by GitHub
parent 759d655d60
commit d4b35fed1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -927,6 +927,17 @@ else if ( $submit || $refresh || $mode != '' )
$error = TRUE;
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['EMPTY_MESSAGE'];
}
// Check smilies limit
if ($bb_cfg['max_smilies_pm'])
{
$count_smilies = substr_count(bbcode2html($privmsg_message), '<img class="smile" src="'. $bb_cfg['smilies_path']);
if ($count_smilies > $bb_cfg['max_smilies_pm'])
{
$error = TRUE;
$error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . sprintf($lang['MAX_SMILIES_PER_POST'], $bb_cfg['max_smilies_pm']);
}
}
}
if ( $submit && !$error )
@ -1205,7 +1216,7 @@ else if ( $submit || $refresh || $mode != '' )
//
if (bf($userdata['user_opt'], 'user_opt', 'dis_pm') && $mode != 'edit')
{
$message = ($lang['CANNOT_SEND_PRIVMSG']);
bb_die($lang['CANNOT_SEND_PRIVMSG']);
}
//