MyBB Community Forums

Full Version: Minimum and maximum characters in posts problem.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Where can I fiond that bit of code where the minimum and maximum characters in posts are specified. Not the language codes in the language files but the actual codes in the mybb other files. This is something that is very important for my forum. Please matt, can you help me again sir?
I plan to create a plugin that will expand further the function of the post character limit for a forum that I am a tech admin at. Next week I think I will have it ready.
(2009-12-03, 08:51 PM)babjusi Wrote: [ -> ]I plan to create a plugin that will expand further the function of the post character limit for a forum that I am a tech admin at. Next week I think I will have it ready.

Thank you for your kind offer but I can not wait until the next week because i need it NOW. if you will not do it now maybe someone else will. so can you do it NOW?
(2009-12-04, 05:32 PM)tarekovski Wrote: [ -> ]
(2009-12-03, 08:51 PM)babjusi Wrote: [ -> ]I plan to create a plugin that will expand further the function of the post character limit for a forum that I am a tech admin at. Next week I think I will have it ready.

Thank you for your kind offer but I can not wait until the next week because i need it NOW. if you will not do it now maybe someone else will. so can you do it NOW?

No, not with this attitude I won''t. I told you before as well that I am busy and it would have had to wait until next week. One piece of advice, don''t shout and command with NOW and such asif I owe you anything, cos we are all vouleenters here and help out in our free time. Some appreciation and a simple thank you will go a long away.

Now I won''t be creating this plugin. Go and ask someone else who will create it for you now. or even better, why don''t you do it yourself. The code you need is at the post.php file in the "datahandlers" folder inside the /inc/ directory.

This is the code you need:

// If this board has a maximum message length check if we're over it.
		else if(my_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']));
			return false;
		}

		// And if we've got a minimum message length do we meet that requirement too?
		else if(my_strlen($post['message']) < $mybb->settings['minmessagelength'] && $mybb->settings['minmessagelength'] > 0 && !is_moderator($post['fid'], "", $post['uid']))
		{
			$this->set_error("message_too_short", array($mybb->settings['minmessagelength']));
			return false;
		}
I am sorry babjusi, ok. I had a bad day and I took it out on you. Can you please make that hack?
No problem, we all have had our bad days. Don''t worry about it.

However, regarding the plugin, I don''t have much free time to work on it.