Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Facebook Comment Integration
First off, I’m new to textpattern. From what I see I definitely like. It appears to be immensely extendable if you have any knowledge of code.
Now on to my issue. Currently I’m trying to integrate Facebook Commenting into the site I’m working on.
How would I go about doing this? Which form would I put the FBML in? Comments, comments_display, or comment_form?
Thanks in advance for your help!
Offline
Re: Facebook Comment Integration
Search the forums for a ‘Facebook Connect’ thread or two. It’s not readily doable but under discussion.
Last edited by whaleen (2010-04-05 09:31:58)
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: Facebook Comment Integration
Someone has done it already according to this facebook developer forum post here about halfway down the page response #362 is the number I believe. If it can’t be done I’ll have to scrap textpattern…which I def don’t want to do.
To save you looking this is what he claims to have as his code…
<txp:if_comments_allowed>
<fb:comments></fb:comments>
<script type="text/javascript">
FB.init("abcdefghijklmnopqrstuvwxyz1234567890","/xd_receiver.htm");
</script>
<txp:else />
Comments are disable for this article.
</txp:if_comments_allowed>
Last edited by wesy2kn1 (2010-04-06 05:22:37)
Offline
Offline
Re: Facebook Comment Integration
Yea these are my posts in these links
What is the most important thing by using the comments-box is to always set the “xid” & “url” attributes.
(they are already in the example code in the link you post, I just mention it again)
If you want to change the style of the comments box with CSS so I also created a sample here
If you only want to change the white-man-anonymous image check this
Offline
Re: Facebook Comment Integration
THE BLUE DRAGON wrote:
Yea these are my posts in these links
What is the most important thing by using the comments-box is to always set the “xid” & “url” attributes.
(they are already in the example code in the link you post, I just mention it again)
If you want to change the style of the comments box with CSS so I also created a sample here
If you only want to change the white-man-anonymous image check this
Thanks a ton Blue Draggon! I don’t care to integrage facebook with the existing comments system, I’m just going to use they’re comments box all together.
Last edited by wesy2kn1 (2010-04-05 11:17:37)
Offline
Re: Facebook Comment Integration
Here’s my problem, Blue Dragon. I need a way for Textpattern and Facebook comments to co-exist, meaning that using FBConnect is optional and users can otherwise use my default comments_form. I don’t think your solution does this but please correct me if I’m wrong. I tried this:
<fb:comments xid="<txp:article_id />" url="<txp:permlink />" title="<txp:title />"></fb:comments>
But that doesn’t work. FBConnect works fine, and only works, when I just use this simple code:
<fb:comments></fb:comments>
If I could get your code to work it seems like it would go a bit further in integrating the two, but not so far as to display the textpattern commenting system by default and hiding it when a user logs in with Facebook.
Last edited by th3lonius (2010-06-05 06:40:27)
Offline
Re: Facebook Comment Integration
th3lonius wrote:
I need a way for Textpattern and Facebook comments to co-exist
For this you need to know JS/PHP (I don’t :/ )
If you do so you can use the new Facebook:
SDK script + FQL (table: comment) + Old REST API (tables: comments.get, comments.add, comments.remove, comment_info)
th3lonius wrote:
I tried this:
<fb:comments xid="<txp:article_id />" url="<txp:permlink />" title="<txp:title />"></fb:comments>
But that doesn’t work.
1. It’s needs to work (if it’s into article-form or between article/article_custom tags)
2. The code in my old post is the old version, you need to use the new script. follow my tutorial here
Offline
Re: Facebook Comment Integration
Thanks man. This is definitely worth a ransom by the way. I hope we have a textpattern user out there who is also a Facebook developer ;), or at least is very familiar with their API.
Hey, I just thought of something, Blue Dragon. I’m considering just dropping the textpattern comment system for now to use Facebook. If I do this I need to retain the “recent comments” functionality as I’m currently displaying a long list of said comments in the sidebar of my site. Do you know how to accomplish this with the Facebook API?
Last edited by th3lonius (2010-06-06 06:31:52)
Offline
Re: Facebook Comment Integration
th3lonius wrote:
Do you know how to accomplish this with the Facebook API?
Yes and No:
Yes: You need to use FQL to get all your comments, you can see this PHP SDK tutorial .
and this is the query you need to use:
//COMMENTS
try{
$from = '946684800';
$to = '1577836800';
$comments = "SELECT fromid, text, id, time, username, xid, object_id FROM comment WHERE time > $from AND time < $to AND xid IN (SELECT xid FROM comments_info WHERE app_id = $fbconfig[appid] AND updated_time > $from AND updated_time < $to) ORDER BY time desc";
$param2 = array(
'method' => 'fql.query',
'query' => $comments,
'callback' => ''
);
$comment = $facebook->api($param2);
}
No: I don’t know how to limit it for just 5 comments
And I don’t know how to custom the output.
For this you need a basic knowledge in PHP which I don’t have yet :/
Offline
Re: Facebook Comment Integration
Well thanks for getting me started on it. I know some PHP so I think I’m going to go that route.
Offline
#12 2010-06-07 20:30:33
- Vide-Dressing
- Member
- Registered: 2010-06-07
- Posts: 31
Re: Facebook Comment Integration
If you find anything new please share it. I really need this feature.
Offline