SMF For Free Support Forum
Signup For Free Forum
March 12, 2010, 05:27:34 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [[REQUEST]] Censor Word Warning  (Read 790 times)
0 Members and 1 Guest are viewing this topic.
Seldom Fail
SMF For Free Sponsors
*
Offline Offline

Posts: 1474


Please feel free to email me ;)


View Profile WWW
« 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 Cheesy
Logged

If at first you fail... call it Vista, sell it, and hope that no one notices



My Blog Wink
Jac
SMF For Free Newbie
*
Offline Offline

Posts: 19


View Profile WWW
« Reply #1 on: February 27, 2009, 08:27:20 am »

You could mess around with
http://www.smfsupport.com/support/smf_for_free_codes_and_support/code_warning_make_a_customised_alert_with_links_and_images_qub1-t25528.0.html
Logged

Qub1
SMF For Free Full Member
*
Offline Offline

Posts: 149



View Profile WWW
« 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?
Logged

Qub1
SMF For Free Full Member
*
Offline Offline

Posts: 149



View Profile WWW
« Reply #3 on: March 01, 2009, 08:50:26 am »

Sorry for the very late reaction  Shocked but there were some problems with the code, so i totally rewrited it and now it supports multiple words. Here is the code:
Code:
<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:
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 » Logged

Seldom Fail
SMF For Free Sponsors
*
Offline Offline

Posts: 1474


Please feel free to email me ;)


View Profile WWW
« Reply #4 on: March 01, 2009, 11:48:03 am »

Wow thank you soo much!
Logged

If at first you fail... call it Vista, sell it, and hope that no one notices



My Blog Wink
Andrew
SMF For Free Sponsors
*
Offline Offline

Posts: 1564


Andrew At Your Service!


View Profile WWW
« 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.
Logged



Messages Asking For Support Will Be Deleted.
- Lawrence -
SMF For Free Hero
*
Offline Offline

Posts: 549



View Profile
« 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 Wink.
Logged

мσנσвσנσ82
SMF For Free Sr. Member
*
Offline Offline

Posts: 310



View Profile WWW
« Reply #7 on: March 28, 2009, 03:44:48 am »

where does it show admins if they swore?
Logged





Pages: [1]
  Print  
 
Jump to:  



Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
ServerBeach Coupon
Page created in 0.574 seconds with 20 queries. (Pretty URLs adds 0.057s, 2q)