Improved display of Facebook shares
authorSascha Greuel <SoftCreatR@users.noreply.github.com>
Wed, 23 Dec 2015 13:32:58 +0000 (14:32 +0100)
committerSascha Greuel <SoftCreatR@users.noreply.github.com>
Wed, 23 Dec 2015 13:32:58 +0000 (14:32 +0100)
wcfsetup/install/files/js/WCF.Message.js

index 21fb22f4b4c96b9dbd80d73c006102baa69d3d5a..ae678e375cf03c717ab0e92782cbc7777bf7f5bd 100644 (file)
@@ -3421,9 +3421,9 @@ WCF.Message.Share.Page = Class.extend({
         * Fetches number of Facebook likes.
         */
        _fetchFacebook: function() {
-               this._fetchCount('https://graph.facebook.com/?id={pageURL}', $.proxy(function(data) {
-                       if (data.shares) {
-                               this._provider.facebook.link.children('span.badge').show().text(data.shares);
+               this._fetchCount('https://graph.facebook.com/fql?q=SELECT%20share_count%20FROM%20link_stat%20WHERE%20url=%27{pageURL}%27', $.proxy(function(data) {
+                       if (data.data.share_count) {
+                               this._provider.facebook.link.children('span.badge').show().text(data.data.share_count);
                        }
                }, this));
        },