You know facebook is a great social application for million of users. And to develop a application for this site is also very popular. So I have planned to write a class where facebook application developer can do most of the basic things for their application using this class.Specially thanks to emran bhai and anis to review my class.The basic feature of this class
You can do above all the things to use this Class.

Download
You can download it from here. The zip file contains this class along with an example. You can also find full documentation here.
You can also download it from phpclasses.org
How to use it
1: // Include our files
2: include_once ('FBToolbox.class.php');
3:
4: // Prepare the object
5: $fbToolboxObj = new FBToolbox('YOUR_API_KEY', 'YOUR_SECRET_KEY');
6:
7:
8: // Get user information
9: $userInfo = $fbToolboxObj->getUserInfo('FB USER ID');
10: //print_r($userInfo);
11: echo $userInfo[0]['current_location']['city'];
12:
13: // Get friend list here
14: $friendList = $fbToolboxObj->getFriendList('FB USER ID',false,0,20);
15: //print_r($friendList);
16:
17: // Send notification
18: $fbToolboxObj->sendNotification(array('FB USER ID'),'test api class','app_to_user');
19:
20: // Send email notification (CAUTION: your application must have permission from user)
21:
22: $fbToolboxObj->sendEmail('FB USER ID','test api class','test api class');
23:
24: // Publish news feed
25:
26:
27: $one_line_story_templates[] = '{*actor*} has developed a php wrapper
28: class for facebook application developer.';
29: //You have to run this function only one times to get template bundle id
30: $templateBundleId = $fbToolboxObj->getTemplateBundleId($one_line_story_templates);
31:
32: $fbToolboxObj->publishNewsFeed('FB USER ID',$templateBundleId);
33:
34: // Add your application to your profile
35: $fbToolboxObj->addToProfile('FB USER ID',"Wider FbMl","narrow fbml");
36: ?>
37:
38: <!-- you have to print this line to add application to user profile
39: if user click on addtoprofile link then above function will work -->
40: <div class="section_button"><fb:add-section-button section="profile"/></div>
41:
So devs this is all about my php class. In my next post I will show you how to develop a facebook application with new platform in details using this class. Enjoy!!!!
Wow, that
I like this class, how do you adapt it as a buddpress plugin?
buddypress site.
http://www.buddypress.org
hi
i know about this facebook class but can you explain more how to use this class in my application
Hey,
wow this class sounds amazing. Do you have any more info on how to implement it?
Billy?
hi
can we send email to facebook users on facebook via facebook connect
thanks
[...] tratta di Facebook Toolbox, che incorpora in semplici metodi tutte le chiamate e le varie operazioni che possono tornarci [...]
hi
Can u help to send invitation to facebook user like multi-selector invitation
@ehsan
thanks to give time here.
I am writting another one post
about facebook application.
so please stay with me.
thanks
raju
hi
i mean when we like to send invitation to more then one friends in facebook we use multiselect option , now i like to send invitation like that but i want to send invitaion by using my own database , its possible to that with facebook or not ,
if yes then how
thanks
I am facing one small problem/error -
“Fatal error: Uncaught exception ‘FacebookRestClientException’ with message ‘Session key invalid or no longer valid: ‘ in /home/gigahert/public_html/test/facebook/client/facebookapi_php5_restlib.php:2977 Stack trace: #0 /home/gigahert/public_html/test/facebook/client/facebookapi_php5_restlib.php(946): FacebookRestClient->call_method(’facebook.fql.qu…’, Array) #1 /home/gigahert/public_html/test/facebook/FBToolbox.class.php(126): FacebookRestClient->fql_query(’SELECT uid FROM…’) #2 /home/gigahert/public_html/test/facebook/FBToolbox.class.php(227): FbToolbox->getFriendList(’1015601512′, true) #3 /home/gigahert/public_html/test/facebook/1.php(52): FbToolbox->publishNewsFeed(’1015601512′, ‘115329175943′) #4 {main} thrown in /home/gigahert/public_html/test/facebook/client/facebookapi_php5_restlib.php on line 2977″
Can you pls suggest me to solve it ?
Use try catch block for your script as like,
try{
if(count($facebook->api_client->friends_get())>0){
— your script here—
}catch (Exception $ex) {
$facebook->set_user(null,null);
}
I hope that the above script will help you.
[...] Web: http://www.stylephp.com/2009/03/20/a-php-class-for-facebook-application-developer [...]
[...] A PHP Class For Facebook Application Developer [...]
[...] Facebook Application Developer [...]
[...] Facebook Application Developer [...]