29-04-2007, 11:18
|
#1 (permalink)
|
|
Designers are strange :)
Join Date: Jan 2007
Location: Shrewsbury, UK
Posts: 1,733
|
Subnav Script
OK so I found this script which basically puts text over an image so I dont need to create loads of images for my subnav. Here it is....
PHP Code:
<?
header('Content-type: image/gif');
$im = @imagecreatefromgif('_img/nav_link.gif');
$black = imagecolorallocate($im, 51, 102, 153);
$font = 'Verdana';
$text = strtoupper($_REQUEST['text']);
$box = imagettfbbox ( 6.4, 0, $font, $text);
$tw=$box[2]-$box[0];
$th=$box[5]-$box[3];
$px = (imagesx($im) -$tw)/2;
$py = (imagesy($im) -$th)/2;
imagettftext($im, 6.4, 0, $px, 12, $black, $font, $text);
imagegif($im);
imagedestroy($im);
?>
The only problem is that it doesn't work. My images are in the right place etc but it doesn't show up. I am using it here.
Any ideas????
|
|
|
|