Wiz-kid Intern 1 – IntenseDebate 0

It was drawn to my attention this morning that the hyperlinks on my IntenseDebate comment widget were broken. This widget works using the IntenseDebate WordPress plugin which imports all by comments from WordPress comment to my IntenseDebate account. It is a nice plugin as it displays pictures and details of any of my commentators and even scores them on their activity. The fault with the widget was when certain post like the Social Media Dingbats were click IntenseDebate was repeating the url e.g. ‘http://mjmobbs.com/?p=258/http://mjmobbs.com/?p=258‘ but instead of displaying as shown here was replacing the ‘punctuation’ with code e.g. ‘http://mjmobbs.com/http%3a%2f%2fmjmobbs.com%2f%3fp%3dp=258‘.

So having uninstalled and re-installed the plugin, imported and exported my comments, reset the plugin several times and even recreated a new account IntenseDebate did not solve the problem. So up-stepped my Wiz-kid Intern or to give him his real name Muhammed Khalifa. Using his superb programming expertise thought he could solve the problem with a bit of JavaScript. Here is the script he created:

<script type="text/javascript">
/* <![CDATA[ */
var tStr = "mjmobbs.com/http%3a%2f%2f";
var i=0;
var aLink="";
var aNewlink="";
for (i=0; document.links.length; i++) {
aLink = document.links[i].href;
if( aLink.indexOf(tStr) != -1)
{
aNewLink = aLink.replace("http%3a%2f%2fmjmobbs.com%2f%3fp%3d", "?p=");
document.links[i].href = aNewLink;
}
}
/* ]]> */
</script>

What this does is identify any broken links om my blog which include ‘http%3a%2f%2fmjmobbs.com%2f%3fp%3d‘ in them and replaces that string with ‘?p=‘ (the code that is in all the urls of my blog post). Ths code is now hidden away in a widget on the page and will correct any of the broken links that come from the IntenseDebate widget. This may only be a temporary fix until IntenseDebate sorts itself out, but I’m so grateful to him.

Leave a Reply