Hello,
I never created a facebook app before and can't figure out now how to do this with this module.
All I want is to show a list of my facebook friends on a single page.
Up to now I did the following:
1. Installed and enabled "drupal for facebook" module
2. Created a facebook app "FriendList" on facebook.com
3. Added the app at "admin/build/fb/fb_app_create"
But...where can I define what the app does?
On the facebook application site there is an example code which seems to do exactly what I want:
// Copyright 2007 Facebook Corp. All Rights Reserved.
//
// Application: FriendList
// File: 'index.php'
// This is a sample skeleton for your application.
//
require_once 'facebook.php';
$appapikey = 'xxx';
$appsecret = 'yyy';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
// Greet the currently logged-in user!
echo "<p>Hello, <fb:name uid=\"$user_id\" useyou=\"false\" />!</p>";
// Print out at most 25 of the logged-in user's friends,
// using the friends.get API method
echo "<p>Friends:";
$friends = $facebook->api_client->friends_get();
$friends = array_slice($friends, 0, 25);
foreach ($friends as $friend) {
echo "<br>$friend";
}
echo "</p>";
Where have I to put this code to? Do I need to develop a new module?
Please point me to the right direction, thanks!
Greetz haggis
Comments
Comment #1
haggins commentedI tried to put the above example code into a node with php-filter:
But when I view the node I get redirected to facebook login form. After login I get redirected to my facebook home site. What did I miss?
Comment #2
Dave Cohen commentedStart with the README.txt. Then read the module docs on drupal.org. Search drupal.org for instructions on how to create a Drupal module.
After configuring Drupal for Facebook, there will be a global variable, $_fb. Use that rather than calling
new Facebook(...).Comment #3
haggins commentedHi Dave,
I did follow the README.txt step by step and I don't think I missed anything.
I also tried this:
- registering my site at http://developers.facebook.com/setup
- adding the resulting app to my drupal site
- creating a like-box at http://developers.facebook.com/docs/reference/plugins/like-box
- adding the XFBML to a block with "FullHTML"-filter
=> nothing appears though there is xmlns:fb="http://www.facebook.com/2008/fbml" at my tag and "/sites/all/modules/fb/fb_connect.js" included.
The only way I got the likebox working is the iframe-version which doesn't need any modifications at my site:
Comment #4
13rac1 commented6.x-2.x is deprecated. Closing old issue.