0

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?

Max
  • 608
  • 1
  • 7
  • 23

3 Answers3

0

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.

Community
  • 1
  • 1
andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • i think your problem lies elsewhere then, is the url available in public, without any user login? may help to see the url, or the full plugin code. – andyrandy Aug 13 '13 at 07:43
  • can not provide the url in public. can i send it to you somehow? – Max Aug 13 '13 at 07:47
  • BUT: if the url is not available in public, it will not work. because facebook needs access to them, so they cannot be behind a user login (for example). – andyrandy Aug 13 '13 at 07:50
  • no, the url IS public, but i can not post it here because it is for a customer. – Max Aug 13 '13 at 07:52
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/35330/discussion-between-max-and-luschn) – Max Aug 13 '13 at 07:53
0

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.

-1

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>