Advertisement
LawyerMorty

Untitled

May 1st, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. <?php
  2. // The script is created by Jarno Sulmann (a.k.a Pilovali/pity123)
  3. // Contact: jarnosulmann@gmail.com
  4. // All rights reserved. Created on: 1-5-2014
  5.  
  6. // if the image won't load proper, put a // before the header to show the error
  7. header ("Content-type: image/png");
  8.  
  9. // Turn off error reporting, so the fucking script does not show notices
  10. error_reporting(0);
  11.  
  12. // Image create shit
  13. $imgname = "background.png";
  14. $im = @imagecreatefrompng ($imgname);
  15.  
  16. // Create some colors
  17. $white = imagecolorallocate($im, 255, 255, 255);
  18. $grey = imagecolorallocate($im, 128, 128, 128);
  19. $black = imagecolorallocate($im, 0, 0, 0);
  20.  
  21. // MySQL
  22. $acc = '##NAME##';
  23. $base = mysql_connect ('127.0.0.1', 'GTI****', '*****');
  24. mysql_select_db ('***', $base);
  25.  
  26. $sql = "SELECT name, balance FROM banking WHERE name = '$acc'";
  27. $req = mysql_query($sql);
  28. while($data = mysql_fetch_array($req)){
  29. $name = $data['name'];
  30. $cash = $data['balance'];
  31.  
  32. // You can use any .tff font
  33. $font = './font.ttf';
  34. $pname = 'Name: '.$name;
  35. $money = 'Money: $'.number_format($cash);
  36.  
  37. // The text here, there are 2 one is for shadow.
  38. // imagettftext(image, font size, angle, x, y, color, font, "text");
  39. imagettftext($im, 30, 0, 4, 30, $black, $font, "gti bank");
  40. imagettftext($im, 30, 0, 6, 31, $white, $font, "gti bank");
  41. // Name Test
  42. imagettftext($im, 18, 0, 115, 20, $black, $font, $pname);
  43. imagettftext($im, 18, 0, 117, 21, $white, $font, $pname);
  44. // Money Text
  45. imagettftext($im, 18, 0, 115, 47, $black, $font, $money);
  46. imagettftext($im, 18, 0, 117, 48, $white, $font, $money);
  47.  
  48. // Some stuff
  49. imagepng($im);
  50. imagedestroy($im);
  51. }
  52. mysql_close();
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement