如何将我的网站Facebook评论放在一个地方

如何将我的网站Facebook评论放在一个地方

本文介绍了如何将我的网站Facebook评论放在一个地方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为我的网站使用Facebook评论API



在每个网址中, 线程处于活动状态



喜欢 id = 2,id = 3



www.mysite.com/page2.php?id=2



www.mysite.com/page3.php?id=3 为此15​​条评论来了



现在,我想在页面上显示总共20条评论 www.mysite.com/all_comments


解决方案


$ b
 只有在您想要获得有关该帖子的评论的帖子ID时,这是可能的

//选择此处的评论总数从facebook发帖
$ fquery =SELECT comment_info FROM stream WHERE post_id ='$ idd。 ;
$ fparam = array('method'=>'fql.query','query'=> $ fquery);
$ fql = $ facebook-> api($ fparam);
$ cmcount = $ fql ['0'] ['comment_info'] ['comment_count'];


/ fetch评论,时间,从当前帖子的ID
$ fquery2 =SELECT fromid,time,text,id FROM comment WHERE post_id ='$ idd 'LIMIT $ setset,$ cmcount;
$ fparam2 = array('method'=>'fql.query','query'=> $ fquery2);
$ fql2 = $ facebook-> api($ fparam2);


Hi Guys I am using Facebook comment API for my website

In this for every url , Facebook Comment thread is active

Like for id=2,id=3

www.mysite.com/page2.php?id=2 for this 5 comments come

www.mysite.com/page3.php?id=3 for this 15 comments come

Now i want to show total 20 comments on a page www.mysite.com/all_comments

How will i do this.

Any help is appreciate.

解决方案
  This is possible only if you have your post id for which you want to get comments on that particular posts

 //Select total no of comments on this post from facebook
    $fquery = "SELECT comment_info FROM stream WHERE post_id ='".$idd."'";
    $fparam = array( 'method' => 'fql.query', 'query' => $fquery );
    $fql = $facebook->api($fparam);
    $cmcount = $fql['0']['comment_info']['comment_count'];


    /fetch comments,time,id from facebook on current post
        $fquery2 = "SELECT fromid, time,text , id  FROM comment WHERE post_id='".$idd."' LIMIT $ofset,$cmcount ";
        $fparam2 = array( 'method' => 'fql.query', 'query' => $fquery2 );
        $fql2 = $facebook->api($fparam2);

这篇关于如何将我的网站Facebook评论放在一个地方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 07:25