File size: 874B
<?php
////xmintarasx
$src_file = "1.gif";
$file = "skaitliukas.txt";
$date = date("Y/m/d");
$data = fopen($file, "r");
$count = fread($data, filesize($file)); fclose($data);
$count = explode("|", $count);
if($count[2] < $date)
{
$count[0] = 1; $count[2] = $date;
}
else{$count[0] = $count[0] + 1;
}
$count[1] = $count[1] + 1;
$siandien = $count[0]; $viso = $count[1];
$count = "$count[0]|$count[1]|$count[2]";
$open = fopen($file, "w+");
fwrite($open, $count);
fclose($open);
$src = ImageCreateFromGif($src_file);
$text = ImageColorAllocate($src, 40, 24, 20);
ImageString($src, 2, 70, 16, "$siandien", $text);
ImageString($src, 2, 70, 2, "$viso", $text);
$text = ImageColorAllocate($src, 0, 0, 128); #ff0033
ImageString($src, 1, 5, 19, "koma.xz.lt", $text);
header("Content-type: image/gif");
ImageGif($src); ImageDestroy($src);
?>