NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 01-04-2009 15:07:33

~*Eevee1*~
Member

Curse Filtering?

Does the newest Wac version have any control over curse filtering? I couldn't find anything myself, but I remembered seeing a post in here asking if it were possible and you said it would run on the same basics as the smilies.

I tried to create it myself but I was either missing information somewhere or just not doing it right.

Anyway, I..really need a swearing filter on my boards. Kids don't seem to care about rules anymore and I'm getting user and parent complaints because of it. Would you be able to point me in the right direction?


Owner of the Suta-Raito Oekakis:
Sutaro Sketcher
SR Oekaki
SRO is the merged form of SRON and SROA, with new templates and funnn contests <3

Offline

#2 01-05-2009 01:05:44

Waccoon
Administrator

Re: Curse Filtering?

Okay, I spent a bit of time on this, and finally got something that seems to work pretty well.  It still needs work, of course, but it's working, so you can try it out.

Censor prototype

Basically, in the functions.php file, you just add the following when you need to check a comment:

Code:

// Censoring (prototype)
$cfg['censoring'] = 1;
if ($cfg['censoring'] == 1) {
    include_once ('censor.php');

    $comment = censor($comment);
}

Keep in mind that the variable to check is sometimes called $comment2 rather than $comment.  The functions file included has the code pasted in the correct places so it's a drop-in replacement if you're using a stock 1.4.1 Wacintaki.  If you've made mods to the functions file, or you're using a version earlier than 1.4.1, please note the locations of the code and copy it to the right place in your own functions.php file.

If you have problems with it, let me know, because I'll consider officially putting this into 1.4.2, and I want to know how well it really works.  When it is officially implemented, it should be easier to update the word file, and people will be able to enable/disable it at will.

Also note that the shorter the word, the later it should appear in the word file.  So, "applepie" would come before "apple", "bannana" would come after "banana split", and so on.  Words that could be part of other words should be put in brackets.  So if you wanted to sensor "bulb" but not "lightbulb", you would add that word to the word file as "[bulb]", rather than "bulb".

Offline

#3 01-05-2009 08:18:51

~*Eevee1*~
Member

Re: Curse Filtering?

It's working beautifully, thank you so much waccoon. <3 This makes everything so much easier.
Hah by the way, I fell out of my chair laughing while reading the censored words. That's an epic list right there.


Owner of the Suta-Raito Oekakis:
Sutaro Sketcher
SR Oekaki
SRO is the merged form of SRON and SROA, with new templates and funnn contests <3

Offline

#4 01-05-2009 12:05:09

Waccoon
Administrator

Re: Curse Filtering?

I fixed one little thing that caused spaces to be stripped out.  It's not a big deal, but the censor code and censor list have been updated:  Censor prototype.  You don't need to edit the functions file again.

Yeah, this is working better than I thought.  It's definitely going into 1.4.2.

Offline

#5 01-05-2009 15:44:05

Re: Curse Filtering?

Waccoon wrote:

If you have problems with it, let me know, because I'll consider officially putting this into 1.4.2, and I want to know how well it really works.  When it is officially implemented, it should be easier to update the word file, and people will be able to enable/disable it at will.

Dude, awesome, the ability to enable and disable this would be amazing! I look forward to this, when will 1.4.2 be available?

Offline

#6 01-06-2009 07:24:43

Waccoon
Administrator

Re: Curse Filtering?

Pretty soon, once I get all the moderator flags switched over.  There will finally be a new moderator group below the admin group, strictly for moderating comments and a few other little things.  I'm also thinking about boosting super-admin access, so people don't have to have more than one owner on a board, which is generally a very bad thing.

Offline

#7 01-06-2009 11:19:10

Trunksi
Member

Re: Curse Filtering?

big_smile ah great work waccoon!
this things will be really helpfull big_smile~
you're really amazing wink

