dynamische Bider
#2
Ich poste dir am besten mein ganzes Script.
Ich habe es etwas erweitert. Für die IMG Funktion allein gibt es hier einen Thread:
Brunners Signatur

Mein Script:
Code:
<?php $monat = date("m",time()); $tag = date("d",time()); $juni = 30 - $tag; $juni1 = $juni + 19; $juli = 19 - $tag; if($monat=="06"){ $text[] = "Noch $juni1 Tage bis zu den Sommerferien!"; } if($monat=="07"){ if($juli!="0"){ $text[] = "Noch $juli Tag/e bis zu den Sommerferien!"; } else{ $text[] = "SOMMERFERIEN!"; } } $font = 3; $max_len = 0; foreach($text as $str) { if(strlen($str)>$max_len) { $max_len = strlen($str); } } $width = ImageFontWidth($font) * $max_len; $height = ImageFontHeight($font)*count($text); $im = imagecreate($width, $height); $black = ImageColorAllocate ($im, 0, 0, 0); // Hintergrundfarbe $white = ImageColorAllocate ($im, 0, 0, 0); $orange = ImageColorAllocate ($im, 0, 0, 0); imagecolortransparent ($im, imagecolorat ($im, 0, 0)); $y = 0; foreach($text as $str) { imagestring ($im, $font, 0, $y, $str, $orange); $y = $y + ImageFontHeight($font); } Imagepng($im); ?>

Diese Funktion ist für das Bild ab gdlib 1 wenn ich mich recht erinnere:
Code:
$font = 3; $max_len = 0; foreach($text as $str) { if(strlen($str)>$max_len) { $max_len = strlen($str); } } $width = ImageFontWidth($font) * $max_len; $height = ImageFontHeight($font)*count($text); $im = imagecreate($width, $height); $black = ImageColorAllocate ($im, 0, 0, 0); // Hintergrundfarbe $white = ImageColorAllocate ($im, 0, 0, 0); $orange = ImageColorAllocate ($im, 0, 0, 0); imagecolortransparent ($im, imagecolorat ($im, 0, 0)); $y = 0; foreach($text as $str) { imagestring ($im, $font, 0, $y, $str, $orange); $y = $y + ImageFontHeight($font); } Imagepng($im);
  Zitieren


Nachrichten in diesem Thema
dynamische Bider - von Mashoo - 30.06.2004, 19:53
[Kein Betreff] - von pattex - 30.06.2004, 20:05
[Kein Betreff] - von Mashoo - 30.06.2004, 20:26
[Kein Betreff] - von kickedINtheHEAD - 01.07.2004, 09:08

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste