From 479deff71d6fbf9fa890f128760b3a3014267b62 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 24 Feb 2010 00:01:50 +0200 Subject: msg field, shift-click --- index.php | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/index.php b/index.php index 4fc5276..086f5cf 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,7 @@ // @created 29.08.2009 $hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); $text = (!empty($_POST['t'])) ? $_POST['t'] : $hostname; +$msg = (!empty($_POST['m'])) ? $_POST['m'] : ''; $r = (is_numeric($_POST['r'])) ? $_POST['r'] : round(rand(1,255)); $g = (is_numeric($_POST['g'])) ? $_POST['g'] : round(rand(1,255)); @@ -24,7 +25,7 @@ if (!empty($_POST)) imagefill($im, 0, 0, $bg_color); - putenv("GDFONTPATH=" . realpath('.')); + putenv('GDFONTPATH=' . realpath('.')); $y = ($height/2)-($font_size/2)+25; $x = $font_size*1.5; @@ -32,8 +33,9 @@ if (!empty($_POST)) $grey = imagecolorallocate($im, 28, 28, 28); imagettftext($im, $font_size, 0, $x+1, $y+1, $grey, $font, $text); imagettftext($im, $font_size, 0, $x, $y, $text_color, $font, $text); + imagettftext($im, 12, 0, $x, $y+20, $text_color, $font, $msg); - header("Content-type: image/png"); + header('Content-type: image/png'); imagepng($im); imagedestroy($im); exit(); @@ -47,8 +49,19 @@ if (!empty($_POST)) - - Desklabel + + + desklabel