Hey guy's I add made a PHP server status script for my website and was working fine, until today it stopped working.. I have looked over the code and nothing has been changed. My problem is that It will not add text to the Image.
Here is my code that creates the image and adds text to the base image:
<?php
$im = imagecreatefrompng('../images/status.png');
if($im)
{
//colors
$black = imagecolorallocate($im, 0,0,0);
// Replace path by your own font path
$font = 'Arial Bold.ttf';
$font2 = 'Arial.ttf';
// Add server name text
imagettftext($im, 10, 0, 10, 20, $black, $font, $name);
// Add server status text
imagettftext($im, 10, 0, 10, 50, $black, $font, "Server Status: ");
imagettftext($im, 10, 0, 105, 50, $color, $font, $text);
// Add gamemode status text
imagettftext($im, 10, 0, 10, 70, $black, $font, "Gamemode: ");
imagettftext($im, 10, 0, 95, 70, $color, $font, $gamemode);
// Add IP/PORT text
imagettftext($im, 10, 0, 10, 90, $black, $font, "IP: ");
imagettftext($im, 10, 0, 30, 90, $color, $font, $ip);
imagettftext($im, 10, 0, 10, 110, $black, $font, "Port: ");
imagettftext($im, 10, 0, 45, 110, $color, $font, $port);
imagepng($im);
}
?>
Below is the output as of now (not working). It is missing the text which is being added.
http://screensnapr.com/e/WK9Kyp.png
I assume I have done everything right as it worked before. Any help is appreciated.
Thanks.
After re-uploading the files needed for this script I think it must have been the font's that may have been corrupted for some reason.