/[health_html]/semafor.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

Diff of /semafor.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by ravilov, Sat Sep 29 15:24:48 2001 UTC revision 1.2 by ravilov, Sat Sep 29 17:57:26 2001 UTC
# Line 1  Line 1 
1  <?php  <?php
2            include_once("inc/sem_stat.php");
3          $fontsize = 7;  // pixels          $fontsize = 7;  // pixels
4          $map = array(          if ($msg) {
5                  "è" => 269, "è" => 269,                  $map = array(
6                  "æ" => 263, "æ" => 263,                          "è" => 269, "è" => 269,
7                  "¹" => 353, "š" => 353,                          "æ" => 263, "æ" => 263,
8                  "¾" => 382, "ž" => 382,                          "¹" => 353, "š" => 353,
9                  "ð" => 273, "ð" => 273,                          "¾" => 382, "ž" => 382,
10                  "È" => 268, "È" => 268,                          "ð" => 273, "ð" => 273,
11                  "Æ" => 262, "Æ" => 262,                          "È" => 268, "È" => 268,
12                  "©" => 352, "Š" => 352,                          "Æ" => 262, "Æ" => 262,
13                  "®" => 381, "Ž" => 381,                          "©" => 352, "Š" => 352,
14                  "Ð" => 272, "Ð" => 272                          "®" => 381, "Ž" => 381,
15          );                          "Ð" => 272, "Ð" => 272
16          while (list($k, $v) = each($map)) $msg = str_replace($k, "&#".$v.";", $msg);                  );
17          $msg = preg_replace("/\\\(.)/", '$1', $msg);                  while (list($k, $v) = each($map)) $msg = str_replace($k, "&#".$v.";", $msg);
18                    $msg = preg_replace("/\\\(.)/", '$1', $msg);
19            }
20          $im = ImageCreateFromPNG("img/semafor.png");          $im = ImageCreateFromPNG("img/semafor.png");
21          $black = ImageColorAllocate($im, 0x00, 0x00, 0x00);          $black = ImageColorAllocate($im, 0x00, 0x00, 0x00);
22          $white = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);          $white = ImageColorAllocate($im, 0xFF, 0xFF, 0xFF);
23          $red = ImageColorAllocate($im, 0xE3, 0x19, 0x24);          $red = ImageColorAllocate($im, 0xE3, 0x19, 0x24);
24          $yellow = ImageColorAllocate($im, 0xED, 0xD2, 0x05);          $yellow = ImageColorAllocate($im, 0xED, 0xD2, 0x05);
25          $green = ImageColorAllocate($im, 0x66, 0xCC, 0x66);          $green = ImageColorAllocate($im, 0x66, 0xCC, 0x66);
26          if ($r1) ImageFill($im, 22, 51, $red);          if ($stabla[0]) ImageFill($im, 22, 51, $red);
27          if ($r2) ImageFill($im, 59, 51, $red);          if ($trave[0]) ImageFill($im, 59, 51, $red);
28          if ($r3) ImageFill($im, 97, 51, $red);          if ($korov[0]) ImageFill($im, 97, 51, $red);
29          if ($y1) ImageFill($im, 22, 68, $yellow);          if ($stabla[1]) ImageFill($im, 22, 68, $yellow);
30          if ($y2) ImageFill($im, 59, 68, $yellow);          if ($trave[1]) ImageFill($im, 59, 68, $yellow);
31          if ($y3) ImageFill($im, 97, 68, $yellow);          if ($korov[1]) ImageFill($im, 97, 68, $yellow);
32          if ($g1) ImageFill($im, 22, 86, $green);          if ($stabla[2]) ImageFill($im, 22, 86, $green);
33          if ($g2) ImageFill($im, 59, 86, $green);          if ($trave[2]) ImageFill($im, 59, 86, $green);
34          if ($g3) ImageFill($im, 97, 86, $green);          if ($korov[2]) ImageFill($im, 97, 86, $green);
35          $date = "zagreb ".strftime("%d.%m.%y.");          $date = "zagreb ".strftime("%d.%m.%y.");
36          ImageTTFText($im, $fontsize, 0, 32, 26, $white, "verdana.ttf", $date);          ImageTTFText($im, $fontsize, 0, 32, 26, $white, "verdana.ttf", $date);
37          ImageTTFText($im, $fontsize, 0, 10, 120, $white, "verdana.ttf", $msg);          ImageTTFText($im, $fontsize, 0, 10, 120, $white, "verdana.ttf", $msg);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26