Zimtgruen
Erfahrenes Mitglied
nachdem ich jetzt einen serverumzug hatte funktioniert bei mir folgende datei nicht mehr. Liegt vielleicht daran, dass sie nicht php5-fähig ist, wie kann ich das lösen?
P ist eine Zahl, die aus einer Datenbank kommt.
Kann mir jemand helfen?
PHP:
<?
/* Free PHP Tutorial of Online Arts (www.online-arts.de), by Roman Martin*/
header('Content-Type: image/gif',true); //header wird verschickt
$Width = 200; //Breite
$P = $_GET['P'];
$Hight = 10; //Hˆhe
$L = 1;
$BGColor = HEX_RGB("AFAFAF"); //Hintergrund Farbe:
$FGColor = HEX_RGB("372F44"); //Vordergrundfarbe:
$S = "FFFFFF";
$img = imagecreatetruecolor($Width, $Hight); //Image erstellen
$FillWidth = $Width/100 * $P; //Vordergrundgröße berechnen (Mathematik^^)
$col = imagecolorallocate($img, $BGColor[0],$BGColor[1],$BGColor[2]); //Farben zuweisen
$col2 = imagecolorallocate($img, $FGColor[0],$FGColor[1],$FGColor[2]); //Farben zuweisen
imagefill($img, 0, 0, $col); //Hintergrund wird gefüllt
imagefilledrectangle($img,0,0,$FillWidth,$Hight,$col2); //Vordergrund
if ($L == 1) {
$FilenameBG = 'http://web16.672.bces.de/MV/grafiken/bg.jpg'; //Hintergrund-Bild
$FilenameFG = 'http://web16.672.bces.de/MV/grafiken/fg.jpg'; //Vordegrund-Bild
$ImageBG = imagecreatefromjpeg($FilenameBG); //Hintergrund einladen
list($width_origBG, $height_origBG) = getimagesize($FilenameBG); //Hintergrund skalieren
imagecopyresampled($img, $ImageBG, 0, 0, 0, 0, $Width, $Hight, $width_origBG, $height_origBG); //Hintergrund erstellen (als Bild)
$ImageFG = imagecreatefromjpeg($FilenameFG); //Vordergrund einladen
list($width_origFG, $height_origFG) = getimagesize($FilenameFG); //Hintergrund skalieren
imagecopyresampled($img, $ImageFG, 0, 0, 0, 0, $FillWidth+1, $Hight, $width_origFG, $height_origFG); //Vordergrund erstellen (als Bild)
}
$RColor = HEX_RGB(FF0000); //Randfarbe = R im URL
$col3 = imagecolorallocate($img, $RColor[0],$RColor[1],$RColor[2]); //Farben zuweisen
imagefilledrectangle($img,0,0,$Width,1,$col4); //Rand
imagefilledrectangle($img,$Width ,0,$Width-1,$Hight,$col4); //Rand
imagefilledrectangle($img,0,$Hight-2,$Width,$Hight,$col4); //Rand
imagefilledrectangle($img,0,0,1,$Hight,$col4); //Rand
if ($S != "0" OR $S == "" OR $S >= 1) {
if (strlen($S) == 6 ) { //Wenn die Stringl‰nge von S= 6 ist(also z.B: Hex Wert)
$CColor = HEX_RGB($S); //Schriftfarbe
} elseif ($S == 1 OR strlen($S) != 6) {
$CColor = HEX_RGB(FF0000); //Schriftfarbe
}
$Font = "AppleGaramondf"; //Schriftartdatei
$FontSize = $Hight / 1; //Schriftgröße (Ich hab ein drittel des gesammt höhe genommen)
$FontPositionX = $Width / 2 - 4 * imagefontwidth($Font); //Schrift horizontal zentrieren (-4 zahlen in der schrift "** %")
$FontPositionY = $Hight - (($Hight - $FontSize) / 2); //Schrift horizontal zentrieren
$col3 = imagecolorallocate($img, $CColor[0],$CColor[1],$CColor[2]); //Farbe zuweisen
imagettftext($img, $FontSize, 0, $FontPositionX, $FontPositionY, $col3, $Font, $P . " %"); //Schrift schreiben
}
imagegif($img); // Ausgabe des Bildes an den Browser
function HEX_RGB($var) //Funktion die aus dem HEX Farben einen RBG Farbenwert herausgibt (als Array)
{
$var = "#" . $var;
$var = (sscanf($var, '#%2x%2x%2x'));
return $var;
}
?>
P ist eine Zahl, die aus einer Datenbank kommt.
Kann mir jemand helfen?