× Joomla Facebook Connect support forum

Topic-icon JFBConnect Jomsocial register "block.unregistered"

Active Subscriptions:

None
13 years 1 month ago #8206 by PFA34
Hello,

I JFBConnect integrate the registration page Jomsocial, filename "block.unregistered" directory : /components/com_community/templates/default

How can I add code in the script ?

Picture :
The topic has been locked.
Support Specialist
13 years 1 month ago #8212 by alzander
When you know the file it should go in, it's very simple to add the Login With Facebook button. In that file, just add { JFBCLogin} (no space) where you want the Login button to appear. Our JFBCSystem plugin will replace that text with the login button when the page is rendered.

We do recommend using a template override to make this change, to prevent losing your changes. For more information about template overrides, see:
www.sourcecoast.com/extensions/troublesh...ng-joomla-extensions

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

None
13 years 1 month ago #8220 by PFA34
Hello,

It's not ok :
The topic has been locked.
Support Specialist
13 years 1 month ago #8227 by alzander
Ah.. sorry about that. That pop-up is loaded straight through an AJAX call to JomSocial, and bypasses the system plugins. I don't have a JomSocial installation to test against right now (weekend), but if you want to try the following, it will hopefully work. If not, I can try to test early next week and come up with something.

Instead of the JFBCLogin tag, use the following, which will get the correct Facebook Login Button code:
require_once(JPATH_ROOT . DS . 'components' . DS . 'com_jfbconnect' . DS . 'libraries' . DS . 'facebook.php');
$jfbcLibrary = JFBConnectFacebookLibrary::getInstance();
echo $jfbcLibrary->getLoginButton();
You'll need to put the php open tag at the beginning of that code and a closing php tag at the end if it's in a PHP section. Hope that makes sense.

Hopefully that will work for you, but again, if not, let us know. If it doesn't, please also let us know what version of JomSocial you're using.

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

None
13 years 1 month ago #8243 by PFA34
Hi,
I tried this method but it still does not work. My version is Jomsocial 2.0.6
The topic has been locked.
Support Specialist
13 years 1 month ago #8288 by alzander
Congratulations, you won "Hard question of the week"! The reason the code above didn't work was because the window that comes back from JomSocial is not seen by Facebook because it only parses those fb:login-button tags after the document loads. There's a quick snippet of Javascript that we can add though that will tell Facebook to re-parse the page and look for fb tags. You can't include this in the groups.unregistered file because when it's returned, javascript in it does not execute. However, you can get it to execute it by doing the following:
In the groups.viewgroup.php file, search for javascript:joms.groups.joinWindow. You should find it around line 868, but may differ depending on your template. Update the onclick portion of this line to be just like below:
onclick="javascript:joms.groups.joinWindow('<?php echo $group->id;?>');setTimeout('FB.XFBML.parse()', 1000);"
That XFBML parse line is what re-scans the document for tags. The 1000 says to do it 1 second after the window is fetched. You may need to play with this number a little, but that worked well for us.

Please let us know how this goes, and good luck!
The topic has been locked.
Active Subscriptions:

None
13 years 1 month ago #8299 by PFA34
Thank you very much, it's very good !
The topic has been locked.
Support Specialist
13 years 1 month ago #8312 by alzander
Great to hear! If you need anything else, just let us know, and good luck!
The topic has been locked.
Active Subscriptions:

None
12 years 11 months ago #10168 by coolweb
Hi alex, what about language and button size? I get the button in english and too high
The topic has been locked.
Support Specialist
12 years 11 months ago #10192 by alzander
Coolweb,
The call for getLoginButton() above uses the language file for your site to set the text of the Login Button. Depending on your language, simply copy the languages/en-gb/en-gb-com_jfbconnect.ini file to your language directory (or modify what's already there) and change the LOGIN USING FACEBOOK key to whatever you want it to be.

As for the button size, you can pass that in as a parameter to the getLoginButton() function, like: getLoginButton('small');

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