welcome

welcome to my destiny :)
I'm just a guy who is smile a lot
and the god give me a power
-------------------------------------------

You say anything Just tell me all your sweet lies

-------------------------------------------------

Time may change my life
But my heart remains the same to you
Time may change your heart
My love for you never changes

Monday, March 17, 2008

visitor count

Heres a script for the visitor count:

Save this script to a file named visnum.php
PHP Code:
// Configure the vars below
$width = "88";
$height = "31";
$visitor_number_filename = 'num.txt';
$visitor_number_x = "15";
$visitor_number_y = "15";
//Color for the visitor number
$visitor_number_color_r = "255";//Red
$visitor_number_color_g = "255";//Green
$visitor_number_color_b = "255";//Blue
$visitor_text = "Visitors:";
$visitor_text_x = "10";
$visitor_text_y = "2";
//Color for visitor text
$visitor_text_color_r = "255";//Red
$visitor_text_color_g = "255";//Green
$visitor_text_color_b = "255";//Blue
//Custom Font
$custom_font = "no";// yes or no :: if you set this to yes then you must set a ttf file below
$font_file = 'path/to/font.ttf';
$font_size = "5";
//Not a custom font user? there are 5 built in fonts to choose from 1, 2, 3, 4, 5
$font = "2";
//Custom Background
$custom_background = "no";// yes or no :: if you set this to yes then you must set a png file below
$background_image = 'path/to/image.png';

/******* Do not edit below this line *******/
/*******************************************/
header('Content-Type: image/png');

$w = $width;
$h = $height;
$s = $font_size;
$cf = $custom_font;
$ff = $font_file;
$f = $font;
$file = $visitor_number_filename;
$nx = $visitor_number_x;
$ny = $visitor_number_y;
$ncr = $visitor_number_color_r;
$ncg = $visitor_number_color_g;
$ncb = $visitor_number_color_b;
$vt = $visitor_text;
$vx = $visitor_text_x;
$vy = $visitor_text_y;
$vcr = $visitor_text_color_r;
$vcg = $visitor_text_color_g;
$vcb = $visitor_text_color_b;
$cb = $custom_background;
$bgi = $background_image;
$num = (is_file($file))? file_get_contents($file) : '0';
$num++;
file_put_contents($file, $num);

switch(
$cb) {
case
"yes":
$im = imagecreatefrompng($bgi);
break;
case
"no":
$im = imagecreatetruecolor($w, $h);
break;
}
$nc = imagecolorallocate($im, $ncr, $ncg, $ncb);
$vc = imagecolorallocate($im, $vcr, $vcg, $vcb);

switch(
$cf) {
case
"yes":
imagettftext($im, $s, 0, $nx, $ny, $nc, $ff, $num);
imagettftext($im, $s, 0, $vx, $vy, $vc, $ff, $vt);
break;
case
"no":
imagestring($im, $f, $nx, $ny, $num, $nc);
imagestring($im, $f, $vx, $vy, $vt, $vc);
break;
}
imagepng($im);
imagedestroy($im);
?>
And call it as any other image in html like this:
HTML Code:
"visnum.php" border="0" />
And it looks like this:

I think it is pretty self-explanatory but if you have any questions post them here.

No comments:

LinkWithin

Related Posts Plugin for WordPress, Blogger...

Fm-radio-on-my-site

for you forever

Birthday - 13/12/1964 Death - 02/05/1997 bye bye hide

google analysis

ຊີວິດກໍ່ເໝືອນລະຄອນຕ່າງທີ່ບໍ່ສາດມາດຫຼິ້ນຄືນໃໝ່ໄດ້
ຊີວິດແມ່ນການສະແດງ ທີ່ບໍ່ມີຜູ້ກຳກັບ

online
Online Casino


website counter