Category Archives: php

Google Buzz Followers

// <![CDATA[javascript" charset="utf-8">]]>

function f(result) {

document.getElementById('count').textContent =

result.data.totalResults;

}

</script>

// <![CDATA[src="]]>https://www.googleapis.com/buzz/v1/people/Your_userID/@groups/@followers?max-results=0&alt=json&callback=f"></script>+ Followers</span>

you have to create profile under the url http://www.google.com/profiles
then give the google user Id in the link inside script

Twitter Followers Count

php
function tcount( $username, $field, $display = false ) {
$interval = 3600;
$cache = get_option('tcount');
$url = 'http://api.twitter.com/1/users/show.json?screen_name='.urlencode($username);
if ( false == $cache )
$cache = array();
if ( !isset( $cache[$username][$field] ) ) {
$cache[$username][$field] = NULL;
$cache[$username]['lastcheck'] = 0;
}
if( $cache[$username]['lastcheck'] $value)
if( isset($data->$key) )
$cache[$username][$key] = $data->$key;
$cache[$username]['lastcheck'] = time();
}
else {
$cache[$username]['lastcheck'] = time()+60;
}
update_option( 'tcount , $cache );
}
if ( false != $display )
echo $cache[$username][$field];
return $cache[$username][$field];
}
?>

To Display Twitter Count Use Code Below

echo tcount(“Your_twitter_user_name”,”followers_count”);

 

Face Book Fan Count

Have to download facebook.php file into theme folder.
Get file from following url http://github.com/facebook/php-sdk/raw/master/src/facebook.php

<?php 
require_once('facebook.php'); 
$facebook = new Facebook(array(
'155396374496007',
'secret' => '33a5523fa4fdeecb2e5c29d55afc9627',
'cookie' => true,
));
$result = $facebook->api(array(
'method' => 'fql.query',
'query' => 'select fan_count from page where page_id = give_ur_page_ID_here;'
));
$fb_fans = $result[0]['fan_count'];
?>

To Display facebook fans Count Use Code Below

echo $fb_fans;

 

Site status for wordpress users using wordpress.com stats

If you installed wordpress.com stats plugin you can easily bring your site visitor status to front page. Copy the code below and paste where ever you wants to show.

php
$post_stats = null;
$views=0;
if ( function_exists('stats_get_csv') )
{
global $post_views;
$post_stats = stats_get_csv('postviews', 'days=-1&limit=-1&summarize');
foreach($post_stats as $posts)
{
$views+=$posts['views'];
}
echo "Visitors:".$views;
}
?>

tim thumb your image

1.thimthumb your image with reduced in width and height also with the file size..
2.download the file under link and use instruction as in file…
3.Warning you can’t increase the size of image beyond the original size..
4.you can only reduce size of image..
5.Put this file under your themes directory and cal the file path as specified in the thumb_image.php file

Design a site like this with WordPress.com
Get started