This is my solution for facebook in php. Guess you can do simular for other social networks.
function customFShare() {
$like_results = @file_get_contents('http://graph.facebook.com/'. get_permalink());
$like_array = json_decode($like_results, true);
return (isset($like_array['shares']) ) ? $like_array['shares'] : "0";
}
function fShareButton() {
return "Icon ". customFShare() ."";
}
HTML
JQuery
jQuery(document).on("click",".facebook-share > a", function (e) {
e.preventDefault();
var winHeight = 350,
winWidth = 520,
winTop = (screen.height / 2) - (winHeight / 2),
winLeft = (screen.width / 2) - (winWidth / 2),
link = $(this).data('share');
window.open(link, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
});
You will get nice facebook button with icon and counter.