fbpx

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
24428 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:
11859
Total Polls:
0
Total Posts:
49712
Posts this week:
8
User Info
 
Total Users:
48456
Newest User:
isilem
Members Online:
1
Guests Online:
1161

Online: 
fb_1127481405
Social Stream
Hide, Seek & Defuse

Handheld Electronic Game

Alex from SourceCoast is working on a new electronic game for kids called Countdown. It's a timed game of Hide & Seek with mini-games (Whack-a-Mole, Simon, etc) to complete when you find it.

Hide and Seek Toys

Before You Leave

Let us send you a 10% off coupon

For Your Next Purchase

Please enable the javascript to submit this form

No , I don't want a discount