(2012-07-24, 02:45 AM)brad-t Wrote: Nice. One problem with using the Preview button this way is if you hit "Full Editor" without entering anything, you'll get an error message. Not sure what to do about that.
That's fairly easy to fix. Open the ./inc/datahandlers/post.php file in a text editor.
Find:
// Do we even have a message at all?
if(my_strlen($post['message']) == 0)
{
$this->set_error("missing_message");
return false;
}
// If this board has a maximum message length check if we're over it. Use strlen because SQL limits are in bytes
else if(strlen($post['message']) > $mybb->settings['maxmessagelength'] && $mybb->settings['maxmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
{
$this->set_error("message_too_long", array($mybb->settings['maxmessagelength'], strlen($post['message'])));
return false;
}
Replace with:
// If this board has a maximum message length check if we're over it. Use strlen because SQL limits are in bytes
if(strlen($post['message']) > $mybb->settings['maxmessagelength'] && $mybb->settings['maxmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
{
$this->set_error("message_too_long", array($mybb->settings['maxmessagelength'], strlen($post['message'])));
return false;
}