CodeIgniter Forums
Integrate Facebook Php Client - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Integrate Facebook Php Client (/thread-1717.html)

Pages: 1 2 3 4


Integrate Facebook Php Client - El Forum - 06-21-2007

[eluser]thachp[/eluser]
Trying to integrate Facebook Php Client to Igniter. Any suggestions on how to do that? Copying their files to system/libraries does seems to work for me.

http://developers.facebook.com/resources.php

Patrick


Integrate Facebook Php Client - El Forum - 06-27-2007

[eluser]Unknown[/eluser]
same problem here. Has anyone successfuly implemented the facebook api library into CI?


Integrate Facebook Php Client - El Forum - 06-28-2007

[eluser]mohrt[/eluser]
Yes, I just launched my first facebook app today.

http://apps.facebook.com/motortopia/

The only snafu I ran into was $_GET var clobbering by CI. I had to replace them in the controller. Here is a snippet:

Code:
class F8 extends Controller {
  function F8()
  {
    parent::Controller();
    // work around CI GET clobbering
    parse_str($_SERVER['QUERY_STRING'],$_GET);
    
    if($this->uri->segment(2) !== 'remove_app')
      require_once APPPATH.'/scripts/facebook_client/appinclude.php';
  }
  function index()
  {
     // you should use view files here, etc
     echo "Welcome!";
     // see all the $_POST data the Facebook environment gives you
     print_r($_POST);
  }
}

I dumped all the facebook client data in one directory then included the appinclude.php from the constructor.

My callback URL looks like http://www.mydomain.com/f8/

Anytime you call a URL like http://apps.facebook.com/myapp/foo/bar/blah, the callback URL fetched by Facebook will be http://www.mydomain.com/f8/foo/bar/blah

My post-remove URL is http://www.mydomain.com/f8/remove_app

The post-remove URL cannot include the appinclude.php file, thus the segment check.


Integrate Facebook Php Client - El Forum - 07-04-2007

[eluser]niyogi[/eluser]
Hi mohrt:

Trying to get an IFRAME based facebook app going on the CI framework. I'm wondering [a] where the appinclude.php file should go [b] what it should contain and [c] how to work around the auth_token querystring annexation that facebook lops onto the end of IFRAME changes. Can you possibly post the content of your appinclude.php (excluding the apikey/secret details of course) and help out on the auth_token issue?

Thanks in advance!

Regards,
Roj


Integrate Facebook Php Client - El Forum - 07-11-2007

[eluser]mohrt[/eluser]
The appinclude.php is basically the same one that ships with the facebook client, there were no CI-specific changes made. I didn't do anything with the auth_token issue, I just repopulated $_GET as in my example above.

I have not tried an iframe app, btw.


Integrate Facebook Php Client - El Forum - 07-12-2007

[eluser]niyogi[/eluser]
Ah - I had to really hack CodeIgniter to work as an IFRAME framework for Facebook app development. querystring urls are necessary (since they append fb session data to the end of each url) as is the necessity to change permitted uri characters in the config.php file.

Other than that, loving being on CI. :-)

Roj


Integrate Facebook Php Client - El Forum - 07-25-2007

[eluser]neelp[/eluser]
niyogi,

can you describe what you hacked in order to get it working for an iframe app?

thanks.


Integrate Facebook Php Client - El Forum - 08-08-2007

[eluser]codelearn[/eluser]
[quote author="mohrt" date="1183112309"]Yes, I just launched my first facebook app today.

The only snafu I ran into was $_GET var clobbering by CI. I had to replace them in the controller. Here is a snippet:
[/quote]

Mohrt,

I am still being clobbered with the crap facebook throws in on the callback URL.

Example: http://www.mycampuslinks.com/fbook?auth_token=9b3d912c6c90db5fbda697f24ddf4e83

I'm using your controller as well, and including appinclude just like you did.

Any help you can give me here?


Integrate Facebook Php Client - El Forum - 08-09-2007

[eluser]mohrt[/eluser]
What isn't working? My solution puts the get vars back into $_GET because CI strips them out.


Integrate Facebook Php Client - El Forum - 08-09-2007

[eluser]codelearn[/eluser]
Maybe I implemented it incorrectly... but could you try going here: http:/www.mycampuslinks.com/fbook

Here is my controller:
Code:
<?php
    
class Fbook extends Controller {
  function Fbook()
  {
    parent::Controller();
    // work around CI GET clobbering
    parse_str($_SERVER['QUERY_STRING'],$_GET);
    
    if($this->uri->segment(2) !== 'remove_app')
      require_once APPPATH.'/scripts/facebook_client/appinclude.php';
  }
  function index()
  {
     // you should use view files here, etc
     echo "Welcome!";
     // see all the $_POST data the Facebook environment gives you
     print_r($_POST);
  }
}

?>