will there also be the "leaving drawing site"-warning included?
( http://www.ninechime.com/forum/viewtopic.php?id=854
since I couldn't figure out...where to put the code lol)

Last edited by Trunksi (01-06-2009 11:22:56)

Offline

#8 01-06-2009 18:08:11

Twighlight
Member

Re: Curse Filtering?

so the words in bracket are what the badwords that are under it will turn into?

Offline

#9 01-07-2009 03:57:48

Waccoon
Administrator

Re: Curse Filtering?

Words in brackets are filtered less aggressively.

Let's suppose "amp" is a trendy new naughty word, and you add it to the list with brackets.  If the word appears by itself, it will be censored.  However, other words that contain it, such as "amplifier" and "ample" will not be censored.

If "amp" is added to the list without brackets, it will always be filtered out, even if it is a part of a larger word.

Offline

#10 01-07-2009 13:46:12

twighlightschool compute
Guest

Re: Curse Filtering?

oooooooh i see.
but when they are censored, what will they become?
is there another list to determine that?
or is it just in ****?

haha, school computers...

#11 01-07-2009 18:30:11

~*Eevee1*~
Member

Re: Curse Filtering?

They show up as ----
I removed a lot of words from the list since they were conflicting with sentences, and it's working a lot better now. =}
I'm curious, would adding the on/off option for a feature have to do with editing the editprofile page, functions page and editing the database only, or are there other pages that need to be altered?


Owner of the Suta-Raito Oekakis:
Sutaro Sketcher
SR Oekaki
SRO is the merged form of SRON and SROA, with new templates and funnn contests <3

Offline

#12 01-07-2009 18:49:35

Re: Curse Filtering?

Waccoon wrote:

Pretty soon, once I get all the moderator flags switched over.  There will finally be a new moderator group below the admin group, strictly for moderating comments and a few other little things.  I'm also thinking about boosting super-admin access, so people don't have to have more than one owner on a board, which is generally a very bad thing.

Sweet, I can't wait for all of your new modifications big_smile Especially the mod flag <3
I'm kind of scared of the upgrade part, I've modified a lot of files ;_;

Offline

#13 01-08-2009 20:10:22

Zoole
New member

Re: Curse Filtering?

Neat stuff! I'm a mod at SRO, where this is being tested. I noticed the censor function kicked in more frequently than it was supposed to with [bracketed] words.

If [string] is in censorwords.txt:

This:
string astring aastring aaastring stringb astringb

Becomes this:
----- a----- aa----- aaa----- stringb astringb

line 33: $content = preg_replace("@".substr($badword, 1, ($len - 2))."[^\w]@i", substr($rep, 0, (strlen($rep) - 2)).' ', $content);

There's something funky with the regex in this line that's producing matches when the word to be censored ends with a [bad word], even though it's not that word. I'm not too familiar with regular expressions or PHP, but would this work better? Looks for a boundary between an alphanumeric character and a non-alphanumeric character, so it'll ignore anything that isn't supposed to be filtered.

$content = preg_replace("@\b".substr($badword, 1, ($len - 2))."\b@i", substr($rep, 0, (strlen($rep) - 2)).' ', $content);

w00t for Wac! It's awesome that you do all this cool stuff for the oekaki community.

Offline

#14 01-09-2009 15:12:26

squirtle_sketcher
New member

Re: Curse Filtering?

Ah, this is really helpful, now the admins at my oekaki won't have to go searching for those cusses xDD
Though something strange seems to be going on with the bracketed words, as the user above me said, its bleeping out some people's username in comments xD But this is really working great :]
I ihave a question though, how could you possibly change what it ends up in, instead of the ----?


PIEPLZ

Offline

#15 01-10-2009 05:45:37

Waccoon
Administrator

Re: Curse Filtering?

This is free code I got from someone else, so I'll have to take a closer look at it.  It looks like the brackets work differently than how it was described in the documentation.

I ihave a question though, how could you possibly change what it ends up in, instead of the ----?

Yup, that's easy.  I'm not sure how many options I want to hack in there, though, since you'd have to choose either a per-character replacement (such as "-" or "*" or "X"), or a keyword (such as "{bleep}").  I really don't want to add too many more options to the control panel, as it's pretty messy as it is.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB