Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2010-11-09 20:22:43

Sono Juventino
Member
From: Skedsmo, Norway
Registered: 2007-12-22
Posts: 81

Re: Facebook Comment Integration

        //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 LIMIT 5";
            $param2  =   array(
                'method'    => 'fql.query',
                'query'     => $comments,
                'callback'  => ''
            );
            $comment    =   $facebook->api($param2);
        }

I think you could solve this with simple SQL. Limit 5 should show only the latest 5 comments.

Not tested this, but I think it’ll work. Only difference here compaired to the code some post above is “LIMIT 5” in $comments.

Offline

Board footer

Powered by FluxBB