
Untitled
By: a guest on
Jul 20th, 2012 | syntax:
None | size: 1.29 KB | hits: 16 | expires: Never
<?php
$verbindung = mysql_connect('localhost','root','***');
mysql_select_db('r63bg', $verbindung);
$image = "new_hotelview.png";
putenv('GDFONTPATH=' . realpath('.'));
$font = 'font';
$username = $_GET['username'];
$get = mysql_fetch_array(mysql_query("SELECT last_online FROM users WHERE username = '" . $username . "'"));
$d1 = date("d-m-y", $get[0]);
$adapt = $get[0]-7200;
$d2 = date("H:i", $adapt);
$im = imagecreatefrompng($image);
imagealphablending($im, true);
imagesavealpha($im, true);
$wc = ImageColorAllocate ($im, 255, 255, 255);
$red = ImageColorAllocate ($im, 255, 0, 0);
$blk = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, 16, 0, 740, 285, $blk, $font , "Hallo, " . $username . "!");
//imagettftext($im, 16, 0, 800, 285, $blk, $font , "" . $username . "!");
if($get[0] != 0)
{
imagettftext($im, 12, 0, 785, 310, $blk, $font , "Dein letzter Login war: " . $d1 . "");
imagettftext($im, 12, 0, 785, 330, $blk, $font , "um " . $d2 . "! Wir vermissen dich :)");
}
else
{
imagettftext($im, 12, 0, 785, 310, $blk, $font , "Willkommen im FruitHotel!");
imagettftext($im, 12, 0, 785, 330, $blk, $font , "Wir wünschen dir viel Spass ;)");
}
header("Content-Type: image/png");
Imagepng($im);
echo $im;
ImageDestroy ($im);
?>