How can I moderate FB comment boxes that are linked to images?

40 views Asked by At

I am trying to create a website with image galleries that use Fancybox2. I added a FB Comment box for each image in the gallery using this code:

$(".fancybox").fancybox({

scrolling: true,
beforeShow: function () {
    if (this.title) {
    currentHref = this.href;

    this.title += '<br /> <br/>'; // Line break after title

    this.title += '<div class="fb-like" style="margin:0; padding:0" data-href="' + currentHref + '" data-width="400" data-layout="standard" data-action="like" data-show-faces="false" data-share="false"></div>';

    this.title += '<br />'; // Line break after title

    this.title += '<div class="fb-comments" data-href="http://example.com/' + currentHref + '" data-num-posts="2" data-width="400"></div>';
    }
},
afterShow: function () {
    FB.XFBML.parse();

},
helpers: {
    title: {
        type: 'inside'
    }
}

});

I understand that I need to include <meta property="fb:app_id" content="XXXXXXXXXXXXXXXX"/> in the head of a webpage to moderate a FB Comment Box linked to a webpage. But how can I do this if the data-href is the URL of an image? I hope someone can help! Thanks!

0

There are 0 answers