its pretty straight forward......You need to put all the code to actually generate the image into a PHP file by itself, this file should then define its output as an image, and cannot output any text (so dont put any "echo"s in there..)
In your forum code you would then link in the image as follows:
Code:
<img src='generateImage.php?text=Text to convert to string'>
Just simply pass in the text you need to use in the image (ie the topic title).
The php file "generateImage" will then look something like this:
Code:
$text_to_display = $_GET["text"];
$image = ImageCreateTrueColor(200,20); // create an image of specified size
$white=ImageColorAllocate($image,255,255,255); // create a white colour to use as a background colour
$black=ImageColorAllocate($image,0,0,0); // text colour
ImageFilledRectangle($image,0,0,200,20, $white); // fill in the background colour
ImageString($image,2,2,10,$text_to_display,$black); // i think the first number is size of text, other two are position to start displaying text
// finally.......display image
Header('Content-type: image/png');
ImagePNG($image);
I havent checked the above code works, but its taken from a file i wrote so should be fine.Might need to play around with the text locations etc to make sure the text displays properly!