PHP Code:
<?PHP
function between($betw, $betw2, $str)
{
$str = " " . $str;
$pos = strpos($str, $betw);
if ($pos > 0)
{
$str2 = substr($str, $pos + strlen($betw));
$pos2 = strpos($str2, $betw2);
if ($pos2 == 0)
return '';
return substr($str2, 0, $pos2);
}
else
return '';
}
header('Content-type: image/png');
$curl = file_get_contents('http://www.stats.srl-forums.com/index.php?action=view_script&id=275'); // read srl stats page
$Sig = imagecreatefrompng('./IronMineSig.PNG'); // get the background img from your host, in the same map as the php file
$Time = Between('Worked : <strong>', '.', $curl);
$Time = Str_Replace('Years', 'Yr,', $Time);
$Time = Str_Replace('Months', 'Ms,', $Time);
$Time = Str_Replace('Weeks', 'We,', $Time);
$Time = Str_Replace('Days', 'D,', $Time);
$Time = Str_Replace('Hours', 'H,', $Time);
$Time = Str_Replace('Minutes', 'M', $Time);
$Mined = Between('mined : <strong>', '<', $curl);
$Responds = Between('onds : <strong>', '<', $curl);
$white = imagecolorallocate($Sig, 255, 255, 255); // create color for text
imagettftext($Sig, 10, 0, 72, 61, $white, './LevelFont.ttf', Trim($Time));
imagettftext($Sig, 10, 0, 72, 96, $white, './LevelFont.ttf', Trim($Mined." Ore's"));
imagettftext($Sig, 10, 0, 72, 131, $white, './LevelFont.ttf', Trim($Responds));
imagepng($Sig); // compile sig
?>
So for a dynamic sig you need: