Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Question

6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

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>
And now has came the time to make it alive. While inspecting code from JomSocial I see that it pulls js for this job. Can you point me what needs to be added to template overide I have created so that when clicked it start JomSocial facebook registration or signing in process.
Note I cant use Hello me module or Toolbar for this unfortunately.

Thank you!

Attachments:
6 years 7 months ago
Licenses:
JomSocial Active

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.

The following user(s) said Thank You: Goran
6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

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.

The following user(s) said Thank You: Vladimir
6 years 7 months ago
Licenses:
JomSocial Active

Did you try to use:

<?php if ( $fbHtml ) { ?>
	<div class="auth-facebook">
		<?php echo $fbHtml;?>
	</div>
<?php } ?>
to get FB button since that code is used all over layout files.
Or just:
<?php echo $fbHtml;?>
Also you can you this code from mod_community_bar:
$config = CFactory::getConfig();
$usersConfig = JComponentHelper::getParams('com_users');
$fbHtml = '';

if ($config->get('fbconnectkey') && $config->get('fbconnectsecret')) {
$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
}
removed reference to JFBC. with that check it looks like:
$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();
}

The following user(s) said Thank You: Goran
6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

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 } ?>
It seems I have to add something more for this to work, or i will use hello me module as base for facebook button.

6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

Just saw update for your post. Give me a sec. :)

6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

Nope no luck with all suggestions. Unfortunately :(

6 years 7 months ago
Licenses:
JomSocial Active

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.

6 years 7 months ago
Licenses:
JomSocial Active

With this:

$facebook = new CFacebook();
$fbHtml = $facebook->getLoginHTML();
echo $fbHtml;
I get error:
Required "app_id" key not supplied in config and could not find fallback environment variable "FACEBOOK_APP_ID"
So it does something. I don't have FB Key/Secret ATM so cannot test further.
This does not check if FB is enabled in JomSocial.

The following user(s) said Thank You: Goran
6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

It is js files I think Vladimir, but will figure it out.
Thank you again. :)

6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

I have done it finally Vladimir!
Thanks again. :)

Attachments:
6 years 7 months ago
Licenses:
JomSocial Active

Can You share solution?

6 years 7 months ago
  • Goran's Avatar
    Topic Author
  • Goran
  • Offline
  • Junior Boarder
  • Posts: 140
  • Thank you received: 13
Licenses:
JomSocial Active GURU Expired Publisher Expired AdAgency Expired iSEO Active

Vladimir wrote: Can You share solution?

Ok Vladimir here it is:
After many trials and runs I have realized that no matter what I did this wasn't giving results and since I didn't want to install JFBConnect or improved ajax login components, I have installed plugin called Akeeba Social login ( github.com/akeeba/sociallogin/ ) then in settings I have disabled auto insert social buttons in login modules and forms function and used this code in template override for facebook:
<?php if (class_exists('SocialLoginHelperIntegrations')) echo SocialLoginHelperIntegrations::getSocialLoginButtons() ?>
This plugin also has google+ and twitter integration and I plan to use it to insert those social networks not only to joomla login module but also in JS frontpage. Good thing is that you can set redirect urls directly in code snippet if you have specific redirect urls and even to redirect it to specific component which handles user registration.
And now I dont have to use robust components for social registrations no matter if it is for Joomla or any other component since code can be adjusted .
Also you will need a little css magic to make it look good.

6 years 7 months ago
Licenses:
JomSocial Active

How do you map user data from FB/TW/G+ like avatar and similar?

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW