× Joomla Facebook Connect support forum

Topic-icon Ajax login

Active Subscriptions:

None
15 years 1 month ago #9029 by marcusfive
Ajax login was created by marcusfive
Hello,
when a user tries to access an area for only registered joomla displays a message that warns you to log in to view this page.
it is possible to appear instead of that message, another message with Facebook Connect? It would be wonderful if done in ajax.
this would be useful for novice users who read that should be registered but do not really know how.

Thank you very much
The topic has been locked.
Support Specialist
15 years 1 month ago #9045 by alzander
Replied by alzander on topic Ajax login
Marcus,
Sorry for the delayed response. It's very hard to do what you're looking for with an Ajax response, as that would required some big changes to Joomla itself. However, adding the "Login With Facebook" button to that page is relatively simply.

Basically, that login page is in the /components/com_user/views/login/tmpl/default_login.php file. You should copy that file (create a template override) to /templates/<YOUR_TEMPLATE>/html/com_user/login/default.php

Once there, you can simply add {JFBCLogin} to the page where you want the button to display, and JFBConnect will automatically display the Login With Facebook button.

Hope that helps, and good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9052 by marcusfive
Replied by marcusfive on topic Ajax login
Alzander you were quick, however, do not worry
You're right, it is better to never modify the core of joomla too.
Can I add the login button in a javascript?
In my photo gallery if a user tries to view the photos there is a javascript warning , I would like to put jfc button under the text in the javascript.

the java script is this:
if(!$config->get('jg_showdetailpage') && !$user->get('aid'))
    {
      return 'javascript:alert(\''.JText::_('JGS_COMMON_ALERT_NO_DETAILVIEW_FOR_GUESTS', true).'\')';
    }

thank you very much.
The topic has been locked.
Support Specialist
15 years 1 month ago #9061 by alzander
Replied by alzander on topic Ajax login
There should be. There's a few options you have there...
1) If you want to popup the Facebook login window at that time, you could with the following:
'javascript:alert(\''.JText::_('JGS_COMMON_ALERT_NO_DETAILVIEW_FOR_GUESTS', true).'\');jfbc.login.login_custom();';

It's possible I messed that up with all the punctuation.. it should look like:
javascript:alert('hi');jfbc.login.login_custom();
This will alert the user "You must be logged in" and then actually pop up the Facebook login window. It won't allow them to login with Joomla, but they could close the window and log in that way if they wanted.

There's no way to put the button in the text box itself, but if you update the language string above to say "Access denied, a FB window will appear after this to allow entry in one-click... ", that may do it for you.

2) You can simply make the Login Button show on the page somewhere and update the string to say "You must login in, either go 'here' or click the Login With Facebook button for quicker access...

Hope this helps give you some ideas, and good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9114 by marcusfive
Replied by marcusfive on topic Ajax login
Excellent thanks, I really like.
The topic has been locked.
Support Specialist
15 years 1 month ago #9116 by alzander
Replied by alzander on topic Ajax login
Great to hear that you got it going. Should you have any other questions, you know where to find us!

If you like JFBConnect, please consider leaving a review on the Joomla Extension Directory. Its definitely not required, but we really appreciate it!
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9121 by marcusfive
Replied by marcusfive on topic Ajax login
already done a week ago more or less.

Thank you
The topic has been locked.