Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 16 gadiem
pirms 16 gadiem
pirms 16 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. function pig() {
  3. $pig_str = <<<EOT
  4. _._ _..._ .-', _.._(`))
  5. '-. ` ' /-._.-' ',/
  6. ) \ '.
  7. / _ _ | \
  8. | a a / PHP |
  9. \ .-. ;
  10. '-('' ).-' ,' ;
  11. '-; | .'
  12. \ \ /
  13. | 7 .__ _.-\ \
  14. | | | ``/ /` /
  15. jgs /,_| | /,_/ /
  16. /,_/ '`-'
  17. EOT;
  18. $canvas = caca_create_canvas(0, 0);
  19. caca_set_color_ansi($canvas, CACA_RED, CACA_WHITE);
  20. caca_import_string($canvas, $pig_str, "text");
  21. caca_set_color_ansi($canvas, CACA_BLUE, CACA_LIGHTGRAY);
  22. caca_put_str($canvas, 0, 0, "Я люблю Либкаку");
  23. return $canvas;
  24. }
  25. if (isset($_GET["png"])) {
  26. $canvas = pig();
  27. $font = caca_load_builtin_font("Monospace Bold 12");
  28. $width = caca_get_canvas_width($canvas) * caca_get_font_width($font);
  29. $height = caca_get_canvas_height($canvas) * caca_get_font_height($font);
  30. $img = imagecreatetruecolor($width, $height);
  31. caca_render_canvas($canvas, $font, $img);
  32. header("Content-type: image/png");
  33. imagepng($img);
  34. }
  35. else {
  36. $render_php = isset($_SERVER['SCRIPT_NAME'])
  37. ?
  38. $_SERVER['SCRIPT_NAME']
  39. :
  40. 'render.php';
  41. header("Content-type: text/html; charset=UTF-8");
  42. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  43. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  44. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  45. <head>
  46. <title>Я люблю Либкаку</title>
  47. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  48. </head>
  49. <body text="silver" bgcolor="black">
  50. <h1>Text mode:</h1>
  51. <?echo caca_export_string(pig(), "html3");?>
  52. <h1>Generated image:</h1>
  53. <a href="<?= htmlspecialchars($render_php) ?>?png=1"><img alt="[PNG]"
  54. src="<?= htmlspecialchars($render_php) ?>?png=1" border="0" /></a>
  55. </body>
  56. </html>
  57. <?php
  58. }
  59. ?>