Digg Digg
How to set up XFBML facebook like button (8 posts)

  1. mfalk75
    Posted 4 years ago #

    I don't see any instructions on how to make this work. Do I need to add something to my template or something. I'm using the floating bar but when I click the xfbml like button and set the global options for it I get nothing.



  2. AlphaUA
    Posted 4 years ago #

    They use invalid code for xfbml button. To make it work with floating bar you should do next:
    1. Go to plugins->editor
    2. Select plugin to edit: Digg Digg
    3. Select file digg-digg/include/dd-class.php
    4. Find next line:

    const BASEURL = "<script src=\"http://connect.facebook.net/FACEBOOK_LOCALE/all.js#xfbml=1\"></script><fb:like href=\"VOTE_URL\" FACEBOOK_SEND FACEBOOK_SHOW_FACE VOTE_BUTTON_DESIGN ></fb:like>";

    5. Replace it with next code:

    const BASEURL = "<div style=\"position: relative; left: 6px;\">
    	<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/en_US/all.js#xfbml=1\";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    	<fb:like href=\"VOTE_URL\" FACEBOOK_SEND FACEBOOK_SHOW_FACE VOTE_BUTTON_DESIGN ></fb:like></div>";

    6. Update file
    7. Important step !!! Go to digg digg panel -> floating display. Make sure you enabled "Facebook Like (XFBML)" option and press "Save changes" button. You should do this even if you had xfbml button enabled before.
    8. Enjoy

    P.S. Tested on Digg Digg v5.2.7 in all major browsers

  3. Andrew Yates
    Plugin Author

    Posted 4 years ago #

    Thanks AlphaUA, i'll take a look at the code and resolve the issue in the next update.

  4. rick4him
    Posted 4 years ago #

    @Alphausa - what if I'm using the facebook wordpress plug in for some other facebook functions on my site? I'm assuming there is some code being duplicated. Do you suggest removing some code from the digg digg plug in and letting the facebook plug in handle adding the java?

  5. rpetty
    Posted 4 years ago #

    Hi, this code change did not work for me. Happy to help debug.

  6. rpetty
    Posted 4 years ago #

    I enabled "lazy loading" for all the other shares and now the fb FBXML is loading with code changes from above.

  7. rick4him
    Posted 4 years ago #


    what is the difference between fbxml and the others? I'm under the impression taht html5 is the way to go

  8. rpetty
    Posted 4 years ago #

    I'm not certain exactly. The FXBML version is required for using the send button. I believe FBXML is the preferred method, although I could be wrong.

    FBXML is Facebook's XML markup and the choice to use this version for the Digg Digg plugin is independent of HTML 5.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Digg Digg
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic