Placed in: Home comprar viagra en espaƱa
comprar viagra online
comprar viagra generico barato
comprar cialis generico online
comprar cialis online seguro
Show your feedcount the way you want

Feedburner is a great tool / website to manage and control your RSS feed. I've already written an article before on how you can promote your feed to the max using a signature. Today, I'm going to show you how you can show-off the number of feed readers subscribed to your feed in your own, beautiful way.

Show your feedcount the way you want

Many bloggers use the FeedCount from Feedburner to show how many readers are subscribed to their blog. I'm pretty sure you'll have seen the following image around the net (several times):

Although you can change the color and animation style, I can't really say the chicklet is very pretty. Here's the way to show your feedcount the way you want to.

To use this technique, you'll need an account at Feedburner and a webhost that supports PHP and GD.

1. Check PHP / GD support

First, we'll need to know if the server support PHP & GD. To do so, execute the following PHP code.

echo "<h1>Server GD Support:</h1>";
echo "<xmp> ";
print_r( gd_info() );
echo "</xmp> ";

It should return something like this:

Array
(
  [GD Version] => bundled (2.0.34 compatible)
  [FreeType Support] => 1
  [FreeType Linkage] => with freetype
  [T1Lib Support] => 1
  [GIF Read Support] => 1
  [GIF Create Support] => 1
  [JPG Support] => 1
  [PNG Support] => 1
  [WBMP Support] => 1
  [XPM Support] => 1
  [XBM Support] => 1
  [JIS-mapped Japanese Font Support] => 
)

If this is correct, you can go on with the next step. Otherwise you should try another host.

2. Create a background

Use your own creativity to create a nice, fancy background that you like. This is my final result:

Feed Background

You can use my background image if you like. Just make sure you save your image as a .PNG file.

3. Use the PHP script

I created the following PHP script. Comments are included, so you'll understand.

// Let the browser know we're sending an PNG image
Header ("Content-type: image/png");
 
// Load the PNG file to use
$img_handle = imageCreateFromPNG("rss_count.png");
 
// Set the text color (RGB)
$color = ImageColorAllocate ($img_handle, 255, 250, 235);
 
// Load Feedburner Awareness
$xml = simplexml_load_file
  ("http://api.feedburner.com/awareness/1.0/GetFeedData?uri=marcofolio")
  or die ("Unable to load XML file!");
 
// Load Feedcount
$circulation = $xml->feed->entry['circulation'];
 
// Set the font (Only GDF files)
$font = imageloadfont("bmcorrode.gdf");
 
// Set the text
$line1 = "$circulation readers";
$line2 = "subscribed here.";
$line3 = "Subscribe today!";
 
// Write the lines (Image used, font used, x-pos, y-pos, text, color)
ImageString ($img_handle, $font, 100, 10, $line1, $color);
ImageString ($img_handle, $font, 100, 30, $line2, $color);
ImageString ($img_handle, $font, 120, 70, $line3, $color);
 
ImagePng ($img_handle);
ImageDestroy ($img_handle);

As you can see, the key to this is getting the Feedburner Awareness, allowing you te retrieve the circulation: Your feed count. Don't forget to change the uri= to your own Feedburner name.

If you want other GDF font files, create your own or download from Devtrolls.

4. Implement

Because this PHP script already returns a PNG image, simply use the IMG tag to show it in your website, like this.

<img src="rss_count.php" alt="Feed Count" />

Demo / Download

Here's my final result. Looks pretty nice, doesn't it? If you want a light-weight demo, please visit my demo page.

My custom feedcounter

If you don't want to copy-paste all text above, you can download the full package from my download section.

When you're going to use this on your website, feel free to place it in the comments. I wonder how creative my readers are!


Tags:  feedburner blog customize php count

Interested in this topic? You might enjoy another article I've written called

Did you like this article? Subscribe to my feed or email to keep updated on new articles.

Spread the word and submit to:
Digg!Reddit!Del.icio.us!Facebook!StumbleUpon!
 
< Prev   Next >
Subscribe

Subscribe to Marcofolio