I've looked hard and the doesn't seem to be one (which surprises me) so I'm going to be working on one as I need one for my site to keep it suitable for all ages. I'm happy using PHP and I'm getting there with Drupal. This will be my first module so and feedback would be greatly appreciated.
Here's my current thinking (it may not be the right option):
1. Administrator enables filter module
2. Administrator adds words to the filter which are removed any time they are met when a person adds a comment or a node to the site.
Only problem with this approach is that if your filter doesn't have a word in it, you'll have to manually delete the word from any comments made with it before this point in time.
The other option is that the words are removed when displaying the nodes and comments. This might cause the site to slow down.
Any thoughts most welcome.
Comments
you could use the cron hook
you could use the cron hook for overlooking existing nodes
-micha
work in progress with Drupal 4.6: langmi.de
No cron
Just use the filter system. This is exactly what it is there for. (And Drual users are just polite people no need to censor them :) )
---
Next time, please consider filing a support request.
[Bèr Kessels | Drupal services www.webschuur.com]
filters perform well
The filters have all sorts of cching, taht will help you, do not fear performance loss.
---
Next time, please consider filing a support request.
[Bèr Kessels | Drupal services www.webschuur.com]
Thanks for the encouragement
and reassurance.
Now, here's my first module (I hope no-one is offended by my example):
Issues I can think of: how to add/delete/edit terms without changing the module file - should I use MySQL table?
not utf8 safe, at all
* Your regular expressuins are not utf8 safe. People will be able to avoid filtring by adding utf 8 equivalants of their words.
* Your regular expressions do not catch html.
<strong>cur</strong><strong>se</strong> for example will just show curse
* It would be easiest to add a single textarea with comma-separated swear words. Save that with variable_get/-set and explode on , (comma), Simple yet effective.
---
Next time, please consider filing a support request.
[Bèr Kessels | Drupal services www.webschuur.com]
Thanks
I will try and work on those issues too :)
What about tweaking the glossary module?
The glossary module compares words in posts/comments/stories and hyperlinks words that match those in the glossary taxonomy.
Seems like this could be a foundation for a swearing module.
You would use a taxonomy to define the bad words and then display them as *** instead of hyperlinks.
Just a thought.
Kevin
https://bkjdigital.com
We make magic.