It was easy to get around this. (applies to MyBB 1.6+)
In the forum install root, find this file: usercp.php
Edit it and search for this:
$plugins->run_hooks("usercp_start");If you've broken out the more or less proper line breaks, it should be around line 57, but the files come from MyBB without line breaks.
Change this:
if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&To this (focus on the - substr_count images/smilies/):
substr_count($parsed_sig, "<img") > 0) ||
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
)
if((($mybb->settings['sigimgcode'] == 0 && $mybb->settings['sigsmilies'] != 1) &&What's going on here is... say you allow one image in a signature. Well a smilie is an image because when it all comes down to the code, there is an "<img" tag. The code counts the images and checks the count against the "maxsigimages" setting. All I am doing is counting the number of instances of "images/smilies/" and then reducing the number of images found by that number before it is compared to the "maxsigimages" setting.
substr_count($parsed_sig, "<img") > 0) ||
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) &&
(substr_count($parsed_sig, "<img") - substr_count($parsed_sig, "images/smilies/")) > $mybb->settings['maxsigimages'])
)
This works because smilies are kept in a specific directory.
It comes down to this:
(substr_count($parsed_sig, "<img") - substr_count($parsed_sig, "images/smilies/")) > $mybb->settings['maxsigimages'])versus this:
substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages'])
No comments:
Post a Comment