Oct 12 2011

Bad Word Blocker Extension for BlogEngine 2.5

Category: BlogEngineBrian Legg @ 15:26

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. More...

Tags: ,

Oct 6 2011

AdSense Extension and Widget for BlogEngine 2.0 - 2.5

Category: BlogEngineBrian Legg @ 12:13

BlogEngine is a great tool for writing Blogs, and I use it to run this site. One of the great features about BlogEngine is that you can write your own extensions for just about anything you can think of. One of the things I wanted to add to my blog was a way to easily integrate AdSense ads. AdSense is a program provided by Google to generate a bit of income from your blog in the form of advertisements. If you haven't created an AdSense account you can do so at Google AdSense.

After signing up for Google AdSense you will need to create 1 or more Ad Units. Each of these will give you set of code to insert into your website. The code will look similar to the following based on your selections:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxxx";
/* AdUnit Name */
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 160;
google_ad_height = 600;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

I wanted my Google Ads to show up in 2 places: my sidebar on the right (which is a collection of widgets) and I wanted them to show up in the middle of my longer blog posts where the right side bar would no longer be in view. To do this I needed to create 2 extensions to Blog Engine: a widget and an extension. Here's how they work. More...

Tags: , , ,