Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
3.2k views
in Plugins by
It seems to revert back to unlike situation every time I press the like button. It shows 1 for a second and then go back to earlier position.
Q2A version: 1.5
by
I don't know the solution but i'm 50% sure that is facebook login foult, i had some issues earlier with fb like, turing off fb login solved prblem.
by
turning off the fb login!
does that mean I can not have both the facebook log in and the like option together?
by
and turning off fb login did not work for me.

2 Answers

0 votes
by
Thanks, I didn't notice this.  I've made Facebook load in in an iFrame with no javascript, so it should work now... please let me know with the latest version.
by
I dont know if the problem is only for my website but it seems there is a loop in the like function. If i click like then it actually likes the question and then again return to the 'unlike' situation.

If it may help, here is a question in my website:
 
http://spreadthelight.info/14/how-to-get-a-good-job
by
I have updated this share plugin to 1.1 version.

I think there might be conflicting facebook functions as I have

1. Facebook log in plugin
2. Facebook Like button (which I got from the Facebook's Development page)
3. Your share plugin which other than the facebook thing works really well.
by
What's the problem?  I just went and "liked" that question using the share plugin button, and there was no problem.
by
Its working now. I think the update of yours did the trick.
Still, my actual Facebook page does not show I liked that particular question.
by
@ NoahY, could you please let me know whether the plugin can be used such a way that when someone likes a question it would actually show in his or her facebook page.
by
it shows for me on my page when I like something...
by
Could you please check mine and please let me know why its not working in my case?
I really appreciate your support.
http://www.spreadthelight.info/28/what-do-you-guyz-think-about-global-warming
by
Yep, works for me; note, it shows up on my facebook profile, not a page of my choosing.
0 votes
by
I still have that same problem with Facebook xfmbl version.

To use this more versatile version of the button, one needs to include the java sdk provided by facebook in the layout menu as custom html code.

It is basically the same which is loaded when fb login is active.

The problem is, if one is logged in through facebook the java sdk appears twice in the source code. And this causes strange behaviour of the website.

It would be great if some one could give a hint how to modify the facebook plugin that way, that the java sdk is allways loaded, not only if a fb cookie exists.

This shouldnt affect NOAHs Share plugin, as he does not use the xfmbl version, but the iframe version.
by
having issues with both versions, updated to iframe, still not working (clicking like has no effect, javascript error), see: http://www.question2answer.org/qa/14799/share-plugin-updated-noahy-facebook-like-not-working
by
edited by
The xfmbl version does work, there ist just that issue with the sdk twice in source code, what within other issues causes that you get two likes each time one clicks the like button.

I have that in my layout -> Custom HTML at top of every page:

<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId  : 'myappid',
      status : true, // check login status
      cookie : true, // enable cookies to allow the server to access the session
      xfbml  : true  // parse XFBML
    });
  };
  (function() {
    var e = document.createElement('script');
    e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
    e.async = true;
    document.getElementById('fb-root').appendChild(e);
  }());
</script>



Changed through advanced theme the function doctype () using:

$this->output('<!DOCTYPE HTML><html xmlns="http://www.w3.org/TR/html4/loose.dtd" xmlns:fb="https://www.facebook.com/2008/fbml">');

Then I have set in advanced theme in the function head_metas() :


$this->output('<meta property="og:url" content=""/>');
$this->output('<meta property="og:type" content="website"/>');
$this->output('<meta property="og:description" content=""/>');
$this->output('<meta property="og:title" content=""/>');
$this->output('<meta property="fb:app_id" content=""/>');
$this->output('<meta property="fb:admins" content=""/>');
$this->output('<meta property="og:image" content=""/>');

And finally implemented the button as follows:


<div class="like">
<fb:like href="" send="false"  layout="button_count" width="50" show_faces="false" action="like" font=""></fb:like>
</div>

Thats all. That way the button takes the image You specified in the og parameters and likes the actual url. If You want it to like another url You can set it in the href parameter.

But, there still remains the problem with the sdk loaded twice, when one is logged in through facebook as the fbplugin loads the sdk as well if a fb cookie exists or so...

EDIT: You can see effects on www.algarve-portugal.de

Check as well the source code when logged in through fb abd when not, so You see the two times loaded sdk.
...