You are here

README.txt in Drupal for Facebook 7.3

Same filename in this branch
  1. 7.3 README.txt
  2. 7.3 contrib/README.txt
Same filename and directory in other branches
  1. 5.2 README.txt
  2. 5 README.txt
  3. 6.3 README.txt
  4. 6.2 README.txt
  5. 7.4 README.txt
Drupal for Facebook
-------------------

Project Home:
http://www.drupalforfacebook.org, http://drupal.org/project/fb

Primary author and maintainer: Dave Cohen (http://www.dave-cohen.com/contact)
Do  NOT contact  the  maintainer  with a question  that  can be  easily
answered with a web search.  You may not receive a reply.

Branch: 7.x-3.x (version 3.x for Drupal 7.x)

This file is more current than online documentation.  When in doubt,
trust this file.  Online documentation: http://drupal.org/node/195035,
has more detail and you should read it next..

To upgrade from Drupal 6 to Drupal 7:
- Upgrade your D6 version to 3.3 or later.  Run update.php and make sure everything seems to work.  Then upgrade drupal and all modules to D7 branch.


To upgrade from D7 version to the next:
- Read the upgrade instructions: http://drupal.org/node/936958

To install:

- Make sure you have a PHP client from facebook (version >= 3.1.1).
  The 2.x.y versions are not supported by this version of Drupal for Facebook.
  Download from https://github.com/facebook/facebook-php-sdk.
  Extract the files, and place them in sites/all/libraries/facebook-php-sdk.

  If you have the Libraries API module installed, you may place the files in
  another recognised location (such as sites/all/libraries), providing that the
  directory is named 'facebook-php-sdk'.

  Or, to manually set the location of the php-sdk in any other
  directory, edit your settings.php to include a line similar to the
  one below. Add to the section where the $conf variable is defined,
  or the very end of settings.php. And customize the path as needed.

  $conf['fb_api_file'] = 'sites/all/libraries/facebook-php-sdk/src/facebook.php';

  See also http://drupal.org/node/923804

- Your theme needs the following attribute at the end of the <html> tag:

  xmlns:fb="http://www.facebook.com/2008/fbml"

  Drupal 7 should include this by default.  Use your browser's view source feature to confirm.
  If not, you may need to edit your theme's html.tpl.php file.  See
  http://www.drupalforfacebook.org/node/1106.  Note this applies to
  themes used for Facebook Connect, iframe Canvas Pages, and Social
  Plugins (i.e. like buttons).  Without this attribute, IE will fail.

  Note that some documention on facebook.com suggests
  xmlns:fb="http://ogp.me/ns/fb#" instead of the URL above.  Try that
  if the above is not working for you.


- To support canvas pages and/or page tabs, url rewriting and other
  settings must be initialized before modules are loaded, so you must
  add this code to your settings.php.  This is done by adding these
  two lines to the end of sites/default/settings.php (or
  sites/YOUR_DOMAIN/settings.php).

  include "sites/all/modules/fb/fb_url_rewrite.inc";
  include "sites/all/modules/fb/fb_settings.inc";

  (Change include paths if modules/fb is not in sites/all.)

- For canvas pages, add something like this to your settings.php:

  if (!headers_sent()) {
    header('P3P: CP="We do not have a P3P policy."');
  }

  See http://drupal.org/node/933994 and search for "P3P" for details.

- Go to Administer >> Site Building >> Modules and enable the Facebook
  modules that you need.

  Enable fb.module for Social Plugins.

  Enable fb_devel.module and keep it enabled until you have everything
  set up. You should disable this on your live server once you are
  certain facebook features are working. (Note this requires
  http://drupal.org/project/devel, which is well worth installing
  anyway.)

  Enable fb_app.module and fb_user.module if you plan to create
  facebook applications.

  Enable fb_connect.module for Facebook Connect and/or
  fb_canvas.module for Canvas Page apps.

  Create a new Text Format that does not restrict/clean HTML tags and use it
  in blocks and nodes. Other Text Formats (formerly called Input Formats in D6)
  like the built-in Full HTML Text Format actually mangle FB tags like <fb:like>.

  Pages at http://drupal.org/node/932690 will help you decide which
  other modules you need to enable for your particular needs.


To support Facebook Connect, Canvas Pages, and/or Social Plugins that
require an Application, read on...

- You must enable clean URLs. If you don't, some links that drupal
  creates will not work properly on canvas pages.

- Create an application on Facebook, currently at
  https://developers.facebook.com/apps (click "create new app").  Fill
  in the minimum required to get an apikey and secret.  If supporting
  canvas pages, specify a canvas name, too.  You may ignore other
  settings for now.

- Go to Administer >> Site Building >> Facebook Applications and click
  the Add Applicaiton tab.  Use the app id, apikey and secret that
  Facebook has shown you.  Hopefully other settings will be
  self-explanitory.  When you submit your changes, Drupal for Facebook
  will automatically set the callback URL and some other properties
  which help it work properly.


Troubleshooting:
---------------

Reread this file and follow instructions carefully.

Read http://drupal.org/node/933994, and all the module documentation
on http://drupal.org/node/912614.

Enable the fb_devel.module and add the block it provides (called
"Facebook Devel Page info") to the footer of your Facebook theme.
fb_devel.module will catch some errors and write useful information to
Drupal's log and status page.

Use your browser's view source feature, and search page source for any
<script> tag which includes facebook's javascript,
"http://connect.facebook.net/en_US/all.js".  fb.js will include this
for you.  Including it too soon will break many features.  So remove
it from any block, node, template or whatever that adds it to the
page.  Similarly, do not include any <div id="fb-root">.

Disable Global Redirect, if you have that module installed.  Users
have reported problems with it and Drupal for Facebook.  Any module
which implements custom url rewrites could interfere with canvas page
and profile tab support.

On the facebook side, make sure your application is not in "sandbox
mode".  This is known to have unwanted side effects.  Also, don't use
a test account. If you've used a test account, ever, even for another
application, clear all your browser's cookies.  Try to reproduce the
problem not in sandbox mode, and not using a test account.

Bug reports and feature requests may be submitted.
Here's an idea: check the issue queue before you submit
http://drupal.org/project/issues/fb

If you do submit an issue, start the description with "I read the
README.txt from start to finish," and you will get a faster, more
thoughtful response. Seriously, prove that you read this far.

Below are more options for your settings.php. Add the PHP shown below
to the very end of your settings.php, and modify the paths accordingly
(i.e. where this example has "sites/all/modules/fb", you might need
"profiles/custom/modules/fb").




//// Code to add to settings.php:
/////////////////////////////////

/**
 * Drupal for Facebook settings.
 */

if (!is_array($conf))
  $conf = array();

$conf['fb_verbose'] = TRUE; // debug output
//$conf['fb_verbose'] = 'extreme'; // for verbosity fetishists.

// More efficient connect session discovery.
// Required if supporting one connect app and different canvas apps.
//$conf['fb_id'] = '123.....XYZ'; // Your connect app's ID goes here.

// Enable URL rewriting (for canvas page apps).
include "sites/all/modules/fb/fb_url_rewrite.inc";
include "sites/all/modules/fb/fb_settings.inc";

// Header so that IE will accept cookies on canvas pages.
if (!headers_sent()) {
  header('P3P: CP="We do not have a P3P policy."');
}

// end of settings.php

File

README.txt
View source
  1. Drupal for Facebook
  2. -------------------
  3. Project Home:
  4. http://www.drupalforfacebook.org, http://drupal.org/project/fb
  5. Primary author and maintainer: Dave Cohen (http://www.dave-cohen.com/contact)
  6. Do NOT contact the maintainer with a question that can be easily
  7. answered with a web search. You may not receive a reply.
  8. Branch: 7.x-3.x (version 3.x for Drupal 7.x)
  9. This file is more current than online documentation. When in doubt,
  10. trust this file. Online documentation: http://drupal.org/node/195035,
  11. has more detail and you should read it next..
  12. To upgrade from Drupal 6 to Drupal 7:
  13. - Upgrade your D6 version to 3.3 or later. Run update.php and make sure everything seems to work. Then upgrade drupal and all modules to D7 branch.
  14. To upgrade from D7 version to the next:
  15. - Read the upgrade instructions: http://drupal.org/node/936958
  16. To install:
  17. - Make sure you have a PHP client from facebook (version >= 3.1.1).
  18. The 2.x.y versions are not supported by this version of Drupal for Facebook.
  19. Download from https://github.com/facebook/facebook-php-sdk.
  20. Extract the files, and place them in sites/all/libraries/facebook-php-sdk.
  21. If you have the Libraries API module installed, you may place the files in
  22. another recognised location (such as sites/all/libraries), providing that the
  23. directory is named 'facebook-php-sdk'.
  24. Or, to manually set the location of the php-sdk in any other
  25. directory, edit your settings.php to include a line similar to the
  26. one below. Add to the section where the $conf variable is defined,
  27. or the very end of settings.php. And customize the path as needed.
  28. $conf['fb_api_file'] = 'sites/all/libraries/facebook-php-sdk/src/facebook.php';
  29. See also http://drupal.org/node/923804
  30. - Your theme needs the following attribute at the end of the tag:
  31. xmlns:fb="http://www.facebook.com/2008/fbml"
  32. Drupal 7 should include this by default. Use your browser's view source feature to confirm.
  33. If not, you may need to edit your theme's html.tpl.php file. See
  34. http://www.drupalforfacebook.org/node/1106. Note this applies to
  35. themes used for Facebook Connect, iframe Canvas Pages, and Social
  36. Plugins (i.e. like buttons). Without this attribute, IE will fail.
  37. Note that some documention on facebook.com suggests
  38. xmlns:fb="http://ogp.me/ns/fb#" instead of the URL above. Try that
  39. if the above is not working for you.
  40. - To support canvas pages and/or page tabs, url rewriting and other
  41. settings must be initialized before modules are loaded, so you must
  42. add this code to your settings.php. This is done by adding these
  43. two lines to the end of sites/default/settings.php (or
  44. sites/YOUR_DOMAIN/settings.php).
  45. include "sites/all/modules/fb/fb_url_rewrite.inc";
  46. include "sites/all/modules/fb/fb_settings.inc";
  47. (Change include paths if modules/fb is not in sites/all.)
  48. - For canvas pages, add something like this to your settings.php:
  49. if (!headers_sent()) {
  50. header('P3P: CP="We do not have a P3P policy."');
  51. }
  52. See http://drupal.org/node/933994 and search for "P3P" for details.
  53. - Go to Administer >> Site Building >> Modules and enable the Facebook
  54. modules that you need.
  55. Enable fb.module for Social Plugins.
  56. Enable fb_devel.module and keep it enabled until you have everything
  57. set up. You should disable this on your live server once you are
  58. certain facebook features are working. (Note this requires
  59. http://drupal.org/project/devel, which is well worth installing
  60. anyway.)
  61. Enable fb_app.module and fb_user.module if you plan to create
  62. facebook applications.
  63. Enable fb_connect.module for Facebook Connect and/or
  64. fb_canvas.module for Canvas Page apps.
  65. Create a new Text Format that does not restrict/clean HTML tags and use it
  66. in blocks and nodes. Other Text Formats (formerly called Input Formats in D6)
  67. like the built-in Full HTML Text Format actually mangle FB tags like .
  68. Pages at http://drupal.org/node/932690 will help you decide which
  69. other modules you need to enable for your particular needs.
  70. To support Facebook Connect, Canvas Pages, and/or Social Plugins that
  71. require an Application, read on...
  72. - You must enable clean URLs. If you don't, some links that drupal
  73. creates will not work properly on canvas pages.
  74. - Create an application on Facebook, currently at
  75. https://developers.facebook.com/apps (click "create new app"). Fill
  76. in the minimum required to get an apikey and secret. If supporting
  77. canvas pages, specify a canvas name, too. You may ignore other
  78. settings for now.
  79. - Go to Administer >> Site Building >> Facebook Applications and click
  80. the Add Applicaiton tab. Use the app id, apikey and secret that
  81. Facebook has shown you. Hopefully other settings will be
  82. self-explanitory. When you submit your changes, Drupal for Facebook
  83. will automatically set the callback URL and some other properties
  84. which help it work properly.
  85. Troubleshooting:
  86. ---------------
  87. Reread this file and follow instructions carefully.
  88. Read http://drupal.org/node/933994, and all the module documentation
  89. on http://drupal.org/node/912614.
  90. Enable the fb_devel.module and add the block it provides (called
  91. "Facebook Devel Page info") to the footer of your Facebook theme.
  92. fb_devel.module will catch some errors and write useful information to
  93. Drupal's log and status page.
  94. Use your browser's view source feature, and search page source for any