comparison _xampp/iart.php @ 0:b12c99b7c3f0

commit for previous development
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Mon, 19 Jan 2015 17:13:49 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b12c99b7c3f0
1 <? include("langsettings.php"); ?>
2 <?
3 // Copyright (C) 2002/2003 Kai Seidler, oswald@apachefriends.org
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19 $text=@$_REQUEST['text'];
20 if($text=="") $text="ceci n est pas un ami d apache";
21 if(@$_REQUEST['img']!=1)
22 {
23 ?>
24 <html>
25 <head>
26 <meta name="author" content="Kai Oswald Seidler">
27 <link href="xampp.css" rel="stylesheet" type="text/css">
28 <title></title>
29 </head>
30
31 <body>
32 &nbsp;<p>
33 <h1><?php echo $TEXT['iart-head']; ?></h1>
34
35 <img width="520" height="320" src="iart.php?img=1&text=<?=urlencode($text)?>" alt=""><p class="small">
36 <?=$TEXT['iart-text1']?><p>
37 <form name="ff" action="iart.php" method="get">
38 <input type="text" name="text" value="<?php echo htmlentities($text); ?>" size="30">
39 <input type="submit" value="<?=$TEXT['iart-ok']?>">
40 </form>
41 <p>
42 <?php include("showcode.php"); ?>
43 </body>
44 </html>
45 <?
46 exit;
47 }
48
49 $fontfile="/opt/lampp/htdocs/xampp/AnkeCalligraph.TTF";
50
51 $size=9;
52 $h=320;
53 $w=520;
54
55 $im = ImageCreate ( $w, $h );
56
57 $fill = ImageColorAllocate ( $im , 251, 121, 34 );
58 $light = ImageColorAllocate ( $im, 255, 255, 255 );
59 $corners = ImageColorAllocate ( $im , 153 , 153 , 102 );
60 $dark = ImageColorAllocate ( $im , 51, 51 , 0 );
61 $black = ImageColorAllocate ( $im , 0, 0 , 0 );
62
63 $colors[1] = ImageColorAllocate ( $im , 255 , 255 , 255 );
64 $colors[2] = ImageColorAllocate ( $im , 255*0.95 , 255*0.95 , 255*0.95 );
65 $colors[3] = ImageColorAllocate ( $im , 255*0.9 , 255*0.9 , 255*0.9 );
66 $colors[4] = ImageColorAllocate ( $im , 255*0.85 , 255*0.85 , 255*0.85 );
67
68 header("Content-Type: image/png");
69
70 srand(time());
71 $c=1;
72 $anz=10;
73 $step=4/$anz;
74 for($i=0;$i<$anz;$i+=1)
75 {
76 $size=rand(7,70);
77 $x=rand(-390,390);
78 $y=rand(-100,400);
79 $color=$colors[$c];
80 $c+=$step;
81 ImageTTFText ($im, $size, 0, $x, $y, $color, $fontfile, $text);
82 }
83
84 ImageLine ( $im , 0 ,0, $w-1, 0, $light );
85 ImageLine ( $im , 0 ,0, 0, $h-2, $light );
86 ImageLine ( $im , $w-1,0, $w-1, $h, $dark );
87 ImageLine ( $im , 0 ,$h-1, $w-1, $h-1, $dark );
88 ImageSetPixel ( $im , 0 ,$h-1, $corners );
89 ImageSetPixel ( $im , $w-1 ,0, $corners );
90
91 ImagePNG ( $im );
92 ?>