" width="600" xid="

How to remove the warning about comments on facebook?

my fb comment code:

<fb:comments url="<?=$this_url?>" width="600" xid="<?=$this_unique_xid?>" notify="true" candelete="true" simple="1" numposts=1 url="http://www.veethi.com"></fb:comments> 

Now, if I want to remove the warning message:

Warning: this comment plugin works in compatibility mode, but there are no posts yet. Try specifying an explicit 'href, as suggested in the comment plugin documentation, to take advantage of all the function plugins

I need to replace "url" with "href", but by doing this, I lose my old comments, Someone who encounters a problem or solution pls answer me. I need one solution that removes the warning message, and in the same way I have all my old comments. thankx in advance.

+2
source share
4 answers

I wrote a complete tutorial with a little use of JS to solve this problem. Visit the tutorial


What I've done:

  • Install XFBML tag parsing in JS SDK
  • Adding a call function to the JS SDK with a date parameter that you manually set once with a date published after that date will start using the "href" version, and messages published before this date will use the migrated version.
  • Adding another attribute to the fb: comments tag, which is a "date-date", and in it you indicate the date of publication (dynamic code).
  • By calculating the dates in the JS code and based on the result, we delete the unnecessary attributes and, finally, then render the XFBML tags using FB.XFBML.parse
+3
source

Instead of <fb:comments ... I used <div class="fb-comments" ... and then everything worked correctly.

+1
source

https://developers.facebook.com/docs/reference/plugins/comments/

Put the URL of your site, set the number of posts you want to have in the comments, get the code. The first part puts it in the header immediately after <body> and <div> in single.php (single message template). Remove </div><?php comments_template(); ?></div> </div><?php comments_template(); ?></div> and add it from facebook;) Great for me;)

+1
source

@ gil-goldshlager, thanks for this workaround, I think many developers are looking for this. I myself struggle with this, since for a long time on one of my sites: sharemovi.es

I think that the most important thing that you managed to do was to show old and new comments nearby.

Unfortunately, a yellow frame still appears in some cases, and some comments are lost, therefore:

  • OK: post after 12.15.2011 no comments (http://sharemovi.es/theprestige)

  • OK: both posts + comments after 12.15.2011 (http://sharemovi.es/biutiful)

  • OK: both posts + comments until 12.15.2011 (http://sharemovi.es/thesocialnetwork, http://sharemovi.es/battlelosangeles and http://sharemovi.es/thequickandthedead ) - very nice to see these comments!

  • out of order: messages until 12.15.2011 without comments - 2 problems here:

a. a yellow box with the inscription "Warning: this comments plugin works in compatibility mode but has no messages yet. Consider specifying an explicit" href ", as suggested in the documentation for comment plugins, to take full advantage of the plugin’s features."

b. comments for those posts / pages that were made AFTER 12.15.2011 disappeared (without comments: http://sharemovi.es/fromdusktilldawn , http://sharemovi.es/waiting , with comments - I checked the moderators panel - http: //sharemovi.es/ellesappelaitsarah and http://sharemovi.es/thegame )

All together, now I get more comments than before, so thanks again. However, the yellow box is pretty ugly, doesn't look professional. Very bad design solution from Facebook!

Hope you can look at it, I am happy to help where possible.

Cheers Bob

0
source

Source: https://habr.com/ru/post/950367/


All Articles