HI all.
I have a site called
www.gamesigs.co.uk which basically lets people choose an image and put text on it for use in forums as signatures. It works fine but there are 2 things that i would like to do to it that i cant seem to work out.
1) I would like a number to display on the pages that shows how many people have created a signature since. I do not want this so it shows every page hit or unique visit becuase this would give the wrong number. I think it would need to be how many times the submit button was clicked or how many times the sigcreated page was visited. As the sig created page is a variable ie. sigcreated?name=nsdcn,font=ncdc etc. I dont know how to do it.
2) After you click the submit button you are taken to the sig created page. Here it shows your signature in the top left corner of a blank page. I would like for the signature to be placed in tables like a proper page so i could put writing around it etc. However becuase of the way the code is written it prevents me doing this.
Please help me solve these 2 issues.
The script for the sigcreated.
php page looks like this:
- Code: Select all
<?php
header("Content-type: image/jpeg");
$name = stripslashes($_GET['name']);
$size = stripslashes($_GET['size']);
$centre = stripslashes($_GET['centre']);
$font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';
$fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED
$fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN
$fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE
$lines = stripslashes($_GET['lines']);
function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
///
}
if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '47')
{
$bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg';
}
$im = imagecreatefromjpeg($bgpic);
//Calculate, the centre:
for(;;){
list($image_width, $image_height) = getimagesize($bgpic);
list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
$text_width = $right_x - $left_x;
if($image_width > $text_width+5){
break;
}
$size = $size - .5;
if($size == 1){
die('Script not responding to decreasing font size, in other words: try using less letters.');
}
}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height/2);
$textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
if($centre== 'y'){
imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);
}else{
imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);
}
imagegif($im);
imagedestroy($im);
?>
Thanks so much!
