Will "the Mighty" Strohl

Modification to the DNN Blog Module to Ping Using XML RPC

DotNetNuke┬« has a large number of modules ready to help us with nearly all of our website needs.  This includes the DotNetNuke┬« Blog ModuleAntonio Chagoury and the rest of the project team have done a fantastic job bringing the module as up-to-date as they can, but there are only so many hours in the day, and only so many features per release that can be done.  They already have the code in place to perform the ping when upgraded to the version 2.0 .Net framework.  It is commented out right now.  In the meantime, I made a modification that allows us to ping our blog right now. 

I took extra precautions to not change any existing code, and to make it very easy to roll-back or upgrade to the unbranched core module.  In my implementation, there are very few changes.  I simply,

  • Added a single XML config file
  • Added 2 classes
  • Added 2 lines of code to the one of the existing classes

The process was actually quite easy.  I didn't have it completely debugged before rolling it out on this site, until just before this entry.

This implementation uses the XML config file to allow you to specify your own URLs to ping, and blog properties.  As this solution is only meant to be temporary until the next blog module release comes upon us, it is not a perfect and all inclusive solution.  For instance, this may not scale well to blog sites with many blogs. 

To explain the process, the blog module has two lines of code in place to intercept the original workflow just before the module returns the user to the blog view.  In this, the XML config file is parsed and used to send HTTP requests to the specified URLs, with the XML RPC payload.  Each URL has a 5 second timeout, but I have yet for the entire process to take more than 1 or 2 seconds total.

How Can You Use It?

I have attached a zip file that has the rebuilt assembly, the example class files, and a config file for you to get started.  The config file already has some of the common URLs to ping listed.

Here are the steps to install and try this on your own site:

  1. Download and back-up a copy of the original DotNetNuke.Modules.Blog.dll file from your ~/bin folder
  2. Download the attachment from this blog entry and extract its contents.
  3. Modify the XML config file to reflect your blog's information. (DO NOT modify the file name.)
  4. Copy the config file to your blog module folder, ~/DesktopModules/Blog
  5. Copy the extracted DotNetNuke.Modules.Blog.dll file to your ~/bin folder

That's it!  Be sure to give it a rest run right away.  In fact, test it on a local or staging copy of your website first.  You never know what might happen with simple code changes on complex DNN installations.

Enjoy!  The attachment is below...

Modified DNN Blog Module Build Files

Technorati Tags: , , ,



blog comments powered by Disqus