home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / iart.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  3.0 KB  |  97 lines

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