Welcome Google reader! We appreciate you visiting this site. AllFacebook provides news, analysis and insight strictly related Facebook. This site has absolutely everything you need to know about Facebook. Please subscribe to the AllFacebook.com feed and keep up to date with everything that is happening on Facebook!

New Facebook Connect Library For CodeIgniter Released

-CodeIgniter Logo-If you’ve spoken to me about development at any point in the past few months, you’d know I’ve become a big fan of CodeIgniter for quick application development in PHP. Any regular programmer will always look for ways to save time during the development process. If you happen to be developing a Facebook Connect enabled site, then a Facebook Connect library can help save some time. Thankfully Elliot Haughin has done just that for CodeIgniter developers.

Last week Elliot released an extremely useful Facebook Connect CodeIgniter library that will get you up and running in under 5 minutes. I tested out the library this morning and it’s extremely useful. While I’ve implemented the widely used FB_Controller (found here) for Facebook platform applications, I haven’t implemented Connect with CodeIgniter prior to this morning. In 7 quick steps you can have a demo Facebook Connect enabled application up and running.

The core component of the code is the Facebook_connect class which enables you to quickly see if a Facebook user is logged in by calling a few quick lines of code from within one of your controller functions:

$this->load->library('facebook_connect');

$data = array(
	'user'		=> $this->facebook_connect->user,
        'user_id'	        => $this->facebook_connect->user_id
	);

If you then want to make any API calls you can simply call the api client functions. For example to get a user’s events you would then make the following call:

$events = $this->facebook_connect->client->events_get($data['user_id']);

One downside of this feature is that it’s not directly integrated into CodeIgniter’s session handling library but a few tweaks could integrate it pretty easily. As I’m in the process of building a few Facebook Connect enabled features on this site, this library will most definitely come in handy. The version released by Elliot is extremely simple and it works. If you are also implementing Facebook Connect within a CodeIgniter application, go check out Ellion Haughin’s library.

  Tags:, ,



Comments (10 Responses)

yes! Actually what i was waiting for. Is this blog built on CI?

I tried CodeIgniter when it was in its early stages. It was similar to, but far inferior to, CakePHP at the time. That said, I’m curious to see how far CodeIgniter has come — I’ll have to give it another shot!

Hey Sarabjit,

This blog is built on Wordpress but I’m in the process of branching out new arms of the site which are built on CodeIgniter.

Best,
Nick

Nice.
I think CI lovers always can follow Elliot on Twitter and know about his libraries weeks before their “official” reliese.
Thanks to Elliot and to you Nick for sharing.

That’s great! Thanks for pointing developer informations a lil more sometimes. By the way, I’m still wondering how do you grab Facebook Apps stats…

Awesome, Nick. I’ve been meaning to take a look at what you got here, downloading now!

What is Facebook’s stance on caching profile pics?

nice CI liblary……….

Leave a comment


 

Send us a Tip tips@allfacebook.com
Top developers Also View Top Applications
230,499,265
-138,300 (-0.06%)
FarmVille
76,039,329 MAU
Café World
30,412,714 MAU
85,995,329
+ 1,074,941 (1.25%)
Birthday Cards
45,831,329 MAU
Zoo World
16,822,988 MAU
59,921,395
+ 5,992 (0.01%)
Facebook for iPhone
26,298,091 MAU
Mobile
18,241,956 MAU
As of Feb 9 10 11:12AM