Two Problems with Facebook Connect and Movable Type 4.23

Just upgraded to MT 4.23. Works fine. Rebuilt everything, can comment, post, etc, etc. No problems at all. So I installed the Facebook Connect plugin (I understand the plugin is in beta) and have all types of problems. First of all, FB comments work. I have that working just fine. You can see that in action here.

I had to take the tag out of the header though because of a bunch of Javascript errors. I am guessing the conflicts were preventing the mt.js file from doing the job of hiding the Name, Email, and URL fields once you are an authenticated user of any kind. Here is a screen cap (click to embiggen):

Once I take out of the HEAD the site works again as it should. That is only issue #1 I am having with Facebook Connect.

Issue #2 comes when I try and pull in the Facebook Userpic and MT native Userpic at the same time.

Here is the code I use for the Comment Detail template:

<div class="comment<mt:If name="__last__"> last
</mt:If>
"
<mt:IfArchiveTypeEnabled archive_type="Individual"> id="comment-
<$mt:CommentID$>
"</mt:IfArchiveTypeEnabled>
>
<div class="inner">
<div class="comment-header">
<div class="asset-meta">
<$mt:Include module="Userpic" userpic_size="36" userpic_type="commenter"$>
<span class="byline">
<mt:setvarblock name="comment_author_link"> <span class="vcard author">
<mt:IfCommenterIsAuthor> <a href="<$mt:Var name="profile_view_url" encode_html="1"$>
<$mt:CommenterID$>
">
<$mt:CommenterName$>
</a>
<mt:Else>
<$mt:CommentAuthorLink$>
</mt:IfCommenterIsAuthor>
</span> </mt:setvarblock>
<mt:IfCommentParent>
<$mt:var name="comment_author_link"$>
replied to <a href="<mt:CommentParent><$mt:CommentLink$></mt:CommentParent>">comment from
<mt:CommentParent>
<$mt:CommentAuthor$>
</mt:CommentParent>
</a>
<mt:Else>
<$mt:var name="comment_author_link"$>
</mt:IfCommentParent>
<span class="separator">|</span> <a href="<$mt:CommentLink$>"><abbr class="published" title="<$mt:CommentDate format_name="iso8601"$>">
<$mt:CommentDate$>
</abbr></a>
<mt:Unless name="comment">
<mt:IfCommentsAccepted> <span class="separator">|</span>
<$mt:CommentReplyToLink$>
</mt:IfCommentsAccepted>
</mt:Unless>
</span> </div>
</div>
<div class="comment-content">
<$mt:CommentBody$>
</div>
</div>
</div>

And Userpic Module:

<div class="user-pic">
<mt:If name="userpic_type" eq="profile">
<img src="<mt:If tag="AuthorUserpicURL"><$mt:AuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" />
<mt:Else name="userpic_type" eq="commenter">
<mt:IfCommenterIsAuthor><mt:ignore>IF NATIVE MTCS USER</mt:ignore>
<a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:CommenterID$>"><img
src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
<mt:Else>
<mt:If tag="CommenterID"><mt:ignore>IF AUTHENTICATED USER (OPENID, VOX, LJ, ETC)</mt:ignore>
<a href="<$mt:CommenterURL$>">
<img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" />
<mt:If tag="CommenterAuthIconURL"><span class="auth-icon"><img src="<$mt:CommenterAuthIconURL size="logo_small"$>" alt="<$mt:CommenterAuthType$>"/></span></mt:If>
</a>
<mt:Else><mt:ignore>ELSE ANONYMOUS COMMENTER</mt:ignore>
<a href="<$mt:CommentURL$>"><img src="<mt:If tag="CommenterUserpic"><$mt:CommenterUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
</mt:If>
</mt:IfCommenterIsAuthor>
<mt:Else name="userpic_type" eq="userlist">
<a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:AuthorID$>"><img
src="<mt:If tag="AuthorUserpicURL"><$mt:AuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
<mt:Else>
<a href="<$mt:Var name="profile_view_url" encode_html="1"$><$mt:EntryAuthorID$>"><img
src="<mt:If tag="EntryAuthorUserpicURL"><$mt:EntryAuthorUserpicURL$><mt:Else><$mt:StaticWebPath$>images/default-userpic-90.jpg</mt:If>"
width="<$mt:Var name="userpic_size"$>" height="<$mt:Var name="userpic_size"$>" alt="user-pic" /></a>
</mt:If>
</div>

