/[health_html]/button.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /button.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Sat Sep 29 15:24:48 2001 UTC (22 years, 7 months ago) by ravilov
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
FILE REMOVED
Alergic semaphor is now dynamically generated.

1 ravilov 1.1 <?php
2     if (!$text) exit;
3 ravilov 1.3 $fontsize = 9; // pixels
4 ravilov 1.1 $map = array(
5     "è" => 269, "è" => 269,
6     "æ" => 263, "æ" => 263,
7     "¹" => 353, "š" => 353,
8     "¾" => 382, "ž" => 382,
9     "ð" => 273, "ð" => 273,
10     "È" => 268, "È" => 268,
11     "Æ" => 262, "Æ" => 262,
12     "©" => 352, "Š" => 352,
13     "®" => 381, "Ž" => 381,
14     "Ð" => 272, "Ð" => 272
15     );
16     while (list($k, $v) = each($map)) $text = str_replace($k, "&#".$v.";", $text);
17     $text = preg_replace("/\\\(.)/", '$1', $text);
18 ravilov 1.3 $im = ImageCreate(130, $fontsize + 10);
19 ravilov 1.1 $dark = ImageColorAllocate($im, 0x66, 0x99, 0x66);
20     $mid = ImageColorAllocate($im, 0xB6, 0xE1, 0xCB);
21     $light = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);
22     ImageFill($im, 0, 0, $mid);
23     ImageLine($im, 0, 0, ImageSX($im) - 1, 0, $light);
24     ImageLine($im, 0, 0, 0, ImageSY($im) - 1, $light);
25     ImageLine($im, ImageSX($im) - 1, 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark);
26     ImageLine($im, 0, ImageSY($im) - 1, ImageSX($im) - 1, ImageSY($im) - 1, $dark);
27     $txt = ImageColorAllocate($im, 0x33, 0x66, 0x33);
28     if ($type) {
29 ravilov 1.3 ImageTTFText($im, $fontsize, 0, 4, $fontsize + 5, $light, "verdanab.ttf", $text);
30     ImageTTFText($im, $fontsize, 0, 3, $fontsize + 4, $dark, "verdanab.ttf", $text);
31     } else ImageTTFText($im, $fontsize, 0, 3, $fontsize + 4, $txt, "verdanab.ttf", $text);
32 ravilov 1.1 $types = ImageTypes();
33     if ($types & IMG_GIF) {
34     Header("Content-Type: image/gif");
35     ImageGIF($im);
36     } else if ($types & IMG_PNG) {
37     Header("Content-Type: image/png");
38     ImagePNG($im);
39     } else if ($types & IMG_JPG) {
40     Header("Content-Type: image/jpeg");
41     ImageJPEG($im);
42     } else if ($types & IMG_WBMP) {
43     Header("Content-Type: image/vnd.wap.wbmp");
44     ImageWBMP($im);
45     }
46     ImageDestroy($im);
47     ?>

  ViewVC Help
Powered by ViewVC 1.1.26