Advertise Here

Author Topic: [[REQUEST]] Censor Word Warning  (Read 2945 times)

0 Members and 1 Guest are viewing this topic.

Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
[[REQUEST]] Censor Word Warning
« on: February 27, 2009, 07:59:20 am »
Hi!

Is there a code so if a user post something using a word on my censored word list that a warning will pop up saying "You have used a word that this site has recognized as inappropriate. Continuing may cause an admin to take disciplinary action upon your account. Are you sure you want to continue?" 


Thanks :D
<--- Donate to SMF For Free! :D


Offline Qub1

  • SMF For Free Full Member
  • *
  • Posts: 149
    • View Profile
    • QUB1

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [[REQUEST]] Censor Word Warning
« Reply #2 on: February 27, 2009, 10:03:02 am »
Oh, well you know I have already made a code with a simulair function on my site, i'll modify it and see what i can do. Mmm, i'll be ready in about... 10 mins?

Offline Qub1

  • SMF For Free Full Member
  • *
  • Posts: 149
    • View Profile
    • QUB1

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [[REQUEST]] Censor Word Warning
« Reply #3 on: March 01, 2009, 08:50:26 am »
Sorry for the very late reaction  :o but there were some problems with the code, so i totally rewrited it and now it supports multiple words. Here is the code:
Code: [Select]
<script type="text/javascript">
<!-- This script is made by Qub1. Find more scripts like this at http://qub1.smfforfree.com/ -->
 
// Variables and handler configuration
var word = new Array(), Letter = new Array(), Code;
document.onkeypress = check_key;
 
// Forebidden Words
word[0] = "FOREBIDDEN WORD";
word[1] = "FOREBIDDEN WORD";
word[2] = "FOREBIDDEN WORD";
word[3] = "FOREBIDDEN WORD";
 
// Reset Counters
for (i = 0; i < word.length; i++) {
Letter[i] = 0;
}
 
// Event handler
function check_key(key) {
 
try {
Code = event.keyCode;
} catch(e) {
Code = key.which;
}
 
for (i = 0; i < word.length; i++) {
 
if (String.fromCharCode(Code).toLowerCase() == word[i].charAt(Letter[i])) {
Letter[i]++;
} else {
Letter[i] = 0;
}
 
if (Letter[i] == word[i].length) {
Letter[i] = 0;
trigger(word[i]);
}
 
}
}
 
// IF the word has been typed
function trigger(word) {
alert("You have used a word that this site has recognized as inappropriate. Continuing may cause an admin to take disciplinary action upon your account. Are you sure you want to continue? You typed: " + word);
}
 
</script>
EDIT:
Oops, forgot to tell, put in the header, and I placed a previeuw on my forum, just type a word you think inapropiate, and see


Just replace FORBIDDEN WORD with the words you don't allow, and if you want more words just enter more of this:
Code: [Select]
word[X] = "FOREBIDDEN WORD";Replace the X with the correct number in the forbidden words list.

The message you wanted to appear: You have used a word that this site has recognized as inappropriate. Continuing may cause an admin to take disciplinary action upon your account. Are you sure you want to continue? has already been included. I have also added a function that will show you what word you typed.|

Thanks,
Qub1 out~
« Last Edit: March 01, 2009, 09:25:38 am by Qub1 »

Offline Seldom Fail

  • Helpers
  • *
  • Posts: 2082
  • Helping for 3 years! :)
    • View Profile
    • My Site!

  • Total Badges: 26
    Badges: (View All)
    Sixth year Anniversary Fifth year Anniversary Apple User Search Poll Voter
Re: [[REQUEST]] Censor Word Warning
« Reply #4 on: March 01, 2009, 11:48:03 am »
Wow thank you soo much!
<--- Donate to SMF For Free! :D

Offline Andrew

  • Helpers
  • *
  • Posts: 2060
  • Andrew at your service
    • View Profile
    • Alabama Weather Prediction

  • Total Badges: 32
    Badges: (View All)
    10 Poll Votes Level 6 Eighth year Anniversary Seventh year Anniversary Sixth year Anniversary
Re: [[REQUEST]] Censor Word Warning
« Reply #5 on: March 01, 2009, 02:09:24 pm »
This can also be done without a code.
Admin CP->Posts and Topics,_(tab) Censored Words

you can add censored words there, and what they would be replaced by if they are said.

Offline - Lawrence -

  • SMF For Free Hero
  • *
  • Posts: 549
    • View Profile

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [[REQUEST]] Censor Word Warning
« Reply #6 on: March 01, 2009, 02:13:06 pm »
This can also be done without a code.
Admin CP->Posts and Topics,_(tab) Censored Words

you can add censored words there, and what they would be replaced by if they are said.
But this method won't allow the box which shows: "You have used a word that this site has recognized as inappropriate. Continuing may cause an admin to take disciplinary action upon your account. Are you sure you want to continue? has already been included. I have also added a function that will show you what word you typed.
" to appear.

But yes that is a better, more full proof method ;).

Offline мσנσвσנσ82

  • SMF For Free Sr. Member
  • *
  • Posts: 310
    • View Profile
    • Darkilscape

  • Total Badges: 14
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: [[REQUEST]] Censor Word Warning
« Reply #7 on: March 28, 2009, 03:44:48 am »
where does it show admins if they swore?



 

Related Topics

  Subject / Started by Replies Last post
word censor

Started by MR.SATAN « 1 2 » Suggestions

15 Replies
4412 Views
Last post September 04, 2008, 06:13:35 pm
by Lucas A33
6 Replies
2247 Views
Last post October 14, 2008, 06:55:35 pm
by SSW
2 Replies
1371 Views
Last post April 02, 2009, 10:44:23 am
by simply sibyl
2 Replies
3275 Views
Last post December 11, 2009, 07:07:02 am
by KrazY
4 Replies
2840 Views
Last post July 24, 2009, 02:03:46 pm
by 4markie