hello
i was hoping someone with php skills could solve this for me? i know its more a joomla not a cb question, but hopefully it is a simple code?
in php i can easily make membership card using the following:
Code:
<?php
//Set the Content Type
header('Content-type: image/jpeg');
// Create Image From Existing File
$jpg_image = imagecreatefromjpeg('membershipcard.jpeg');
// Allocate A Color For The Text
$white = imagecolorallocate($jpg_image, 255, 255, 255);
$black = imagecolorallocate($jpg_image, 0, 0, 0);
// Set Path to Font File
$font_path = 'swiss.ttf';
$fontsize = 8;
// Set Text to Be Printed On Image
$text1 = "Test HKPA membership card";
$text2 = "TEST HKPA MEMBERSHIP CARS TWO";
// Print Text On Image size, angle, left offset 0=left, vert offset 0=top
imagettftext($jpg_image, $fontsize, 0, 10, 20, $black, $font_path, $text1);
imagettftext($jpg_image, $fontsize, 0, 10, 30, $black, $font_path, $text2);
// Send Image to Browser
imagejpeg($jpg_image);
// Clear Memory
imagedestroy($jpg_image);
?>
where the membership card image is written over by the test text to produce an image that is printable. but of course i would like to be able to do this within a joomla article so as to put cb data in the membership card from the database(s)
the issue is getting the
Code:
$jpg_image = imagecreatefromjpeg('membershipcard.jpeg');
line to get the image from the server ( and the same with the font )
how do i make this happen? i have the sourcerer plugin to be able to use php in an article.
any ideas? i am new to php so sorry if it a basic question.
thankyou