FB Profile

FB Profile

I have just installed your program. How can I get the FB profile information (facebook id and other information) into my JUMI (PHP) and use the information in my scripts?

Do you have a document like http://api.joomla.org/Joomla-Framework/JFactory.html

LSimony
Lars
useravatar
Offline
3 Posts
Active Subscriptions:

None
Administrator has disabled public posting. Please login or register in order to proceed.

Re: FB Profile

We don't yet, but are working on more developer friendly documentation.

In PHP code, the following few tidbits might help, but if you're looking for something specific, just let us know:

Code:

include_once JPATH_SITE.DS.'components'.DS.'com_jfbconnect'.DS.'libraries'.DS.'facebook.php'; // Include the main JFBC library class

$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();

From there, you can do the following:
getUserId(ValidateWithJoomla) - Get the Facebook user's ID. If the input ValidateWithJoomla it true, check that ID against your Joomla site to see if they have an account already on your site that's 'mapped' to their Facebook one. Returns null if no ID (or not mapped).

Code:

if ($jfbcLibrary->getUserId(true)) // User is logged into Facebook and has already registered on your site

getFbProfile(fbUserId, fields) - Get fields from the user's Facebook profile. You must have already been granted permissions for those fields, or else the values will return null.

Code:

$fields = array(0 => 'first_name', 1 => 'last_name', 2 => 'status', 3 => 'email', 4 => 'name');

$profile = $this->getUserProfile(123456, $fields);

Hope that helps you get started. Most interfacing calls are in the Facebook.php file, and they wrap around Facebook's PHP library to make things easier. If you know the low-level calls you want to make to Facebook, we can help you do that as well current/smile

Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24104 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11666
Total Polls:
0
Total Posts:
48986
Posts today:
3
User Info
 
Total Users:
47792
Newest User:
romjat
Members Online:
1
Guests Online:
962

Online: 
yael
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program