View file time/time.php

File size: 1.72Kb
<?php

include'functions.php';
$count=6;
$width=75;
$height=16;
$font_file="fonts/$font.ttf";
$char_angle_shadow=0;
if($font == '1')
{
$char_align=14;
$start=3;
$font_size=12;
}
if($font == '2')
{
$char_align=12;
$start=6;
$font_size=12;
}
if($font == '3')
{
$char_align=15;
$start=3/2;
$font_size=11;
}
if($font == '4')
{
$char_align=14;
$start=10/3;
$font_size=12;
}
if($font == '5')
{
$char_align=16;
$start=6;
$font_size=12;
}
$interval=24;

$chars=date('H:i:s');

$image=imagecreatetruecolor($width, $height);

$background_color=imagecolorallocate($image, $rbg1, $rbg2, $rbg3); /* rbg-цвет фона */
$background=imagecolorallocate($image, $rbg4, $rbg5, $rbg6); /* rbg-цвет цифр */
$font_color=imagecolorallocate($image, $rbg7, $rbg8, $rbg9); /* rbg-цвет тени */

imagefill($image, 0, 0, $background_color);

$str="";

$num_chars=strlen($chars);

	$char=$chars;
	$char_angle=rand($char_angle_min, $char_angle_max);
	imagettftext($image, $font_size, $char_angle, $start, $char_align, $font_color, $font_file, $char);
	imagettftext($image, $font_size, $char_angle+$char_angle_shadow*(rand(0, 1)*2-1), $start, $char_align, $background, $font_file, $char);
	$start+=$interval;

	for ($i=0; $i<$width; $i++)
	{
		for ($j=0; $j<$height; $j++)
		{
			$rgb=imagecolorat($image, $i, $j);
			$r=($rgb>>16) & 0xFF;
			$g=($rgb>>8) & 0xFF;
			$b=$rgb & 0xFF;
			$rn=$r+255*$k/100;
			$gn=$g+255*$k/100;		
			$bn=$b+255*$k/100;
			if ($rn<0) $rn=0;
			if ($gn<0) $gn=0;
			if ($bn<0) $bn=0;
			if ($rn>255) $rn=255;
			if ($gn>255) $gn=255;
			if ($bn>255) $bn=255;
			$color=imagecolorallocate($image, $rn, $gn, $bn);
			imagesetpixel($image, $i, $j , $color);
	}
}

header("Content-type: image/gif");
imagepng($image);
imagedestroy($image);

?>