Hello, here is question for million dollars so to speak :)
I have came up with one crazy idea to implement JomSocial Facebook Login button to joomla login module and login page (see pic1 and 2),since I am sick and tired or using third party components such as Improved Ajax Login and register of JFBConnect for this job. I have inserted button as it wasn't hard with template override added css etc. and used code from flat template:
<div class="joms-form__group joms-login">
<div class="login-facebook">
<span><i class="fa fa-facebook" aria-hidden="true"></i><?php echo JText::_('COM_COMMUNITY_SIGN_IN_WITH_FACEBOOK');?></span>
</div>
</div>
This is if want to implement independent facebook login to site. Not sure if that is what you aim for.
Here is what you need, or maybe not. Few html lines and few more javascript lines of code.
www.loginradius.com/engineering/implemen...cebook-social-login/
You can get FB API Key from jomsocial prefs.
Also from the source:
developers.facebook.com/docs/facebook-login/web
No need to load script since it can be incorporated in php if you prefer that way since JS is not that long.
developers.facebook.com/docs/facebook-login/web#example
If you are developing your own module based on Joomla register, you can always add your own API module preference item so you can pull it from there and not hardcode it into php/js.
Thank you Vladimir, and to answer to your question no I am not developing new module based on joomla one ( yes it can be used after finished as new module to be honest), I just need to when user click on Log in with Facebook button I have placed in joomla module to trigger JomSocial facebook registration.
Did you try to use:
<?php if ( $fbHtml ) { ?>
<div class="auth-facebook">
<?php echo $fbHtml;?>
</div>
<?php } ?>
<?php echo $fbHtml;?>
$config = CFactory::getConfig();
$usersConfig = JComponentHelper::getParams('com_users');
$fbHtml = '';
if ($config->get('fbconnectkey') && $config->get('fbconnectsecret')) {
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
}
$config = CFactory::getConfig();
$usersConfig = JComponentHelper::getParams('com_users');
$fbHtml = '';
if ($config->get('fbconnectkey') && $config->get('fbconnectsecret') && !$config->get('usejfbc')) {
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
}
Already did Vladimir, no it is not working, when added your examples was first I have tried button is not displaying in when added.
As you can see in original code from flat theme I have picked up
<?php if ( $fbHtml ) { ?>
<div class="joms-form__group joms-login">
<div class="login-facebook">
<span><i class="fa fa-facebook" aria-hidden="true"></i><?php echo JText::_('COM_COMMUNITY_SIGN_IN_WITH_FACEBOOK');?></span>
<?php echo $fbHtml;?>
</div>
</div>
<?php } ?>
All these samples check for Facebook connect enabled in jomsocial and api key and secret entered. So, you have to set everything up. If you did and nothing is displayed, than I don't know what is wrong. If you do not want to set jomsocial that way I'm not sure what to do.
With this:
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
echo $fbHtml;
Ok Vladimir here it is:Vladimir wrote: Can You share solution?
<?php if (class_exists('SocialLoginHelperIntegrations')) echo SocialLoginHelperIntegrations::getSocialLoginButtons() ?>