What would cause FB like button to fail? - facebook

Facebook like button failing. The script displays the button, says i've liked it and increased the like count. But it displays nothing on my account and when I refresh the page it says i haven't. What would cause this?
Code: <fb:like href="http://fbquote.me/like.php?id=<?php print $row['id']; ?>" send="false" layout="button_count"></fb:like>

What's this url : http://fbquote.me/like.php?id=<?php print $row['id']; ?> ??
Do you use PHP ? Why do you use such a url ? Failing likes are often related to url errors
Also Do you load fb javascript ?
Do you have something like
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
Somewhere in your page ?

Related

can't display facebook like button when facebook sdk loaded with requireJS

I'm correctly loading Facebook SDK with requireJS (https://developers.facebook.com/docs/javascript/howto/requirejs) because I see it in the console log message and because I can publish on users wall using FB.ui method so the hard work has been done ! But the tricky part is missing : I can't display the like and share buttons (https://developers.facebook.com/docs/javascript/quickstart).
I can see :
<div id="fb-root"></div>
is filled in after page load but the :
<div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
doesn't get anything inside !
What am I missing ? an initialization using FB.XX method ? No javascript error so don't know where to dig ...
OK found the answer 5 sec after posting after 1 hour searching ...
thanks to this page : https://github.com/thomaswelton/requirejs-facebook even if I don't use this plugin for now.
In my FB.init, I had to add the line :
xfbml : true
witch, you would certainly agree, it's very very clear that "xfbml" means "please activate my social plugin" ! I love when variable name doesn't means anything ;)

facebook like button showing extra information

I am using facebook button tag (http://developers.facebook.com/docs/reference/plugins/like/) and used this tag
<fb:like href="http://developers.facebook.com/docs/reference/plugins/like/" send="false" show_faces="false" ></fb:like>
But it is showing me more than I asked for. It works fine in firefox but it shows some extra information on safari. How can I get rid of that signup link?
AS Scott indicated I think this is working as designed. When in Firefox you are likely signed into facebook - hence the like button displays as you want it to display. But when you are in Safari you are NOT logged in (there's no facebook cookie - probably because you use FF as your default browser). So you get the info and the signup button.
As for the "extra" information you should experiment with
type="box_count"
and or
type="button_count"
The default is "standard" - so perhaps one of the other types will be more suited to your layout.
if you aren't connected to Facebook, you will always see the Sign Up button, if you don't Want show the Sign Up link, you can use a div container with Overflow:hidden property
<div class="containerLike">
<fb:like href="http://developers.facebook.com/docs/reference/plugins/like/" send="false" show_faces="false" ></fb:like>
</div>
and in css:
.containerLike {overflow:hidden;
width: Your selected width;}

How to insert multiple Facebook comment boxes on one page?

I am looking for a way to integrate several Facebook Comment Boxes on one page, but with different comments. i have an image grid view and inserted in the lightbox overlays the code from the Facebook comment box generator. With an random number at the end of the URL i tried to fix it, but there comes the error:
Warning: https://URL/#2087943573 can not be opened.
Any ideas?
You just have to add an anchor to the absolute URL, like it is explained in another thread:
Multiple facebook comment boxes on a single page?
You can even test this in the plugin generator:
https://developers.facebook.com/docs/reference/plugins/comments/
...try changing "http://example.com" to "http://example.com#test" and you will see that some other people already commented on that one too.
edit: After a small chat, we found out that the problem might be with the https. So, maybe it just doesn´t work with SSL, i´ve also tried with another server and it only works with the http link.
Try to make "fake" pages for each article that you have with GET variable. For the example:
example.com?fb_share=article1, example.com?fb_share=article2, etc.
Then here you must put the URL:
<div class="fb-comments" data-href="http://example.com?fb_share=article1" data-numposts="5" data-colorscheme="light"></div>
and
<div class="fb-comments" data-href="http://example.com?fb_share=article2" data-numposts="5" data-colorscheme="light"></div>
You don't need to use these pages, but you need it because when someone commenting, the FB comment will be posted on the wall with backlink to your article and for data-href attribute.
By doing these code, it works for my site. Using $_SESSION while looping and echoing data from MySQL database.
<div id= "area_post">
<?php
$query= mysql_query("select * from promo_diskon");
$url_id=0;
while($data= mysql_fetch_assoc($query)){
$textpromo = nl2br($data['deskripsi']);
$_SESSION["url_id"]="http://localhost/xampp/kerjapraktik/promo_diskon.php?posting=".$url_id."";
echo
"<div id='posting'>
<div id='layer'><div class='judul'>".$data['judul']."</div><div class='tanggal'>".$data['tanggal']."</div>
<br/ ><br /><p id= 'deskripsi1' class='deskripsi1'>".$textpromo."</p></div>
<a href=''><img class= 'img-thumbnail' src= ".$data['url_foto']." width= '440px' alt=''></a>
</div>";
//echo '<div class="fb-comments" data-href="http://localhost/xampp/kerjapraktik/promo_diskon.php?posting="'.$url_id.'"" data-width="956" data-numposts="5" data-colorscheme="dark"></div>';
echo '<div class="fb-comments" data-href="'.$_SESSION["url_id"].'" data-width="956" data-numposts="5" data-colorscheme="dark"></div>';
$url_id++;
}
?>
</div>

facebook send button returned status code 200

I'm using the facebook social plugin with an embedded ruby url which references: http://www.facebook.com/pages/my_page/my_page_id Specifically, the like button functionality works, but the send button functionality results in an error.
<div class="fb-like" data-href='<%= #fb_url %>' data-send="true" data-colorscheme="dark" data-width="450" data-show-faces="true"></div>
The page at http://www.facebook.com/pages/my_page/my_page_id could
not be reached because the server returned status code 200.
Have you ever seen this? This doesn't even make sense: a status code 200 is - OK.
Solved the problem:
This is related to URLs that redirect. The like button supports them, the share button does not.

fb:request-form showing blank page

This is my code
<fb:serverFbml style="width: 760px;">
<script type="text/fbml">
<fb:fbml>
<fb:request-form
action="http://apps.facebook.com/MyAPP/invite.php"
target="_top"
method="POST"
invite="true"
type="Invite Form"
content="<fb:req-choice url='http://www.example.com/folder/index.php' label='Accept' />"
>
If i have action="http://www.example.com/folder/invite.php" then it posts array of friends invited in invite.php page, but it takes user outside facebook interface.
If i have action="http://apps.facebook.com/MyAPP/invite.php" then it stays in facebook interface but loads a blank page for invite.php.
Any idea how to solve this?
It looks like if I have action=apps.facebook.com/MyAPP/invite.php then <fb:request-form> doesn't post the ids array to the page. So I tried action="MyDomain.com/folder/invite.php"; and it gave me the ids in and array which I stored in a session and then have this page redirect the user back to apps.facebook.com/MyAPP. There I checked the number array processed it the way I wanted. Not sure this is best way to go about it though.