uhhhh $badwords = array("fuck","bitch"); $replacements = array("****","*****"); $text = str_replace($badwords,$replacements,$text);
ya am using a premade script and it have some template files where i can change the site like .. like adding meta tags , adding footer etc ... so should i add this script into that so it will be in all pages ..???
yes, and based on that information I can tell you exactly where to place my code place it on line 3 in the template file
when using text filtration for vulgar language, it is not as simple ad replacing or removing the offending string. with that technique, quite often valid words are removed or destroyed. What if you treat the word "ass" as a vulgar word. then you effectively kill or destroy proper words such as: ASSAIL ASSAILANT ASSAILANTS ASSAILED ASSAILING ASSAILS ASSANTE ASSASSIN ASSASSINATE ASSASSINATED ASSASSINATION ASSASSINATIONS ASSASSINS ASSAULT ASSAULTED ASSAULTING ASSAULTS ASSAY ASSAYER ASSELIN ASSELSTINE ASSEMBLAGE ASSEMBLE ASSEMBLED ASSEMBLER ASSEMBLERS ASSEMBLES ASSEMBLIES ASSEMBLING ASSEMBLY ASSEMBLY'S ASSEMBLYMAN ASSEMBLYMEN ASSENT ASSERT ASSERTED ASSERTEDLY ASSERTING ASSERTION ASSERTIONS ASSERTIVE ASSERTIVENESS ASSERTS ASSESS ASSESSED ASSESSES ASSESSING ASSESSMENT ASSESSMENTS ASSESSOR ASSESSORS ASSET ASSETS ASSICURAZIONI ASSIDUOUS ASSIDUOUSLY ASSIGN ASSIGNED ASSIGNING ASSIGNMENT ASSIGNMENTS ASSIGNS ASSIMILATE ASSIMILATED ASSIMILATING ASSIMILATION ASSISI ASSIST ASSISTANCE ASSISTANT ASSISTANTS ASSISTED ASSISTING ASSISTS ASSOCATION ASSOCIATE ASSOCIATE'S ASSOCIATED ASSOCIATES ASSOCIATES' ASSOCIATING ASSOCIATION ASSOCIATION'S ASSOCIATIONS ASSOCIES ASSORTED ASSORTMENT ASSUAGE ASSUAGED ASSUBEL ASSUME ASSUMED ASSUMES ASSUMING ASSUMPTION ASSUMPTIONS ASSURANCE ASSURANCES ASSURE ASSURED ASSUREDLY ASSURES and so on. the same can be said for many other vulgar words. Ideally, you want Smart Bad-Words Filtration. what you want to do is make a vulgar words database (badwords). then obtain a dictionary list/db and parse that list/db for the existence of any vulgar word you wish to filter. Then create a database of acceptable words that include text from your vulgar words database (goodwords). Then when your routine finds vulgar word text in a submittion, cross reference the entire word/string the vulgar word resides in with the acceptable words database. If they are found, then its a good word. If not, then remove or replace it. that said, internet visitors, especially those bent on causing problems, may still find ways to curcumvent a filter such as intentional mispellings and ascii/charset replacements, so the developer needs to be vigilant and constantly update their db's, and have a manual mechanism for such, for those tricky ones. a few of many examples: fµ¢k / FÜÇK / fukc / ¢µñt / ÇÜÑT / ǵÑt / ¢ÜñT Fâgøt / FÅGÕT and so on ... you will never be completely devoid of vulgarity, but using smart processes and due dilligence, you can still eliminate most of it and not disable your visitors posting acceptable text. do a google search on "smart bad word filter" or "bad word filter". it takes some digging to find the good ones, which i am sorry to say are mostly commercial. or code it yourself ... it will be a very interesting exercise. When you post it online, track it for a period of time. You will find there are some very creative visitors around these days In either case, eventually you will see a vulgarity decrease as the strings are removed, while not limiting your visitors in acceptable words.
does it really matter that much that you will want to block ¢Ünŧ and every other possible filter bypass? I agree about the ass stuff, but blocking out those is just ridiculous. If members feel they have to bypass the filter, then they're doing it on purpose, meaning you can just punish them.
it takes just as much energy and time to punish them as it does to add a string to the database. Personally, I am all about prevention. A simple warning, delete offensive text/post/coomment, and add the word to bad words database. When the string is disabled, it never ocurrs again, so in a strange way they are helping you by giving you more strings to be filtered. If you ever administrated or moderated a large community, you would know its a time-consuming and daunting task so automation is often your best friend. I am not one who looks for excuses to punish someone. The community can take care of that judging for themselves the validity of their posts. If a troublemaker comes, a community generally shuns them relatively quickly on their own, which is much more effective in the long run. even people who try to get around your filters see your adds, increases your unique statistics, and helps to add to your revenue stream.
blocking out every single version of the word "cunt" is ridiculous. It would end up having thousands of blocked strings making the site slow and preventing maybe one case a year. Most of the strings would never even be used. Prevention is good, but taking it too far is not good. The world won't end if somebody says cunt, in fact, I did it just now
i dont want to punish the users actually i am using adsense in that site ..so when people post bad words i think itz against Google tos so ... i just want to change the word thats all ... like this way fµ¢k / FÜÇK / fukc