× Joomla Facebook Connect support forum

Topic-icon Can mapped fields show up in registration?

Active Subscriptions:

None
14 years 5 months ago #16630 by joeadl
Hi,
Can mapped fields show up in registration? When using "full jomsocial user" - is it possible to show the fields that are mapped to FB in the registration? (in the same place as Non-mapped Required Fields).

And is it possible to allow the user to edit the imported fields or over-write them during registration? e.g. if we're importing "Job Title" from FB, is it possible for the user to see what is being imported from FB and be able to edit it. Or if they know that the field is not filled out in FB, is it possible to just fill it in. Right now, the mapped fields don't show up in registration even if the user's profile does not have any data in it.

Thanks!
The topic has been locked.
Support Specialist
14 years 5 months ago #16690 by alzander
Joe,
No, not currently. It's a great idea, but honestly, we have never had this request before. As we've developed JFBConnect, the philosophy has always been to minimize the registration process.. so, hiding any fields that we're going to import anyways. I can see how letting the user see what's being imported (and change it) would be a good option to have.

We'll definitely look into this for a feature to release soon after 4.1. As it is right now, JFBConnect simply looks to see if a field has a mapping, but doesn't look at the user's Facebook profile for field data before the registration process.. only after it's completed. Again, this is for speed and minimal interaction, but can see where it's lacking, especially if you're using some of the more extended fields from Facebook (which may not be filled out).

I've added this to our tracker, and can definitely see implementing it for JomSocial by/in early January.

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

None
14 years 5 months ago #16753 by joeadl
Ok, I do think this would be a good option, but here's a work-around question:

Is there a way for me to call the fields that are being pulled from FB (even without the option to edit)? Is there some way to invoke the data that was just collected?

If it has been imported to Jomsocial already, i can to that through something like: <?php echo $user->getInfo('FIELD_FBIMPORTFIELD'); ?> , but from what I understand, when data is initially pulled it is not yet entered in FB and exists in JFBC "limbo" - is there any way i can show what is being imported?

Thanks again!
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #16757 by joeadl
So I've found the call: <?php echo $this->fbUserProfile ? > - am testing if the syntax works for all the import fields
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #16787 by joeadl
So the other fields dont seem to be working with the same syntax, is there somewhere i can find out how to access that info?
The topic has been locked.
Support Specialist
14 years 5 months ago #16820 by alzander
There really isn't an easy method to do exactly what you're trying to do. Our profile import stuff is a lot more rigid than we want it to be, and at the risk of sounding like a broken record, it is something we're planning to improve over the next few releases for doing some of the non-login importing I've been mentioning.

For now, if you know what fields your importing from the user, you can call:
$fields = array(0 => 'first_name', 1 => 'last_name', 2 => 'status', 3 => 'email', 4 => 'name');
$profile = $this->getUserProfile($fbUserId, $fields);
$value = $profile['last_name'];

You could import any field, but the list we support is in /administrator/components/com_jfbconnect/models/config.php, starting at line 143. There are some fields which need some extra logic to pull out the real data, and they have a strange format in that file (like hometown_location.city). In that case, you'd do:
$value = $profile['hometown_location']['city'];
It can get confusing fast, but this may hopefully help you.

Hope that explains a little. Should you need more info, if you wanna go down this route, let us know, and we'll help how we can.

Alex
The topic has been locked.
Active Subscriptions:

None
14 years 5 months ago #16841 by joeadl
I will play with this to see if I can at least show users what fields are being imported. A quick follow up:

1. How can I pull the Avatar?
2. Is there any way to at least check whether a profile field has any data in it before import? So that if it doesn't have data it shows up? (I think i know the answer, but just want to check)

Thanks again, Alex.
The topic has been locked.
Support Specialist
14 years 5 months ago #16991 by alzander
Joe,
Sorry for the delay in getting back to this, and your other post.

1) For getting the avatar, you can use the following code:
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
$fbUserId = $jfbcLibrary->getFbUserId();
$avatarUrl = $jfbcLibrary->getUserProfilePicUrl($fbUserId);
That will return the URL to the image, which you can then use inside an image tag.

2) Going to save this one a little bit. Should be able to get you an answer on (hopefully) pre-populating the fields inside JLinked later today or tomorrow from your other thread. If we get that going, then we should be able to use that code to get a jumpstart on doing the same in JFBConnect. JLinked's profile functionality is a bit cleaner than JFBConnect's, and something we plan on porting over in the next few releases. It's sort of a leap frog process between the two now where we improve one common section, test it, and then implement it in the 'other' extension... which is why in JLinked, we can likely help you to do that easier.

Hope that helps, and thanks for your patience,
Alex
The topic has been locked.