PermaLink Blogsphere "Contact Me" feature for MSN06/05/2006 04:29 PM
For what its worth, to whomever its worth,

The contact me feature of the  blogshere, on the contact details of the Blog Configuration page does produces a JavaScript error when used.        

\"MSN\"
Anchor := "<a onclick=\"DoInstantMessage('"+x2+"','"+x2+"');return false;\" href=\"\">"+ @Word(x2;"@";1) +"</a>";
img  + " - "+ Anchor +"<br/>"+
"<OBJECT height='1' id='MsgrObj' width='1'></OBJECT><script>function DoInstantMessage(person,screen){try{MsgrObj.classid='clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28';}catch(e){if(!(e.number && 2148139390) == 2148139390)return;}if(MsgrObj.MyStatus == 1){ alert('You are not logged into Messenger." + "\\n" +"You must login to Messenger before continuing.'); return; }try{var contact = MsgrObj.GetContact(person,'');} catch(e){ if((e.number && 2164261642) == 2164261642){if(confirm('Add '+screen+' to your contact list?')==true)MsgrObj.AddContact(0,person);} }if(confirm('Send '+screen+' an instant message?')==true)MsgrObj.InstantMessage(person); } </script>"



Looks like its just a regression bug or something, the JavaScript function "DoInstantMessage" is not in the template anymore.

I've re-worked the "Contact_msn" field of the "D6.SideBlocks" Subform to produce the Object tag and the script if needed, otherwise exit out quietly.

Also, since the MSN address is a fully qualified name, it is much longer and with the default CSS it causes wrapping problems, I've trimmed down display portion to be just the part to the left of the @ sign.

@If(@GetProfileField("BlogConfig";"Conf_Contact_Show_msn")!="Yes";@Return("");"");
x2 := @GetProfileField("BlogConfig";"Conf_Contact_msn");
IMG := "<img alt=\"MSN\" src=\""+Status_Server+"msn/"+x2+"\" title=\"MSN Messenger\">";

Anchor := "<a onclick=\"DoInstantMessage('"+x2+"','"+x2+"');return false;\" href=\"\">"+ @Word(x2;"@";1) +"</a>";
img  + " - "+ Anchor +"<br/>"+
"<OBJECT height='1' id='MsgrObj' width='1'></OBJECT><script>function DoInstantMessage(person,screen){try{MsgrObj.classid='clsid:B69003B3-C55E-4B48-836C-BC5946FC3B28';}catch(e){if(!(e.number && 2148139390) == 2148139390)return;}if(MsgrObj.MyStatus == 1){ alert('You are not logged into Messenger." + "\\n" +"You must login to Messenger before continuing.'); return; }try{var contact = MsgrObj.GetContact(person,'');} catch(e){ if((e.number && 2164261642) == 2164261642){if(confirm('Add '+screen+' to your contact list?')==true)MsgrObj.AddContact(0,person);} }if(confirm('Send '+screen+' an instant message?')==true)MsgrObj.InstantMessage(person); } </script>"


I pulled the code from Declan Lynch's post over 3 years ago.

This version requires of script a real MSN client to be loaded, and will not send messages over trillian to the MSN network.  I've looked into adding a section for checking to see if Trillian is loaded, but, I was unable to find any shared objects to use, similar to the Microsoft object specified by clsid above.

Any thoughts?
Comments :v
No comments.
Add Manual Trackback
Please enter the details of the trackback post. Your trackback will not appear on the site until it has been verified. This won't be immediate, as trackbacks are validated on a scheduled basis. Be patient.











Powered By :

BlogSphere

Join The WebLog Revolution at BlogSphere.net

Dwight Pic
Hot Links
These are my heavy hitters
MSDN DHTML Objects
MSDN JScript

Contact Me
Left Block 3
Todays Referrers
No Referrals
RSS News Feed RSS Comments Feed Geo URL Blog Admin OpenNTF BlogSphere