PC HELP Forum  

Go Back   PC HELP Forum > PCHELP Forum > Internet Forum

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-11-2009, 05:10 AM
mixdev's Avatar
mixdev mixdev is offline
Administrator
 
Join Date: Jul 2009
Location: Bangalore
Posts: 33
Send a message via Yahoo to mixdev Send a message via Skype™ to mixdev
Post Firefox Download Counter for websites

It is fun to see how the Firefox initiative is growing. Years back, I had done a small hack which will bring the download counter status from the SpreadFirefox website.

I just checked that code again today. Surprisingly, it still works.



Want the code? Here it is.
PHP Code:
/* * admin [at] pchelp.in Display number of FireFox downloads graphically. * */

// It is a png image - not HTML
header("Content-type: image/png"); 
$buf file("http://feeds.spreadfirefox.com/downloads/firefox.xml?ff=1"); 

//Whats in between? 
$replace = Array("<description>","</description>"); 
$my_count trim(str_replace($replace,'',$buf[9])); 

//Put this font in the same directory. I am using Arial-Rounded
$font "ARLRDBD.TTF"

//Base image. Get it from http://pchelp.in/images/misc/3.png 
//and use it to create the image. 
$im imagecreatefrompng('images/misc/3.png'); 

//Change to any color you want. 
$grey imagecolorallocate($im66,66,66); 
imagettftext($im1004422$grey$font,$my_count." Downloads"); 
imagepng($im); 
imagedestroy($im); 
You can use your own font and base image. Let me know how you are using this
Reply With Quote
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
Forum Jump


All times are GMT +5.5. The time now is 02:36 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright © 2009 PCHELP.in. Hosted by HostMe