SMF Support > SMF 2.0.x Support
Minimum post characters?
Furry:
I was looking through administration trying to find an option to set the minimum amount of characters a user needs in their post, but ran out of luck.
I saw a mod that did this, but it's out of date and won't work with 2.0. I'm wondering, is there's actually a built in feature that I didn't see, or an update for this mod that I'm unaware of?
EDIT: To add to this, I did a bit of searching around and found some code in post.php:
--- Code: --- elseif (!empty($modSettings['max_messageLength']) && $smcFunc['strlen']($_POST['message']) > $modSettings['max_messageLength'])
$post_errors[] = 'long_message';
--- End code ---
That, I'm guessing is the code checking to long messages, would it be difficult to use this to check for an insufficient amount of text as well?
codenaught:
Sure.
After that you could add something like:
--- Code: ---elseif ($smcFunc['strlen']($_POST['message']) < 5)
$post_errors[] = 'short_message';
--- End code ---
Then in Themes/default/languages/Errors.english.php you can add somewhere in the file:
--- Code: ---$txt['error_short_message'] = 'The message does not have the minimum number of characters required of 5.';
--- End code ---
Of course adjusting the 5 to what you want and the error message to whatever you want.
xyxis_fahim:
Can the earlier version be edited to fit 2.0?
Tnx
codenaught:
Do you mean the mod offers some type of functionality that the code hack I posted doesn't have or you just don't want to manually edit the code?
You would have to ask the author of the mod about the mod being updated for 2.0.
xyxis_fahim:
Well,
This is the mod I speak of.
http://custom.simplemachines.org/mods/index.php?mod=290
I will try contacting the Author.
Thanks.
Navigation
[0] Message Index
[#] Next page
Go to full version