Hello!
I was after some help please to achieve the following...
We have flags that are displayed on our user list according to a user location, this is done via:
$flag=mysql_fetch_array(mysql_query("Select * from flag where id_flag=".$user['location']));
echo " <td class=\"details\"><img src=\"/img/flags/".$flag['img']."\" alt=\"".$flag['country']."\" /></td>\n";
Our signature code is as follows, which displays the person's names, the group they belong to, and our website address. This works perfectly (unless you see something we missed!) but what we want to achieve now is to place the flag image on it too, in the TOP RIGHT corner.
All the flag images are 18 x 12
Any help with this would be much appreciated
<?php
session_start();
include("/home/v1/htdocs/inc/connect.php");
putenv('GDFONTPATH=' . realpath('.'));
if (isset($_GET['staffid'])) {
$staffid = ($_GET['staffid']);
$num_users=mysql_num_rows(mysql_query("Select * from user where account='".$staffid."'"));
if ($num_users>0) {
$ourGroups='';
// fetch user from db
$user=mysql_fetch_array(mysql_query("Select * from user where account='".$staffid."'"));
if ($user['mg']==1)
{
$group=mysql_fetch_array(mysql_query("Select * from groups where name='MG'"));
if (strlen($ourGroups)>0)
$ourGroups.=", ".$group['function'];
else
$ourGroups.=$group['function'];
}
if ($user['DH']==1 && $ourGroups=='')
{
$group=mysql_fetch_array(mysql_query("Select * from groups where name='DH'"));
if (strlen($ourGroups)>0)
$ourGroups.=", ".$group['function'];
else
$ourGroups.=$group['function'];
}
$name = "".$user['account']."";
if (strlen($ourGroups)>0) {
$text = "\n".$ourGroups."\nhttp://us.net/";
} else {
$text = "\nNo groups\nhttp://us.net/";
}
// import background image
$img = @imagecreatefrompng("/home/v1/htdocs/img/sigbg.png");
$im = imagecreatetruecolor(185, 58);
// font details
$font = 'lvnm.ttf';
// text color
$white = imagecolorallocate($img, 255, 255, 255);
$grey = imagecolorallocate($img, 225, 225, 225);
// add the text to the image ,
$textarr = explode("\n",$text);
$i = 16;
foreach($textarr as $a){
imagettftext($img, 10, 0, 52, 15, $white, $font, $name);
imagettftext($img, 8, 0, 52, $i, $grey, $font, $a);
$i=$i+17;
}
// date in the past, so that the image is not cached by the browser
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// tell the browser what it's about to recieve
header("Content-type: image/png");
// create the png image
imagepng($img);
// clean up
imagedestroy($img);
}
}
?>