March 28, 2024, 01:03:58 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to Revolution X, where Coding meets Graphics.
 
  Home Help Search Arcade Affiliates Staff List Calendar Members Login Register  

Word Counter v1

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

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« on: June 03, 2009, 11:48:33 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

Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #1 on: June 03, 2009, 11:55:32 am »

Er...This is doing the same thing the last one did, its not counting the words typed  Embarrassed Perhaps this doesnt work if we are using the Reason For Edit?
Report Spam   Logged

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #2 on: June 03, 2009, 11:58:12 am »

Well, that would be why it doesn't want to work for you.  I can't really do anything about that either.

I would say though, this code is better than Slayers "hows my post" code Tongue  Mine makes it so you can't click Post or Preview if you have less than a certain amount of characters.

Report Spam   Logged


Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #3 on: June 03, 2009, 12:00:35 pm »

Well, that would be why it doesn't want to work for you.  I can't really do anything about that either.

I would say though, this code is better than Slayers "hows my post" code Tongue  Mine makes it so you can't click Post or Preview if you have less than a certain amount of characters.



Lol very nice, hey this is really cool what the one is doing here, it looks like you combined with both of them. Looks like Ill have to remove the Reason For Edit code, make them put *their name edit: reason. Great job with the code, it looks great Smiley

Btw...
Wow! You truly have the longest post

Grin
Report Spam   Logged

Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #4 on: June 04, 2009, 07:00:05 am »

Smiley
I thought people might like that Smiley

I need to make it so its more flowing with the forum though.
Report Spam   Logged


Lyle
MeTube
Member
Member
Offline Offline

Gender: Male
Posts: 69



View Profile
Badges: (View All)
« Reply #5 on: June 07, 2009, 04:00:44 pm »

This is great moose

i wish it was like the RX one, but what you see is what you get,
Report Spam   Logged
Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #6 on: June 14, 2009, 02:11:21 am »

Woo! Thanks for this! It really helps stop spam posts
Report Spam   Logged






Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #7 on: June 14, 2009, 02:14:52 am »

Aww it doesn't Count the Words? Should i remove the code?
Report Spam   Logged






Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #8 on: June 14, 2009, 09:07:10 am »

It should count the words fine. Its just like the one here, except it doesnt show the bar thing, and the extra text (keep going! You are doing great!, You truly have the longsest post!, etc.)

Did you edit any part of the code? Do you have another code similar to it? (Like the Reason for Edit)
Report Spam   Logged

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #9 on: June 15, 2009, 06:57:02 am »

Nope. Just copied in the code to my Footers... It doesn't count the posts so you can't post... I'll keep trying
Report Spam   Logged






Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #10 on: June 15, 2009, 06:59:11 am »

Aww... Nope not working. I tried a few more times but... Oh well.. I don't really need it anyway...
Report Spam   Logged






Andrew
Exclusive
Exclusive
Offline Offline

Gender: Male
Posts: 539



View Profile WWW
Badges: (View All)
Combination Topic Starter Poll Voter
« Reply #11 on: June 15, 2009, 10:18:23 am »

It worked fine for me...You gotta be using another code that is similar to it...
Report Spam   Logged

Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #12 on: June 16, 2009, 01:59:18 am »

Mhm okay. Just don't worry about it. I'll try find another code or I'll get my friend to take a look at my forum

EDIT1:
Er... Maybe do i need something in headers? like a javascript thing? I'll check now..

EDIT2:
W00t worked! And 1 question.. How do you get that
"you must have at least 3 words in the post before posting."

and "You are getting better" and stuff? and the RX sign... would be nice to have on mine Tongue
« Last Edit: June 17, 2009, 10:41:53 am by Agent Moose » Report Spam   Logged






Mojobojo82
MVP
MVP
Offline Offline

Gender: Male
Posts: 838


View Profile
Badges: (View All)
« Reply #13 on: June 16, 2009, 03:15:07 am »

Er... Maybe do i need something in headers? like a javascript thing? I'll check now..
Report Spam   Logged






Agent Moose
Administrator
Adminitrator
Offline Offline

Gender: Male
Posts: 1,470



View Profile WWW
Badges: (View All)
Tenth year Anniversary Nineth year Anniversary Search
« Reply #14 on: June 16, 2009, 07:57:45 am »

mojobojo82, please don't double post.  You can edit your post you know Wink

For the other words and such, that code isn't released.  Its only for Revolution X.
Report Spam   Logged


Pages: [1] 2   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