After writing the AdSense widget and extension I decided to try writing another one that I've seen requested on a number of blogs/forums. This is simply a word replacing extension which is most likely usefull for replacing curse words in user comments. The extension is just a list of words which must be replaced and words to replace them with. You may add, edit, or remove them at any time. I could also see this being usefull for other things as well such as adding your own comment markup or whatever else you can think of that you would like to replace in the comments text.
I also wanted to try writing my extension to work with the new BlogEngine 2.5 features. So, the settings for the BadWordBlocker are unique to each blog instance it's configured/enabled for. There are also 187 predefined curse words and replacements initially loaded to hopefully save you some time. If you don't like the initial list you may edit or remove them as needed. I gathered the list of dirty words from here.
The BadWordBlocker Extension
Setting up and installing the BadWordBlocker extension is easy. Just follow these simple steps:
- Extract the .zip to your computer
- Copy the BadWordBlocker.cs file to your Extensions directory in your blog. For me this was in brianlegg.com/wwwRoot/App_Code/Extensions
- Navigate to your Admin dashboard and go to the Extensions tab
- You should see a new extension named BadWordBlocker
- Select the extension from the list on the right
- Enter combinations of words you want to replace and what you want to replace them with
- Press Add
- Press Remove to remove any you don't like
- Press Edit to change ones that already exist
You should have a view similar to the following:
Enjoy the extension!
BadWordBlocker.zip (2.38 kb)