Witam, witam, witam. Przejdę od razu do sedna sprawy. Mam problem, to oczywiste. Znalazłem na internecie, generator userbarów. Wszystko działa pięknie, po - przerabiałem go wszystko działa. Tylko że chciałbym zrobić coś takiego, bo mam 10 teł do wyboru, i chciałem zrobić tak że jak ktoś wchodzi na index wpisuje ten swój tekst to odrazu pokazują sie te tła z jego napisem. A pokazuje się tylko pierwszy obrazek, i nic więcej. Narobiłem syfu w generatorze, ale sam juz nie wiem jak to zrobić.

To jest ta moja zabawa. (outline/stroke, czyli obrys napisów sam dodawałem i działa.)

  1. <?php
  2.  
  3. function imagettftextoutline(
  4. $image,
  5. $size,
  6. $angle,
  7. $x,
  8. $y,
  9. $color,
  10. $fontfile,
  11. $text,
  12. $outlinewidth = 1, // 1px outline
  13. $outlinecolor = 0 // black
  14. ) {
  15. // First offset diagonally
  16. imagettftext($image, $size, $angle, $x - $outlinewidth,
  17. $y - $outlinewidth, $outlinecolor, $fontfile, $text);
  18. imagettftext($image, $size, $angle, $x - $outlinewidth,
  19. $y + $outlinewidth, $outlinecolor, $fontfile, $text);
  20. imagettftext($image, $size, $angle, $x + $outlinewidth,
  21. $y - $outlinewidth, $outlinecolor, $fontfile, $text);
  22. imagettftext($image, $size, $angle, $x + $outlinewidth,
  23. $y + $outlinewidth, $outlinecolor, $fontfile, $text);
  24. // Then offset orthogonally
  25. imagettftext($image, $size, $angle, $x - $outlinewidth, $y,
  26. $outlinecolor, $fontfile, $text);
  27. imagettftext($image, $size, $angle, $x + $outlinewidth, $y,
  28. $outlinecolor, $fontfile, $text);
  29. imagettftext($image, $size, $angle, $x, $y - $outlinewidth,
  30. $outlinecolor, $fontfile, $text);
  31. imagettftext($image, $size, $angle, $x, $y + $outlinewidth,
  32. $outlinecolor, $fontfile, $text);
  33. // Output text
  34. imagettftext($image, $size, $angle, $x, $y, $color, $fontfile,
  35. $text);
  36. }
  37.  
  38.  
  39. header("Content-type: image/png");
  40.  
  41. $obraz1 = imagecreatefrompng("blekit.png");
  42. $obraz2 = imagecreatefrompng("czerw.png");
  43. $obraz3 = imagecreatefrompng("czerw2.png");
  44. $obraz4 = imagecreatefrompng("default.png");
  45. $obraz5 = imagecreatefrompng("niebieski.png");
  46. $obraz6 = imagecreatefrompng("ogien.png");
  47. $obraz7 = imagecreatefrompng("pink.png");
  48. $obraz8 = imagecreatefrompng("pink2.png");
  49. $obraz9 = imagecreatefrompng("pl.png");
  50. $obraz10 = imagecreatefrompng("pomaranczowe.png");
  51. $obraz11 = imagecreatefrompng("szare.png");
  52. $obraz12 = imagecreatefrompng("zielone.png");
  53. $obraz13 = imagecreatefrompng("zolty.png");
  54.  
  55.  
  56. $czcionka_biala1 = imagecolorallocate($obraz1, 255, 255, 255);
  57. $czcionka_czarna1 = imagecolorallocate($obraz1, 0, 0, 0);
  58. $czcionka_biala2 = imagecolorallocate($obraz2, 255, 255, 255);
  59. $czcionka_czarna2 = imagecolorallocate($obraz2, 0, 0, 0);
  60. $czcionka_biala3 = imagecolorallocate($obraz3, 255, 255, 255);
  61. $czcionka_czarna3 = imagecolorallocate($obraz3, 0, 0, 0);
  62. $czcionka_biala4 = imagecolorallocate($obraz4, 255, 255, 255);
  63. $czcionka_czarna4 = imagecolorallocate($obraz4, 0, 0, 0);
  64. $czcionka_biala5 = imagecolorallocate($obraz5, 255, 255, 255);
  65. $czcionka_czarna5 = imagecolorallocate($obraz5, 0, 0, 0);
  66. $czcionka_biala6 = imagecolorallocate($obraz6, 255, 255, 255);
  67. $czcionka_czarna6 = imagecolorallocate($obraz6, 0, 0, 0);
  68. $czcionka_biala7 = imagecolorallocate($obraz7, 255, 255, 255);
  69. $czcionka_czarna7 = imagecolorallocate($obraz7, 0, 0, 0);
  70. $czcionka_biala8 = imagecolorallocate($obraz8, 255, 255, 255);
  71. $czcionka_czarna8 = imagecolorallocate($obraz8, 0, 0, 0);
  72. $czcionka_biala9 = imagecolorallocate($obraz9, 255, 255, 255);
  73. $czcionka_czarna9 = imagecolorallocate($obraz9, 0, 0, 0);
  74. $czcionka_biala10 = imagecolorallocate($obraz10, 255, 255, 255);
  75. $czcionka_czarna10 = imagecolorallocate($obraz10, 0, 0, 0);
  76. $czcionka_biala11 = imagecolorallocate($obraz11, 255, 255, 255);
  77. $czcionka_czarna11 = imagecolorallocate($obraz11, 0, 0, 0);
  78. $czcionka_biala12 = imagecolorallocate($obraz12, 255, 255, 255);
  79. $czcionka_czarna12 = imagecolorallocate($obraz12, 0, 0, 0);
  80. $czcionka_biala13 = imagecolorallocate($obraz13, 255, 255, 255);
  81. $czcionka_czarna13 = imagecolorallocate($obraz13, 0, 0, 0);
  82.  
  83. $tekst1 = $_GET['tekst1'];
  84. $tekst2 = $_GET['tekst2'];
  85. $tekst3 = $_GET['tekst3'];
  86. $tekst4 = $_GET['tekst4'];
  87. $tekst5 = $_GET['tekst5'];
  88. $tekst6 = $_GET['tekst6'];
  89. $tekst7 = $_GET['tekst7'];
  90. $tekst8 = $_GET['tekst8'];
  91. $tekst9 = $_GET['tekst9'];
  92. $tekst10 = $_GET['tekst10'];
  93. $tekst11 = $_GET['tekst11'];
  94. $tekst12 = $_GET['tekst12'];
  95. $tekst13 = $_GET['tekst13'];
  96.  
  97. $font1 = 'visitor1.ttf';
  98. $font2 = 'visitor1.ttf';
  99. $font3 = 'visitor1.ttf';
  100. $font4 = 'visitor1.ttf';
  101. $font5 = 'visitor1.ttf';
  102. $font6 = 'visitor1.ttf';
  103. $font7 = 'visitor1.ttf';
  104. $font8 = 'visitor1.ttf';
  105. $font9 = 'visitor1.ttf';
  106. $font10 = 'visitor1.ttf';
  107. $font11 = 'visitor1.ttf';
  108. $font12 = 'visitor1.ttf';
  109. $font13 = 'visitor1.ttf';
  110.  
  111. imagettftextoutline($obraz1, 8, 0, 260, 13, $czcionka_biala1, $font1, $tekst1, 1);
  112. imagettftextoutline($obraz2, 8, 0, 260, 13, $czcionka_biala2, $font2, $tekst2, 1);
  113. imagettftextoutline($obraz3, 8, 0, 260, 13, $czcionka_biala3, $font3, $tekst3, 1);
  114. imagettftextoutline($obraz4, 8, 0, 260, 13, $czcionka_biala4, $font4, $tekst4, 1);
  115. imagettftextoutline($obraz5, 8, 0, 260, 13, $czcionka_biala5, $font5, $tekst5, 1);
  116. imagettftextoutline($obraz6, 8, 0, 260, 13, $czcionka_biala6, $font6, $tekst6, 1);
  117. imagettftextoutline($obraz7, 8, 0, 260, 13, $czcionka_biala7, $font7, $tekst7, 1);
  118. imagettftextoutline($obraz8, 8, 0, 260, 13, $czcionka_biala8, $font8, $tekst8, 1);
  119. imagettftextoutline($obraz9, 8, 0, 260, 13, $czcionka_biala9, $font9, $tekst9, 1);
  120. imagettftextoutline($obraz10, 8, 0, 260, 13, $czcionka_biala10, $font10, $tekst10, 1);
  121. imagettftextoutline($obraz11, 8, 0, 260, 13, $czcionka_biala11, $font11, $tekst11, 1);
  122. imagettftextoutline($obraz12, 8, 0, 260, 13, $czcionka_biala12, $font12, $tekst12, 1);
  123. imagettftextoutline($obraz13, 8, 0, 260, 13, $czcionka_biala13, $font13, $tekst13, 1);
  124.  
  125. imagepng($obraz1);
  126. imagepng($obraz2);
  127. imagepng($obraz3);
  128. imagepng($obraz4);
  129. imagepng($obraz5);
  130. imagepng($obraz6);
  131. imagepng($obraz7);
  132. imagepng($obraz8);
  133. imagepng($obraz9);
  134. imagepng($obraz10);
  135. imagepng($obraz11);
  136. imagepng($obraz12);
  137. imagepng($obraz13);
  138. imagedestroy($obraz1);
  139. imagedestroy($obraz2);
  140. imagedestroy($obraz3);
  141. imagedestroy($obraz4);
  142. imagedestroy($obraz5);
  143. imagedestroy($obraz6);
  144. imagedestroy($obraz7);
  145. imagedestroy($obraz8);
  146. imagedestroy($obraz9);
  147. imagedestroy($obraz10);
  148. imagedestroy($obraz11);
  149. imagedestroy($obraz12);
  150. imagedestroy($obraz13);
  151.  
  152. ?>


A normalnie, bez mojej przeróbki wygląda tak.

  1. <?php
  2.  
  3. header("Content-type: image/png");
  4.  
  5. $obraz = imagecreatefrompng("geo.png");
  6.  
  7. $czcionka_biala = imagecolorallocate($obraz, 255, 255, 255);
  8. $czcionka_czarna = imagecolorallocate($obraz, 0, 0, 0);
  9.  
  10. $tekst = $_GET['tekst'];
  11.  
  12. $font = 'arial.ttf';
  13.  
  14. imagettftext($obraz, 11, 0, 5, 14, $czcionka_biala, $font, $tekst);
  15.  
  16. imagepng($obraz);
  17. imagedestroy($obraz);
  18.  
  19. ?>


Potrzebuje pomocy, dzięki. winksmiley.jpg

// edit:

Lub ktoś mógłby mi wytłumaczyć jak zrobić coś takiego że w indexie jest coś takiego że klika się: i ma do wyboru tło: czerwone, niebieskie i tak dalej...