Topic-icon FB Profile

Active Subscriptions:

None
12 years 10 months ago #10503 by LSimony
FB Profile was created by LSimony
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 api.joomla.org/Joomla-Framework/JFactory.html
The topic has been locked.
Support Specialist
12 years 10 months ago #10513 by alzander
Replied by alzander on topic 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:
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).
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.
$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 :)

Alex
The topic has been locked.