profile_setFBML(null, null, $text, null, null, $text); $error_code = null; $error_msg = null; } catch (Exception $e) { $result = null; $error_code = $e->getCode(); $error_msg = $e->getMessage(); } return array($result, $error_code, $error_msg); } function wordbook_fbclient_publishaction_impl($fbclient, $template_id, $template_data, $storysize = FacebookRestClient::STORY_SIZE_SHORT) { try { $method = 'feed.publishUserAction'; $result = $fbclient->feed_publishUserAction($template_id, $template_data, '', '', $storysize); } catch (Exception $e) { $error_code = $e->getCode(); $error_msg = $e->getMessage(); } return array($result, $error_code, $error_msg, $method); } function wordbook_fbclient_getinfo($fbclient, $fields) { try { $uid = $fbclient->users_getLoggedInUser(); $users = $fbclient->users_getInfo(array($uid), $fields); $error_code = null; $error_msg = null; } catch (Exception $e) { $uid = null; $users = null; $error_code = $e->getCode(); $error_msg = $e->getMessage(); } return array($uid, $users, $error_code, $error_msg); } function wordbook_fbclient_has_app_permission($fbclient, $ext_perm) { try { $uid = $fbclient->users_getLoggedInUser(); $has_permission = $fbclient->call_method( 'facebook.users.hasAppPermission', array( 'uid' => $uid, 'ext_perm' => $ext_perm, )); $error_code = null; $error_msg = null; } catch (Exception $e) { $has_permission = null; $error_code = $e->getCode(); $error_msg = $e->getMessage(); } return array($has_permission, $error_code, $error_msg); } function wordbook_fbclient_getsession($fbclient, $token) { try { $result = $fbclient->auth_getSession($token); $error_code = null; $error_msg = null; } catch (Exception $e) { $result = null; $error_code = $e->getCode(); $error_msg = $e->getMessage(); } return array($result, $error_code, $error_msg); } ?>