ok . i got this to work finally:
Code:
<?
// VARIABLES
$user =& JFactory::getUser(); //gets user object
$path = "images/";
$fontpath = "images/fonts/";
$card = imagecreatefromjpeg($path.'membershipcard.jpeg');
// FONT
$swiss = $fontpath."swiss.ttf";
$walkway = $fontpath."walkway.ttf";
$copper = $fontpath."Copper Penny DTP.ttf";
$font_lrg = 15;
$font_med = 9;
$font_sml = 6;
// FONT COLOUR
$black = imagecolorallocate($card, 0, 0, 0);
$red = imagecolorallocate($card, 255, 0, 0);
$green = imagecolorallocate($card, 0, 255, 0);
// BACKGROUND
imagettftext($card, $font_lrg, 0, 10, 25, $red, $swiss, "MEMBERSHIP CARD");
imagettftext($card, $font_med, 0, 10, 40, $black, $swiss, "Name: ");
// JOOMLA INFO
imagettftext($card, $font_med, 0, 50, 40, $black, $swiss, $user->name);
/* EXTRA LINES ( Copy if needed )
imagettftext($card, $font_med, 0, 10, 25, $black, $swiss, "Words go here");
*/
// CREATE THE IMAGE
$filenametemp="tmp/gif".time().".gif";
ImageGIF($card, $filenametemp);
$ImageData = file_get_contents($filenametemp);
$ImageDataEnc = base64_encode($ImageData);
unlink($filenametemp); // delete the file
?>
YOUR MEMBERSHIP CARD</p>
<img src="data:image/gif;base64,<?=$ImageDataEnc?>" >
Now i just need to get the data off the database #__comprofiler table to be able to add differnt fields to the card for printing.
1. access the _comprofiler table by the current user
2. get all field of the current user
3. put them into the image in the same way as the $user->name is put in?