I've been trying to make a dynamic signature image for my forum users, we've got the image and everything but it uses a non standard font. How would I get the script to utilize it?
<?php
include_once("settings.php");
$bg = "sigbg.png";
$im = @ImageCreateFromPNG($bg);
// white background and blue text
$textcolor = imagecolorallocate($im, 255, 255, 255);
//mysql stuff to get member's username from request
mysql_connect($sitesettings['dbserver'], $sitesettings['dbuser'], $sitesettings['dbpw']);
mysql_select_db($sitesettings['dbname']);
$result = mysql_query("SELECT * FROM smf_members WHERE ID_MEMBER = $_REQUEST[id]") or die(mysql_error());
mysql_close;
while($row = mysql_fetch_array( $result )) {
$name = $row['realName'];
$posts = $row['posts'];
$registered = strftime("%D", $row['dateRegistered']);
$lastlogin = strftime("%D", $row['lastLogin']);
}
mysql_free_result($result);
$font = 3;
// write the string at the top left
imagestring($im, $font, 55, 1, $name, $textcolor);
imagestring($im, $font, 55, 17, $posts, $textcolor);
imagestring($im, $font, 118, 34, $registered, $textcolor);
imagestring($im, $font, 90, 50, $lastlogin, $textcolor);
// output the image
header("Content-type: image/png");
header("font-family: Arial");
imagepng($im);
?>
That's roughly what I got now. I don't remember if the header("font-family: Arial"); bit works. I haven't messed with this in a long time but my users are asking for it again so I'm attempting to oblige them.