Guest

Harpyon

By: a guest on Nov 20th, 2009  |  syntax: PHP  |  size: 3.77 KB  |  hits: 171  |  expires: Never
download  |  raw  |  embed  |  report abuse
Copied
  1. <?php
  2.  
  3. // -HP-'s leet signature script. ftw
  4.  
  5. // array containing all the quotes. each index is a sub-array with one entry for each "saying"
  6. $quotes = array(
  7.  
  8. "<JatGoodwin> oh fuck, i think i ate a spring for my multitool.",
  9. "<HP_> you think you..ate it?",
  10. "<JatGoodwin> well, im cleaning one of my multitools right now... and i set a pile of oreos right next to it.. and i think i ate a little sping",
  11. ),
  12. "<Moose> I didn't know how to divide when I was in 9th grade.",
  13. "<Anticept> im one of those guys that could do algebra in the first grade",
  14. "<JatGoodwin> i'm one of those guys that threw rocks at the girls in first grade",
  15. ),
  16. "l3ull: Sorry, I got \"occupied\"",
  17. "-HP-: occupied? does that include your girlfriend? ^^",
  18. "l3ull: I'll leave that to your imagination",
  19. ),
  20. "<R0x0r`> dude i need some help",
  21. "<R0x0r`> adv ballsocket wont work :/",
  22. "<Anticept> it requires balls",
  23. "<Anticept> which you dont have",
  24. ),
  25. "<Gmanmik> i don't like racial idiots",
  26. "<Gmanmik> being italian is no excuse for bad english",
  27. "<Gmanmik> i copy this",
  28. "<Gmanmik> i can send to this idiots a simple virus to take up VERY FAST your pin",
  29. ),
  30. "Black Phoenix: Wire mod was replaced by a giant pancake",
  31. ),
  32. "<Foss> you can't scrape wolfram",
  33. "(...)",
  34. "<HP> .wolfram 5*6",
  35. "<FailBot> Result: 30",
  36. ),
  37. "<Black_Phoenix> I have more hobbies than this washing machine microcontroller has pins",
  38. ),
  39. "<Anticept> DAMNIT HP",
  40. "<Anticept> i cracked my screen because i smashed a shoe against it",
  41. "<Anticept> thanks to your bug",
  42. ),
  43. "<Azrael-> oh man i remember learning german through the medium of song",
  44. "<Azrael-> siebenmal in der woche ich habe hausaufgaben",
  45. "<TomyLobo> that sucks for you",
  46. "<TomyLobo> habe ich*",
  47. "<Azrael-> ich kann nicht deutsch",
  48. "<TomyLobo> s/nicht/kein/",
  49. "<Azrael-> ich care nicht",
  50. ),
  51. "<ryland> hi",
  52. "<JatGoodwin> nou",
  53. "<ryland> nou?",
  54. "<JatGoodwin> NOU MOTHER FUCKER!",
  55. "<ryland> ok...",
  56. ),
  57. "<ryland> how does one become a moderator?",
  58. "<HP_> you sex flux",
  59. "<Azrael-> ryland: that question isn't really relevant considering that you're the asker, is it?",
  60. "<Azrael-> It's a complicated affair. It involves sacrificing an eagle at one point.",
  61. "<Matte_> I assraped flux",
  62. "<Azrael-> And not just any eagle, mind you.",
  63. "<Anticept> and giving me blowjobs.",
  64. ),
  65. "<Anticept> now see ryland, bull... bull was a different story",
  66. "<Anticept> he became a moderator in a way you DONT want to know",
  67. "<Anticept> but note it involves a toothbrush, a ruler, and a tire.",
  68. "<Bull> Damn don't tell him that anti",
  69. ),
  70. );
  71.  
  72. // randomize it
  73. shuffle($quotes);
  74.  
  75. // font and image size
  76. $font = 3;
  77. $width = 600;
  78. $height = 0;
  79.  
  80. // height is dynamic based on needed lines
  81. foreach($quotes[0] as $line)
  82. {
  83.         // word wrap the line
  84.         $line = explode("\n", wordwrap(trim($line), floor($width / imagefontwidth($font)), "\n", true));
  85.         $height = $height + imagefontheight($font)*count($line);
  86. }
  87.  
  88. // create the image and define colors
  89. $image = imageCreate($width, $height);
  90. $colorback = imageColorAllocate($image, 0, 0, 0);
  91. $colorfore = imageColorAllocate($image, rand(1,255), rand(1,255), rand(1,255));
  92.  
  93. // fill it with black. which becomes transparent
  94. imageFilledRectangle($image, 0, 0, $width, $height, $colorback);
  95.  
  96. // draw the lines of the first quote (which is random because of shuffle)
  97. $i = 0;
  98. foreach($quotes[0] as $line)
  99. {
  100.         $line = explode("\n", wordwrap(trim($line), floor($width / imagefontwidth($font)), "\n", true));
  101.         foreach($line as $text)
  102.         {
  103.                 imagestring($image, $font, 0, $i, $text, $colorfore);
  104.                 $i += imagefontheight($font);
  105.         }
  106. }
  107.  
  108. imageInterlace($image, 1);
  109. imageColorTransparent($image, $colorback);
  110.  
  111. header("Content-type:  image/png");
  112. imagepng($image);
  113.  
  114. ?>