Sorry for the long post. I want to be clean right now !! : Paneer:
I am using the Template Library in my CI setup and everything works great when I use Mr. Huffin's Facebook_connect! Facebook_connect works beautifully if I say anything to a different view file in my controller then it works:
function facebookconnect () {$ this- & gt; Load-> Library ('facebook_connect'); $ Data = array ('user' = & gt; $ this-> facebook_connect-> user, 'user_id' = & gt; $ this-> facebook_connect- & gt; user_id); $ This- & gt; Templates & gt; Write_view ('content', 'fbtest', $ data); $ This- & gt; Templates & gt; to present (); } This is no problem calling it from your page and everyone is happy but when I try to keep my Facebook interactive on my homepage with this code on my homepage I:
function index () {$ this- & gt; Load-> Library ('facebook_connect'); $ Data = array ('user' = & gt; $ this-> facebook_connect-> user, 'user_id' = & gt; $ this-> facebook_connect- & gt; user_id); $ This- & gt; Templates & gt; Write_view ('content', 'indexpage', $ data); $ This- & gt; Templates & gt; to present (); } My homepage load is OK but I have this error:
encountered a PHP error Seriousness: Notice message: Undefined variable: user_id file name: views / indexpage.php Line number: 32
This seems strange to me because it works with the above code. My variables are passed, so I do not get this. What I want to achieve is that the Facebook page should show a list of Facebook friends when the page is loaded. Should I know something about this library? I went through the user guide to see if I can write a different view for that divisor that Facebook Connect should take the result. This is my visual code, just will it help:
php if (! $ User_id): php else: "/> hi php $ user [first_name ']!
(logout) php Andif; Here are some comments! [Deleted] FB indie ("$ the-> config-> items ('Facebook_API_key')", "/xd_receiver.htm"), [deleted]
The problem is in this line:
user_id '=> $ this- & gt; Facebook_connect- & gt; user_id Because there is no user_id property in Facebook's PHP client. User ID is available from:
User_id '= & Gt; $ this- & gt; facebook_connect- & gt; User Try removing the row:
'user_id' = & gt; $ This - & gt; Facebook_connect- & gt; user_id
Comments
Post a Comment