× Joomla Facebook Connect support forum

Topic-icon Custom login button doesn't connect FB account

Active Subscriptions:

None
11 years 6 months ago #27354 by maxiss
Using this code:
a href="javas_cript:void(0)" onclick="jfbc.login.login_custom();">[[img src="/images/facebook-login-btn.png" style="margin-top: 4px;">[[/a
(edited to display)

Only works if the facebook user has already connected via the {JFBCLogin} button that gets rendered to the browser.
First time user clicking the above custom login doesn't perform the connect and ask for auth to post on wall etc.

Please advise.
The topic has been locked.
Support Specialist
11 years 6 months ago #27359 by alzander
Can you post where you have this code that it isn't working? That code you posted is correct and should correctly request the user permissions to initially register or to later login. The Javascript button from Facebook actually calls the same jfbc.login.login.. code, it's just a different type of button, so they should behave the same.

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

None
11 years 6 months ago #27362 by maxiss
I can't publicly post the link due to client confidentiality.
Can I private message you the link?
The topic has been locked.
Support Specialist
11 years 6 months ago #27368 by alzander
Sure thing! You can Private Message me by clicking the arrow under my picture (<
) and hitting the mail icon.

We'll do what we can to get you fixed up!

Thanks,
Alex
The topic has been locked.
Support Specialist
11 years 6 months ago #27370 by alzander
Thanks for the Private Message. I just got a chance to look at the site and there's definitely something strange going on. In the head section of your site, there should be a block of code that looks something like:
jfbc.login.logout_facebook=false;
jfbc.base='http://www.sourcecoast.com/';
jfbc.return_url='L2ZvcnVtcy9tZXNzYWdlcz9pZD00MDc5JnBhZ2U9dmlldw==';
jfbc.login.scope='email,publish_actions';
jfbc.login.show_modal='0';
Obviously your values will differ. However, that block isn't there at all, which is causing the problems you mention. If I switch to the rhuk_milkyway template by adding ?template=rhuk_milkway to your URL, those values properly are inserted.

So, you'll need to fix whatever is happening in your template to strip out the code JFBConnect is trying to insert.

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 6 months ago #27377 by maxiss
Thanks for that Alex.
I see what you mean. Where is that code injected into the template?
I might just hardcode it into the template for now.
The topic has been locked.
Support Specialist
11 years 6 months ago #27383 by alzander
The code is created dynamically for each page depending on different configuration options within JFBConnect. The actual code to do it is in the /components/com_jfbconnect/libraries/facebook.php file. I really wouldn't recommend just pasting the values into the template and just let JFBConnect do what it's supposed to do instead.

Hope that helps either way you choose,
Alex
The topic has been locked.