From 0941b04d027a39e1a50ed83e4318f1106d248147 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Sun, 24 May 2015 17:51:13 +0100 Subject: [PATCH] fixing our beloved facebook --- importers/keyring-reactions-facebook.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/importers/keyring-reactions-facebook.php b/importers/keyring-reactions-facebook.php index 38a7592..dfa3313 100644 --- a/importers/keyring-reactions-facebook.php +++ b/importers/keyring-reactions-facebook.php @@ -56,16 +56,18 @@ class Keyring_Facebook_Reactions extends Keyring_Reactions_Base { sprintf(__( 'Function is missing for this method (%s), cannot proceed!', 'keyring'), $method) ); - return $this->$func ( $post_id, $silo_id ); + $user_id = $this->service->token->meta['user_id']; + + return $this->$func ( $post_id, $silo_id, $user_id ); } /** * FAVS */ - function get_likes ( $post_id, $silo_id ) { + function get_likes ( $post_id, $silo_id, $user_id ) { $res = array(); - $baseurl = sprintf( "https://graph.facebook.com/v%s/%s/likes?", static::GRAPHAPI, $silo_id ); + $baseurl = sprintf( "https://graph.facebook.com/v%s/%s_%s/likes?", static::GRAPHAPI, $user_id, $silo_id ); $params = array( 'access_token' => $this->service->token->token, @@ -110,9 +112,9 @@ class Keyring_Facebook_Reactions extends Keyring_Reactions_Base { * comments */ - function get_comments ( $post_id, $silo_id ) { + function get_comments ( $post_id, $silo_id, $user_id ) { $res = array(); - $baseurl = sprintf( "https://graph.facebook.com/v%s/%s/comments?", static::GRAPHAPI, $silo_id ); + $baseurl = sprintf( "https://graph.facebook.com/v%s/%s_%s/comments?", static::GRAPHAPI, $user_id, $silo_id ); $params = array( 'access_token' => $this->service->token->token,