嗨大家我正在为我的网站使用Facebook评论API
在每个网址中, Facebook Comment 线程处于有效状态
喜欢 id = 2,id = 3
www.mysite.com/page2.php?id=2 对于这5条评论来了
www.mysite.com/page3.php?id=3 这15条评论来了
现在,我想在页面 www.mysite.com/all_comments
上显示总 20条评论我将如何做到这一点。
任何帮助都表示赞赏。
答案 0 :(得分:-1)
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);