diff --git a/README.txt b/README.txt index ec8642f2e4b4b704004aaef22fbe2d36f098eb11..5ca2a1bb0a7a321f3f43fb33b63791589cc3b645 100644 --- a/README.txt +++ b/README.txt @@ -16,17 +16,20 @@ documentation for more detailed instructions.) To install or upgrade from an earlier version of Drupal for Facebook: -- This version requires a newer version of the Facebook API. As of - this writing, you can get this via Subversion at - http://svn.facebook.com/svnroot/platform/clients/php/branches/redesign-changes - -- Once you have the new API client, place it somewhere where it can be - loaded, and set a drupal variable, 'fb_api_file', to the location of - facebook.php. For example, first checkout redesign-changes in the - directory where this file is located. Then, add - $conf['fb_api_file'] = 'redesign-changes/facebook.php'; - near the end of your settings.php file. - You will get a cryptic error message until you have done this correctly. +- Make sure you have an up-to-date PHP client from facebook. You may + download a tarball, + http://svn.facebook.com/svnroot/platform/clients/packages/facebook-platform.tar.gz, + or do this with subversion: + svn co http://svn.facebook.com/svnroot/platform/clients/php/trunk + +- If you extract facebook-platform.tar.gz into your modules/fb + directory, it should be found automatically. If this is not the + case, set a drupal variable, 'fb_api_file', to the location of + facebook.php. For example, if you checked the libs out of + subversion, add + $conf['fb_api_file'] = 'sites/all/modules/fb/facebook-platform/facebook.php'; + near the end of your settings.php + Customize the path above as needed for your installation. - If you intend to support canvas pages, install a Facebook-aware theme into one of Drupal's themes directories. One example theme is diff --git a/fb.module b/fb.module index 60761ef0879c26e3ef130068785b4887684d2a2e..5c85fcbed0759af990bfb7c1a3cbd392c28ba55e 100644 --- a/fb.module +++ b/fb.module @@ -158,7 +158,7 @@ function fb_api_init($fb_app, $fbu) { set_exception_handler('fb_handle_exception'); if (!count($cache)) { - $filename = variable_get('fb_api_file', 'facebook-platform/client/facebook.php'); + $filename = variable_get('fb_api_file', 'facebook-platform/php/facebook.php'); if (!file_exists($filename)) { // Print an error directly to the canvas page. diff --git a/fb_canvas.module b/fb_canvas.module index aa2b0a10cfb694773b06d566fdab66709af6bc15..8eb5e0787629a046f926e70a1a4f44a099db9b71 100644 --- a/fb_canvas.module +++ b/fb_canvas.module @@ -89,7 +89,7 @@ function fb_canvas_fb($op, $data, &$return) { //drupal_set_message("fb_canvas_fb" . dpr($_GET, 1) . 'arg(0) = ' . dpr(arg(0), 1) . 'arg(1) = ' . dpr(arg(1), 1) . 'frontpage ' . dpr(variable_get('site_frontpage', 'node'), 1)); if ($_GET['q'] == drupal_get_normal_path(variable_get('site_frontpage', 'node'))) { - if ($fb->api_client->users_isAppAdded()) + if ($fb->api_client->users_isAppUser()) $front = $fb_canvas_data['front_added']; else if ($fb->get_loggedin_user()) $front = $fb_canvas_data['front_loggedin']; diff --git a/fb_user.module b/fb_user.module index 10b5a8e93c678a164bf98cc15f3e3fce6cdd6e48..e3b67824c187b740a68d3e0966aab33c2634b251 100644 --- a/fb_user.module +++ b/fb_user.module @@ -45,7 +45,7 @@ function _fb_user_track($fb, $fb_app, $user) { if (!$user->uid || $user->uid == $fb_user_data['not_logged_in_uid'] || $user->uid == $fb_user_data['logged_in_uid']) { $result =db_query("REPLACE INTO {fb_user_app} (apikey, fbu, added, time_access, session_key, session_key_expires) VALUES ('%s', %d, %d, %d, '%s', %d)", $fb_app->apikey, fb_facebook_user(), - $fb->api_client->users_isAppAdded(), time(), + $fb->api_client->users_isAppUser(), time(), $fb->api_client->session_key, $_REQUEST['fb_sig_expires'] ); } @@ -54,7 +54,7 @@ function _fb_user_track($fb, $fb_app, $user) { $result =db_query("REPLACE INTO {fb_user_app} (apikey, fbu, uid, added, time_access, session_key, session_key_expires) VALUES ('%s', %d, %d, %d, %d, '%s', %d)", $fb_app->apikey, fb_facebook_user(), $user->uid, - $fb->api_client->users_isAppAdded(), time(), + $fb->api_client->users_isAppUser(), time(), $fb->api_client->session_key, $_REQUEST['fb_sig_expires'] ); } @@ -145,7 +145,7 @@ function fb_user_fb($op, $data, &$return) { // Check if we need to create a local account for this user. if (($fb_user_data['create_account'] == FB_USER_OPTION_CREATE_ADD && - $fb->api_client->users_isAppAdded()) || + $fb->api_client->users_isAppUser()) || ($fb_user_data['create_account'] == FB_USER_OPTION_CREATE_LOGIN)) { // Check if the local account is already made. @@ -200,12 +200,12 @@ function fb_user_fb($op, $data, &$return) { // anything related to Drupal accounts. /** I _think_ the new api no longer requires this. TODO: confirm. if (strpos($_GET['q'],'user/login') === 0) { - // Have to check idAppAdded in case of iframe. - if (!$fb->api_client->users_isAppAdded()) + // Have to check idAppUser in case of iframe. + if (!$fb->api_client->users_isAppUser()) $fb->require_login(); } else if (strpos($_GET['q'],'user/register') === 0) { - if (!$fb->api_client->users_isAppAdded()) + if (!$fb->api_client->users_isAppUser()) $fb->require_login(); } */