Add social share buttons to every individual post easily without using plugins
Just copy pasting will do..
Check out @ http://pastebin.com/aijFu6CG
When we show up the like box in the sidebar and the Facebook connect button for the commenting system as well (Simple Facebook connect plugin, etc.), every time we click on the FB connect button to authenticate ourselves as a facebook user, the console shows up the error as “FB_login() called before FB_init()”. According to what I could learn, the like box loads the all.js synchronously while the facebook connect button in the commenting system adds up the same again, but asynchronously, after the complete page gets loaded. This creates a major conflict. Though, this has a simple solution to remove the complete script tag that loads the all.js () making the all.js file to get loaded asynchronously only once and thereafter everything should work fine.
http://developers.facebook.com/docs/api#selection
A simple example here, open the link below in a browser. and see the simple stats of devilsworkshop.org.
the most important thing being
“fan_count”: 1302
Gone up to 1322 today…!
Cool
Following function will give you count
function rt_fb_fan_count() {
$url = “https://graph.facebook.com/devilsworkshop.org”;
$ch = curl_init(); // Initialize a CURL session.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch); // close curl resource, and free up system resources.
$json_a=json_decode($result,true);
return $json_a['fan_count'];
}
Reference @ http://rommelsantor.com/clog/2011/02/01/solution-for-facebook-error-fb-login-called-before-calling-fb-init/