问题
I have a facebook page with age restriction (above 21) so I am aware that the like box won't be visible on my website unless the user is logged in on facebook and authenticate that he/she is above 21.
My problem is I have a div container in which I am showing the faces along with like button, but that is visible only after the user is logged in on FB. Without it my div container is empty and it looks awful. Is there any way to show a sample image on the div container if the user is not logged in on FB and clicking on that image redirect the user to facebook login page. Once the user is logged in the sample image won't be visible and only like box stream would be visible in the likebox div that I have on my website.
Here is my code
<div class="feedBlock" id="fbFeed">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/nl_NL/all.js#xfbml=1&appId=591503784269841";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:like-box href="https://www.facebook.com/FACEBOOK_PAGE" width="235" height="405" colorscheme="light" show_faces="true" header="false" stream="false" show_border="true">
</fb:like-box>
</div>
CSS
.feedBlock {
height: 405px;
font-size: 10pt;
}
#fbFeed {
width: 235px;
margin: 0 15px;
}
来源:https://stackoverflow.com/questions/21985810/facebook-like-box-showing-sample-image-instead-of-feed-when-user-is-not-logged