Patch for missing access_token
-
This patch fixes the missing data (URL) in the WordPress comments, caused by a missing access_token, and adds a filter for setting the post URL to something else (e.g. to use
http://example.org/some-post
instead ofhttps://example.org/some-post
).--- old/seo-facebook-comments/seofacebook.php 2013-08-28 09:44:01.049463455 +0200 +++ seo-facebook-comments/seofacebook.php 2014-01-11 19:46:15.202779871 +0100 @@ -470,6 +470,11 @@ { global $wpdb; + /** + * Allow filtering of the $postUrl to (for example) always use the non-SSL version for comments. + */ + $postUrl = apply_filters ('fbseocomments_post_url', $postUrl, $postId); + if( empty($postUrl) || empty($postId) ) echo __('You must insert an valid Url and Post ID', $this->_fwork); @@ -482,16 +487,18 @@ 'FROM comment '. 'WHERE object_id in (SELECT comments_fbid FROM link_stat WHERE url ="'.$postUrl.'")', # '.$postUrl.' 'q2' => 'SELECT post_fbid, fromid, object_id, text, time FROM comment WHERE object_id in (SELECT post_fbid FROM #q1)', - 'q3' => 'SELECT name, id, url, pic_square FROM profile WHERE id in (SELECT fromid FROM #q1) or id in (SELECT fromid FROM #q2)', + 'q3' => 'SELECT name, id, url, username, type, pic_square FROM profile WHERE id in (SELECT fromid FROM #q1) or id in (SELECT fromid FROM #q2)', ); $queries = json_encode($queries); $fbquery = array( "method" => "fql.multiquery", "queries" => $queries ); + $access_token = $facebook->getAccessToken(); $result = $facebook->api($fbquery); # Fetch the Authors of the comments $comments['authors'] = $result[2]['fql_result_set']; + # Fetch the comments $comments['comments'] = $result[0]['fql_result_set'];
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Patch for missing access_token’ is closed to new replies.