This works and displays the MT Userpics. I also like how it uses the Userpics module. Now, the code that comes bundled in the README of the Facebook Connect plugin works and it does not. It does pull in the Facebook Userpic, but it makes all the MT Userpics blank, using the default image as if my users never added a Userpic to their profile.

So here is that code, which combines the Template and the Module into one template:

<div class="comment"<MTIfArchiveTypeEnabled archive_type="Individual"> id="comment-<$MTCommentID$>"</MTIfArchiveTypeEnabled>>
<div class="inner">
<div class="comment-header">
<div class="user-pic<mt:if tag="CommenterAuthType" eq="Facebook"> comment-fb-<$MTCommenterUsername></mt:if>">

<mt:if tag="CommenterAuthType" eq="Facebook">
<a href="http://www.facebook.com/profile.php?id=<$MTCommenterUsername>" class="auth-icon"><img src="<$MTCommenterAuthIconURL size="logo_small"$>" alt="<$mt:CommenterAuthType$>"/></a>
<fb:profile-pic uid="<$MTCommenterUsername>" size="square" linked="true"><img src="http://static.ak.connect.facebook.com/pics/q_default.gif" /></fb:profile-pic>

<mt:else>
<mt:if tag="CommenterAuthIconURL">
<a href="<$MTCommenterURL>" class="auth-icon"><img src="<$MTCommenterAuthIconURL size="logo_small"$>" alt="<$mt:CommenterAuthType$>"/></a>
</mt:if>
<img src="<$MTStaticWebPath>images/default-userpic-50.jpg" />
</mt:if>
</div>

<div class="asset-meta">
<span class="byline">
<mt:if tag="CommenterAuthType" eq="Facebook">
By <span class="vcard author"><fb:name uid="<$MTCommenterUsername>" linked="true" useyou="false"><a href="http://www.facebook.com/profile.php?id=<$MTCommenterUsername>"><$MTCommenterName></a></fb:name></span> on <a href="#comment-<$MTCommentID$>"><abbr class="published" title="<$MTCommentDate format_name="iso8601"$>"><$MTCommentDate$></abbr></a></span>

<mt:else>
By <span class="vcard author"><mt:if tag="CommenterURL"><a href="<mt:CommenterURL>"><$MTCommentAuthor default_name="Anonymous" $></a><mt:else><mt:CommentAuthorLink default_name="Anonymous" show_email="0"></mt:if></span><MTIfNonEmpty tag="CommentAuthorIdentity"><$MTCommentAuthorIdentity$></MTIfNonEmpty> on <a href="#comment-<$MTCommentID$>"><abbr class="published" title="<$MTCommentDate format_name="iso8601"$>"><$MTCommentDate$></abbr></a></span>
</mt:if>
</span>
</div>
</div>
<div class="comment-content">
<$MTCommentBody$>
</div>
</div>
</div>

I Hope someone in the MT community can help me out with these two problems.

Comments (1)

Did you ever solve this problem? I'm getting similar javascript errors.

I think their is a conflict in to MT javascript events

Facebook adds this:
mtAttachEvent('load', facebook_onload);

and MT's mt.js file has this:
mtAttachEvent("load", mtEntryOnLoad);
mtAttachEvent("unload", mtEntryOnUnload);

Unfortunately, you can't have two events attached to "load" for when the page loads. So what happens on my blog is the MT sign-in link goes away. With no sign-in, Facebook commenters (or OpenID, Typekey, etc.) can't sign in to comment.

If I change the Facebook event to "load2" I get my sign-in back.

Is that pretty much what is happening to you as well?

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Warning: include(/home/meancode/public_html/breakingwindows/footer.php): failed to open stream: Permission denied in /home/breaking/public_html/2008/12/two_problems_with_facebook_con.php on line 326

Warning: include(): Failed opening '/home/meancode/public_html/breakingwindows/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/breaking/public_html/2008/12/two_problems_with_facebook_con.php on line 326

Blogcritics Magazine

Social Networking

Mac Headlines

Read up-to-date headlines on everything Mac.

Content provided by prMac.

ESRB Search

Creative Commons License
This weblog is licensed under a Creative Commons License.
Enhanced with Snapshots