Simple Machine Codes
March 29, 2024, 01:05:23 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Word Counter v1

Pages: [1]   Go Down
  Print  
Author Topic: Word Counter v1  (Read 489 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: June 03, 2009, 11:51:27 am »

Footers:
Code:
<script type="text/javascript">
var NumWords = 3;

//Created by Agent Moose (revolutionx.smfforfree3.com)
var username = $("td.titlebg2 span b").not($("td.titlebg2 span b:contains(News)")).html();
if(username){
if(location.href.match(/action=post/i)){
$("textarea[name='message']").after("<span id='SMC_Count'>Total words typed: <b>0</b></span>");
}else if(location.href.match(/topic,/i) && document.forms.postmodify.message){
$("tr#quickReplyOptions td[width='25%']").html("<span id='SMC_Count'>Total words typed: <b>0</b></span>");
};
if(location.href.match(/action=post/i) || location.href.match(/topic,/i) && document.forms.postmodify.message){
$("input[value='Post'],input[value='Preview']").attr("disabled","disabled");
document.forms.postmodify.message.onkeyup = function(){
var Words = document.forms.postmodify.message.value.split(/ /g); var Count = 0;
for(i=0;i<Words.length;i++) if(Words[i].length > 2) Count++;
var Bar = Count * 2;
$("#SMC_Count").html("Total words typed: <b>" + Count + "</b>");
if(Count < NumWords) $("input[value='Post'],input[value='Preview']").attr("disabled","disabled");
if(Count >= NumWords) $("input[value='Post'],input[value='Preview']").attr("disabled","");
};};
};
</script>

Well, I decided to finally release this code.  Its not the same as the one we have on here, but its all you need Tongue

This code makes it so if you have under a certain amount of words in a post, you can't post that post.

See this line at the top of the code?
Code:
var NumWords = 3;
The 3 is how many words you need enable to submit a post Smiley

Enjoy Smiley
Report Spam   Logged

Share on Facebook Share on Twitter



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy