Topic-icon Facebook Registration.

Active Subscriptions:

None
13 years 1 month ago #32466 by carlos.sandoval
Hi Alex,

My new problem: :=D

I'm trying to get the registration data with AJAX... I wonder what the function collects the Facebook data and fill the form fields.
I'm using an custom Facebook button (Login/Register) and the form in a popup (ui dialog jQuery) and I'd like know how fill this form without refresh my page. I hope you understand me (sorry my bad English).

I'm attaching an image to illustrate this.

Thanks in advance. =)

The topic has been locked.
Support Specialist
13 years 1 month ago #32470 by alzander
Replied by alzander on topic Facebook Registration.
You won't be able to do that through AJAX. After a user authenticates with Facebook, they have to be redirected to a new page on your site (or the same page). That's because Facebook has to set a cookie in their browser which is then used by the PHP library to properly communicate with Facebook to get their profile information.

So, you'll need to redirect the user somewhere if they use the Facebook authentication. If you have the "Automatic" registration feature set in JFBConnect, their account can be created automatically and the user will be logged in without any form at all (while still getting their profile information).

I hope that helps explain, but if you have any other questions, just let me know.

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

None
13 years 1 month ago #32494 by carlos.sandoval
Thank you for your reply Alex. :=D

I understand your comment...
If Ajax isn't possible to use please let me know if I could show the form in a popup (form filled).

I'd like:

1.- Show the form (as you can see in my fist post).
2.- Use facebook to authenticate (set the cookie).
3.- Refresh the webpage.
4.- Show a new popup (ui dialog jQuery) with the new form filled.

Is this possible? :cool:

Thanks in advance.
The topic has been locked.
Support Specialist
13 years 1 month ago #32504 by alzander
Replied by alzander on topic Facebook Registration.
That's not something JFBConnect can do on it's own, it's something you'd have to code on your own. Additionally, you'll need to make sure that your custom registration page is calling the JFBConnect registration function so that the new Joomla user is properly associated with their Facebook account.

So, you'd need to redirect the user to a page that is going to popup our registration form (or at least the fields that go along with it and submit to the right place). Once you do that, our registration form can automatically display the user's profile information for verification. Otherwise, after they've authenticated, you can easily fetch whatever information you want to prefill fields.

Hope that helps explain a little. If you have ideas on how you're going to implement the above, we can gladly try to help.

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

None
13 years 1 month ago #32508 by carlos.sandoval
Hi Alex,

It was easy :D
//in my main.js template

$(function() {
    $( "#jfbc_loginregister" ).dialog();
 });

Thanks.
The topic has been locked.
Support Specialist
13 years 1 month ago #32517 by alzander
Replied by alzander on topic Facebook Registration.
Awesome solution! Glad to hear that got it going for you. We may have to do some testing with that as well.

If you run into any issues or need anything else, just let us know.

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

None
13 years 1 month ago #32522 by carlos.sandoval
Great!

Thank you very much. Surely, I will be asking you for something more :=D .

Regards.
The topic has been locked.