Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 1.29 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3.  
  4. $verbindung = mysql_connect('localhost','root','***');
  5. mysql_select_db('r63bg', $verbindung);
  6.  
  7.  
  8. $image = "new_hotelview.png";
  9. putenv('GDFONTPATH=' . realpath('.'));
  10. $font = 'font';
  11. $username = $_GET['username'];
  12.  
  13. $get = mysql_fetch_array(mysql_query("SELECT last_online FROM users WHERE username = '" . $username . "'"));
  14. $d1 = date("d-m-y", $get[0]);
  15. $adapt = $get[0]-7200;
  16. $d2 = date("H:i", $adapt);
  17.  
  18. $im = imagecreatefrompng($image);
  19.  
  20. imagealphablending($im, true);
  21. imagesavealpha($im, true);
  22.  
  23.  
  24. $wc = ImageColorAllocate ($im, 255, 255, 255);
  25. $red = ImageColorAllocate ($im, 255, 0, 0);
  26. $blk = imagecolorallocate($im, 0, 0, 0);
  27.  
  28.  
  29. imagettftext($im, 16, 0, 740, 285, $blk, $font , "Hallo, " . $username . "!");
  30. //imagettftext($im, 16, 0, 800, 285, $blk, $font , "" . $username . "!");
  31. if($get[0] != 0)
  32. {
  33.         imagettftext($im, 12, 0, 785, 310, $blk, $font , "Dein letzter Login war: " . $d1 . "");
  34.         imagettftext($im, 12, 0, 785, 330, $blk, $font , "um " . $d2 . "! Wir vermissen dich :)");
  35. }
  36. else
  37. {
  38.         imagettftext($im, 12, 0, 785, 310, $blk, $font , "Willkommen im FruitHotel!");
  39.         imagettftext($im, 12, 0, 785, 330, $blk, $font , "Wir wünschen dir viel Spass ;)");
  40. }
  41.  
  42. header("Content-Type: image/png");
  43. Imagepng($im);
  44. echo $im;
  45. ImageDestroy ($im);
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55. ?>