If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: Javascript FAQ ::: Enforce a Minimum Word Count for Posts
New Topic    Add Reply
Topic: Enforce a Minimum Word Count for Posts  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
Nutrocker

ezboard Moderator
ezSupporter
Posts: 15859
Posted: 6/15/05 2:52 pm    
Enforce a Minimum Word Count for Posts
Summary: Set the minimum number of words that must be included in a post for the post to be "let through". The word count excludes emoticons, so posting a string of X emoticons will not be allowed by the script.

HEAD (box #1):
  
<script type="text/javascript">
/* REQUIRE MINIMUM NUMBER OF WORDS IN A POST */
/* written by and copyright 2004 phalen180 */
/* licensed for use on ezboard message boards only */
/* latest version and more scripts at http://www.geke.net/ezboard/ */
/* DO NOT REMOVE THIS NOTICE */

var iMinWords = 0;
function minwords(iMin) {
        if (document.getElementsByName("body").length > 0) {
                iMinWords = iMin;
                document.getElementsByName("postMessage")[0].onsubmit=checkmin;
        }
}

function checkmin() {
        var re = new RegExp(/[\:8\>\;\||0]{1}[\S]{1}/ig);
        sPost = document.getElementsByName("body")[0].value.replace(re, "").replace(/[\s]{2}/ig, " ");
        aWords = sPost.split(" ");
        if (aWords.length < iMinWords) {
                alert("Your post must consist of at least " + iMinWords + " words, not including emoticons.");
                return false;
        } else {
                return true;
        }
}
/* END REQUIRE MINIMUM NUMBER OF WORDS IN A POST */
</script>

FOOTER (box #4):
  
 <script type="text/javascript">
/* LAUNCH WORD COUNT MINIMUM */
// change the number between the parentheses to the minimum number of words to permit
minword(10);
/* END LAUNCH WORD COUNT MINIMUM */
</script>

Change the number in the parentheses to the minimum number of words that you require in posts.

History:
4/5/2004 - written by phalen180

Credits:
written by phalen180
suggested by Jedi Mad Pierre

Edited by: Nutrocker at: 6/15/05 2:53 pm

  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - Javascript FAQ -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.