1 |
dpavlin |
1.1 |
<? |
2 |
|
|
$max_page="##MAXPAGE##"; |
3 |
|
|
$text = "##TEXT##"; |
4 |
|
|
|
5 |
|
|
Header("Content-type: image/png"); |
6 |
|
|
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past |
7 |
|
|
header ("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); // always modified |
8 |
|
|
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 |
9 |
|
|
header ("Pragma: no-cache"); // HTTP/1.0 |
10 |
|
|
$string=implode($argv," "); |
11 |
|
|
if (file_exists("head.png")) { |
12 |
|
|
$im = @imagecreatefrompng("head.png"); |
13 |
|
|
} else { |
14 |
|
|
$im = @imagecreate (460, 72); |
15 |
|
|
} |
16 |
|
|
$white = ImageColorAllocate($im, 255, 255, 255); |
17 |
|
|
$red = ImageColorAllocate($im, 255, 0, 0); |
18 |
|
|
$black = ImageColorAllocate($im, 0, 0, 0); |
19 |
|
|
$px = (imagesx($im)-7.5*strlen($string))/2; |
20 |
|
|
if (! isset($pcnt)) { |
21 |
|
|
$pcnt=floor(substr(basename($HTTP_REFERER),0,2)/$max_page*100); |
22 |
|
|
} |
23 |
|
|
if (file_exists("head.ttf")) { |
24 |
|
|
ImageTTFText($im, 6, 0, 10, 65, $black, dirname($PATH_TRANSLATED)."/head.ttf", sprintf($text ,$pcnt)); |
25 |
|
|
} else { |
26 |
|
|
ImageString($im, 2, 10,55, sprintf($text,$pcnt), $black); |
27 |
|
|
} |
28 |
|
|
$w=80; |
29 |
|
|
ImageRectangle($im,149,60,151+$w,66,$black); |
30 |
|
|
ImageFilledRectangle($im,150,61,150+floor($pcnt*$w/100),65,$red); |
31 |
|
|
ImagePng($im); |
32 |
|
|
ImageDestroy($im); |
33 |
|
|
|
34 |
|
|
?> |