Topic-icon Building a custom profile page using JFBC data

Active Subscriptions:

None
12 years 2 months ago #42344 by davlar
Hi

I would like to build a custom override of the joomla standard profile page which pulls in avatar and user data from JFBC. My users are connecting using any of the four available social networks. Grateful for php examples I can use to show:

1. Which accounts are connected (so I can offer the user links to connect the others).
2. The user's avatar (whichever avatar JFBC got from whichever network - ideally if they have connected more than one account I would like to give them a choice.)
3. Each custom profile data jfbc imports (is there an api for this for do you get it via the joomla user object after mapping?)
4. Number of facebook friends, twitter followers, G+ connections, linked in connections the user has (presumably I need to create new fields in Joomla user profile plugin and map to them in jfbc?)

Very grateful for some examples.
The topic has been locked.
Support Specialist
12 years 2 months ago #42366 by alzander
Improved integration into the standard Joomla profile area is something on our radar for a release over the next few months. In the meantime, hopefully the info below will help get you going:

1. Which accounts are connected (so I can offer the user links to connect the others).

Check out this post which has a brief code snippet that we use in the SCLogin module to show which accounts a user can 'connect' their account to.

2. The user's avatar (whichever avatar JFBC got from whichever network - ideally if they have connected more than one account I would like to give them a choice.)

JFBConnect doesn't directly store the user's avatar. We rely on 3rd party extensions (JomSocial, Community Builder, EasySocial or others)
to store the user's avatar. We could help you save the user's avatar somewhere in your filesystem, but you'd need to manage how that's shown in other areas. JFBConnect by itself isn't meant to be a profile extension to store that data.

3. Each custom profile data jfbc imports (is there an api for this for do you get it via the joomla user object after mapping?)

As above, we don't store the data directly. We can store it in the User - Profile plugin, which comes with Joomla. In that case, you can access the profile data using the User - Profile plugin calls, which I do believe extend the Joomla User object. I've never played with pulling that data out of the Joomla profile plugin before though.

4. Number of facebook friends, twitter followers, G+ connections, linked in connections the user has (presumably I need to create new fields in Joomla user profile plugin and map to them in jfbc?)

These are all fields that you can configure the profile import for into the User - Profile plugin. To import, you would want to create a field to import those fields into in the User - Profile plugin and the configure the import in the JFBConnect -> Profiles area.

I hope that helps explain, but should you need anything else, just let me know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 2 months ago #42382 by davlar
1. Great - thanks.

2. Oh! I didn't think to check. So SC login I see is just linking the profile image straight from graph.facebook.com. Got it. So if I wanted to import copy of the profile picture, how would you suggest I go about it? There is no mapping option in JFBC for that.

3. Got it- great. Thanks.

4. It does. Thanks.
The topic has been locked.
Support Specialist
12 years 2 months ago #42406 by alzander
Glad to help with 1, 3 and 4!

2. Oh! I didn't think to check. So SC login I see is just linking the profile image straight from graph.facebook.com. Got it. So if I wanted to import copy of the profile picture, how would you suggest I go about it? There is no mapping option in JFBC for that.

Correct, the SCLogin avatar is simply a user indicator that they are logged in, so we can just pull it directly from the social network and display it directly. No need to store it anywhere.

We are planning an update to the Custom DB profile plugin (which lets you store profile data into a custom database table) to also have the ability to store the user's social network image to a custom directory. That would be the first step of what you're looking for. You'd still need to 'do' something with that avatar though to actually display it on the front end.

I hope that helps explain or answer your questions, but if not, let me know.

Thanks,
Alex
The topic has been locked.