IP.Board Tutorials

Display Facebook likes Count

Submitted by Oxygen, , Thread ID: 2043

Thread Closed
23-03-2015, 06:48 PM
#1
In Look & Feel-> Manage Skin Sets & Templates-> your skin and then go to globalTemplate.

Replace this:

Code:
<if test="$this->settings['showFacebook']=='yes'"><a href="{$this->settings['facebookURL']}" title="Visit us on Facebook" class='facebookButton'>Facebook</a></if>
with this (ID without the brackets):

Code:
<if test="$this->settings['showFacebook']=='yes'">
<script>
    function showCount(count){
        if(count)
            document.getElementById('fb_fan_count').innerHTML = + count[0].fan_count;
    }
</script>
<a href="{$this->settings['facebookURL']}" title="Visit us on Facebook" class='facebookButton' target='_blank'>Facebook: <span id="fb_fan_count"></span></a>

<script type="text/javascript" src="https://api.facebook.com/method/fql.query?format=json&callback=showCount&query=select+fan_count+from+page+where+page_id%3D[ID_OF_YOUR_PAGE]"></script>

</if>

Twitter Doesn't work it isn't supported any more, Twitter changed its API

That's it!
[Image: UeTXrZ5.png]

RE: Display Facebook likes Count

#2
tnx for this guide oxygen Smile

RE: Display Facebook likes Count

#3
thnks~!
good tip ^^

Users browsing this thread: