From: Mylesmadness
To be honest I just want to see how you did the image writing…
Sure thing captn.
[PHP]$lines = explode("\n",file_get_contents('text.txt'));[/PHP]
[PHP]$img = imagecreate(512, 100);
imagecolortransparent($img, $bg);
$x = XOFFSET;
$y = YOFFSET;
foreach ($lines as $line)
{
$output = array();
$line = stripslashes($line);
$color = 1;
$parts = explode(".", $line);
for ($i = 0; $i < count($parts); $i++)
{
$part = $parts[$i];
if ($i > 0) // Always skip first element because of the explode
{
if (ereg("^[0-1][0-9]?", $part, $code) && $code[0] <= count($colorTable)-1) // if this part has a code
{
$part = substr($part, strlen($code[0])); // strip code
$color = intval($code[0]);
}
else
{
$output[$i-1][0] .= ".";
$color = 1;
}
}
$output[$i] = array($part,$color);
}
foreach($output as $temp) {
imagestring($img, FONT, $x, $y, $temp[0], AllocateMircColor($temp[1]));
$x += (strlen($temp[0])*WIDTH);
}
$x = XOFFSET;
$y += HEIGHT;
}
//$IPADDR = '255.255.255.255';
imagestring($img, FONT, XOFFSET + 102 - strlen($IPADDR) * 5, $y,
" Hey there " . $IPADDR .", you are the " . $count[1] . "th hit to my signature :)", AllocateMircColor(13));
MakeBorder($img, AllocateMircColor(4)); // my own little func, not for you :D
header("Expires: Mon, 5 Jun 1999 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-type: image/gif");
imagegif($img); // sends to browser
imagedestroy($img);[/PHP]
Hopefully you can understand that :rolleyes: :)