A script for Minimum letters on reply
Page 1 of 1 • Share •
A script for Minimum letters on reply
Hello everyone,
On my forum I got some topics with hidden contend that you need to post a reply in order to see it. I got a problem with some users that tend to give really sort replies like "!" "!!" "tnx". Is there a scrip that will make the replies to require a minimum of at leasts 4 letters in order to post?
I tried this one http://help.forumotion.com/t121475-minimum-character-post?highlight=minimum+characters
but I post a reply even when I typed a whole sentence. I tried editing the numbers on the script but nothing changed.
Could someone please help me?
Thank you very much for your time. I really appreciate it. I hate banning people.
On my forum I got some topics with hidden contend that you need to post a reply in order to see it. I got a problem with some users that tend to give really sort replies like "!" "!!" "tnx". Is there a scrip that will make the replies to require a minimum of at leasts 4 letters in order to post?
I tried this one http://help.forumotion.com/t121475-minimum-character-post?highlight=minimum+characters
but I post a reply even when I typed a whole sentence. I tried editing the numbers on the script but nothing changed.
Could someone please help me?
Thank you very much for your time. I really appreciate it. I hate banning people.
Re: A script for Minimum letters on reply
Hi Nehelenia,
try this
To change the number of characters, you must change this part /
try this
- Code:
$(function(){$(function(){
var MinNumberOfChars = 4;
var ico_compl = "http://i73.servimg.com/u/f73/18/10/89/49/ok-gre10.png";
var ico_incompl = "http://i73.servimg.com/u/f73/18/10/89/49/exclam10.png";
if($("#text_editor_textarea").length != 0){
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
$(".sceditor-container").after("<br/><div id='div_minchars' align='center'><div id='div_minchars_header'> Minimum characters to send a message: " + MinNumberOfChars + " </div><div id='div_minchars_info'></div></div>");
var sceditor = $("#text_editor_textarea").sceditor("instance");
var str = sceditor.val().replace(/ |\n|\s+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|/gi,'');
var str_len = str.length;
if(str_len >= MinNumberOfChars) $("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
sceditor.keyUp(function(e) {
str = sceditor.val().replace(/ |\n|\s+|\[img\].*?\[\/img\]|\[.*?\]|\[\/.*?\]|/gi,'');
str_len = str.length;
if(str_len >= MinNumberOfChars) {
$("#div_minchars_info").html("You've written <span style='color:green'>" + str_len + "</span> character(s). You can now send the message <img src='" + ico_compl + "' />");
$("input[type='submit'][name='post']").attr("disabled", false).css("opacity", "1");
}else{
$("#div_minchars_info").html("You've written <span style='color:red'>" + str_len + "</span> character(s). You need " + (MinNumberOfChars - str_len) + " character(s) to send this message <img src='" + ico_incompl + "' />");
$("input[type='submit'][name='post']").attr("disabled", true).css("opacity", "0.5");
}
});
}
})});
To change the number of characters, you must change this part /
- Code:
var MinNumberOfChars = 4;
fascicularia- Forumember
- Posts : 172
Reputation : 1
Language : french
Re: A script for Minimum letters on reply
Topic solved and archived

Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.

Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum