Part of the EllisLab Network
   
2 of 2
2
Facebook Controller
Posted: 28 July 2009 02:35 PM   [ Ignore ]   [ # 16 ]  
Lab Assistant
RankRank
Total Posts:  179
Joined  06-03-2009

I changed

$user = $this->facebook->require_login();

to

$this->user = $this->facebook->require_login();

in MY_Controller.php.

So I can use the log in user id value later on by using $this->user.

Profile
 
 
Posted: 28 July 2009 03:36 PM   [ Ignore ]   [ # 17 ]  
Grad Student
Avatar
Rank
Total Posts:  73
Joined  12-12-2007

Yes, I revised my MY_Controller.php codes. I added below sentence also.

public $user
 Signature 

audentis fortuna iuvat
CodeIgniter Turkey

Profile
 
 
Posted: 28 July 2009 04:34 PM   [ Ignore ]   [ # 18 ]  
Lab Assistant
RankRank
Total Posts:  179
Joined  06-03-2009
$profile_field_array = array(
        
"about_me",
        
"activities",
        
"affiliations",
        
"birthday",
        
"books",
        
"current_location",
        
"education_history",
        
"first_name",
        
"hometown_location",
        
"hs_info",
        
"interests",
        
"is_app_user",
        
"last_name",
        
"meeting_for",
        
"meeting_sex",
        
"movies",
        
"music",
        
"name",
        
"notes_count",
        
"pic",
        
"pic_big",
        
"pic_small",
        
"political",
        
"profile_update_time",
        
"quotes",
        
"relationship_status",
        
"religion",
        
"sex",
        
"significant_other_id",
        
"status",
        
"timezone",
        
"tv",
        
"wall_count",
        
"work_history"); 

In traditional php programming, I just attach this at the end of facebookapi_php5_restlib.php, in the ci set up, the facebook client api is as plugin. 

So where and how should I save the code above?  Any suggestions?  Thanks.

by the way, why this thread is not moving to the top based on the last posted date?

Profile
 
 
Posted: 29 July 2009 01:37 AM   [ Ignore ]   [ # 19 ]  
Grad Student
Avatar
Rank
Total Posts:  73
Joined  12-12-2007

You can add this array to application/config/facebook.php file as

$config['profile_field_array'= array(array(
        
"about_me",
        
"activities"
); 

And you shall call your array in everywhere like this:

$this->config->item('profile_field_array')['about_me']
 Signature 

audentis fortuna iuvat
CodeIgniter Turkey

Profile
 
 
Posted: 29 July 2009 01:58 PM   [ Ignore ]   [ # 20 ]  
Lab Assistant
RankRank
Total Posts:  179
Joined  06-03-2009

Sorry if I post not related issues at this thread.  But I think you are the expert of CI facebook application here and this issue seems to modify on the codes of your controller or the other two controllers you mentioned.

I found some threads, using the same controller as yours, but add one line

parse_str($_SERVER[‘QUERY_STRING’],$_GET);

// Prevent the 'Undefined index: facebook_config' notice from being thrown.
        
$GLOBALS['facebook_config']['debug'NULL;
       
        
parse_str($_SERVER['QUERY_STRING'],$_GET);
          
// Create a Facebook client API object.
        
$this->facebook = new Facebook($this->__fbApiKey$this->__fbSecret);
        
$this->user $this->facebook->require_login(); 

And then set up

$config[‘uri_protocol’]  = “PATH_INFO”;

or

$config[‘uri_protocol’]  = “ORIG_PATH_INFO”;

The reason to add this changes is to make the code like this working

<fb:iframe src=“http://cifacebook.foliosystems.ca/google_map” smartsize=true></fb:iframe>

the src is pointing to a CodeIgniter page, without the set up changes, facebook application doesn’t understand the url.

I did it, and it works.  But I am not quit clear about the codeigniter or facebook logic behind this set up.

Any advices?

Profile
 
 
Posted: 25 February 2010 02:15 AM   [ Ignore ]   [ # 21 ]  
Lab Assistant
RankRank
Total Posts:  166
Joined  01-03-2010

does this still work i am getting

Fatal error: Class ‘Facebook_Controller’ r’ not found

 Signature 

burak: Skinny controllers Fat models

Profile
 
 
Posted: 25 February 2010 02:49 AM   [ Ignore ]   [ # 22 ]  
Grad Student
Avatar
Rank
Total Posts:  73
Joined  12-12-2007

Yes this class is still working. Your problem is MY_Controller.php problem, I guess.

Please check your application/config/config.php at 108th line at first.
It should be : $config[‘subclass_prefix’] = ‘MY_’;

Then check your location of MY_Controller.php file. It should be application/libraries

 Signature 

audentis fortuna iuvat
CodeIgniter Turkey

Profile
 
 
   
2 of 2
2