Skip to content
README.txt 4.9 KiB
Newer Older
Drupal for Facebook
-------------------
Dave Cohen's avatar
Dave Cohen committed
More information:
http://www.drupalforfacebook.org, http://drupal.org/project/fb
Dave Cohen's avatar
Dave Cohen committed

Primary author and maintainer: Dave Cohen (http://www.dave-cohen.com/contact)
Dave Cohen's avatar
Dave Cohen committed
Do  NOT contact  the  maintainer  with a question  that  can be  easily
answered with a web search.  You will not receive a reply.
Branch: DRUPAL-6--3 (version 3.x for Drupal 6.x)
Dave Cohen's avatar
Dave Cohen committed
This file is more current than online documentation.  When in doubt, trust this file.
Online documentation: http://drupal.org/node/195035, has more detail.
Dave Cohen's avatar
Dave Cohen committed
To upgrade:

Dave Cohen's avatar
Dave Cohen committed
- Read the upgrade instructions: http://drupal.org/node/936958
Dave Cohen's avatar
Dave Cohen committed

To install:
Dave Cohen's avatar
Dave Cohen committed

- Make sure you have an up-to-date PHP client from facebook.
Dave Cohen's avatar
Dave Cohen committed
  Download from http://github.com/facebook/php-sdk.
  Extract the files, and place them in sites/all/libraries/facebook-php-sdk.
Dave Cohen's avatar
Dave Cohen committed
  Or, To find the php-sdk in any other directory, edit your
  settings.php to include a line similar to this (add to section where
  $conf variable is defined, or very end of settings.php. And
  customize the path as needed.):
Dave Cohen's avatar
Dave Cohen committed
  $conf['fb_api_file'] = 'sites/all/libraries/facebook-php-sdk/src/facebook.php';
Dave Cohen's avatar
Dave Cohen committed
- Your theme needs the following attribute at the end of the <html> tag:
Dave Cohen's avatar
Dave Cohen committed

  xmlns:fb="http://www.facebook.com/2008/fbml"
Dave Cohen's avatar
Dave Cohen committed

  Typically, this means editing your theme's page.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.
Dave Cohen's avatar
Dave Cohen committed

Dave Cohen's avatar
Dave Cohen committed
- To support canvas pages, url rewriting and other settings must be
  initialized before modules are loaded, so you must add this code to
  your settings.php.  This is easily done by adding these two lines to
  the end of sites/_____/settings.php (usually
  sites/default/settings.php).
Dave Cohen's avatar
Dave Cohen committed

  include "sites/all/modules/fb/fb_url_rewrite.inc";
Dave Cohen's avatar
Dave Cohen committed
  include "sites/all/modules/fb/fb_settings.inc";
Dave Cohen's avatar
Dave Cohen committed
  (Remember to change the path if modules/fb is not in sites/all.)
Dave Cohen's avatar
Dave Cohen committed
- Go to Administer >> Site Building >> Modules and enable the Facebook
  modules.
Dave Cohen's avatar
Dave Cohen committed
  Enable fb.module for Social Plugins.
Dave Cohen's avatar
Dave Cohen committed
  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.


Dave Cohen's avatar
Dave Cohen committed
To support Facebook Connect and/or Canvas Pages, 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
Dave Cohen's avatar
Dave Cohen committed
  http://www.facebook.com/developers/editapp.php?new.  Fill in the
  minimum required to get an apikey and secret.  If supporting canvas
  pages, get a canvas name, too.
Dave Cohen's avatar
Dave Cohen committed
- Go to Administer >> Site Building >> Facebook Applications and click
  the Add Applicaiton tab.  Use the apikey and secret that Facebook
  has shown you.  If you have any trouble with the other fields, use
  Facebook's documentation to figure it out.  When you submit your
  changes, Drupal for Facebook will automatically set the callback URL
  and some other properties which help it work properly.
Dave Cohen's avatar
Dave Cohen committed
Troubleshooting:
Reread this file and follow instructions carefully.
Read http://drupal.org/node/933994, and all the module documentation
on drupal.org.

Dave Cohen's avatar
Dave Cohen committed
Enable the fb_devel.module and add the block it provides (called
"Facebook Devel Page info") to the footer of your Facebook theme.
Disable Global Redirect, if you have that module installed.  Users
have reported problems with it and Drupal for Facebook.

Dave Cohen's avatar
Dave Cohen committed
Bug reports and feature requests may be submitted.
Here's an idea: check the issue queue before you submit

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.
Dave Cohen's avatar
Dave Cohen committed
Below are more options for your settings.php.  Add the PHP shown below
Dave Cohen's avatar
Dave Cohen committed
to the very end of your settings.php, and modify the paths accordingly
Dave Cohen's avatar
Dave Cohen committed
(i.e. where I use "sites/all/modules/fb", you might need
//// Code to add to settings.php:
Dave Cohen's avatar
Dave Cohen committed
/////////////////////////////////
Dave Cohen's avatar
Dave Cohen committed
 * Drupal for Facebook settings.
Dave Cohen's avatar
Dave Cohen committed
 */

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

$conf['fb_verbose'] = TRUE; // debug output
//$conf['fb_verbose'] = 'extreme'; // for verbosity fetishists.
Dave Cohen's avatar
Dave Cohen committed
// More efficient connect session discovery.
Dave Cohen's avatar
Dave Cohen committed
// Required if supporting one connect app and different canvas apps.
Dave Cohen's avatar
Dave Cohen committed
//$conf['fb_apikey'] = '123.....XYZ'; // Your connect app's apikey goes here.
Dave Cohen's avatar
Dave Cohen committed
// Enable URL rewriting (for canvas page apps).
include "sites/all/modules/fb/fb_url_rewrite.inc";
Dave Cohen's avatar
Dave Cohen committed
include "sites/all/modules/fb/fb_settings.inc";
Dave Cohen's avatar
Dave Cohen committed
// end of settings.php