se7enek

sygna

Mar 30th, 2013
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.02 KB | None | 0 0
  1. <?php
  2.     header('Content-Type: image/png');
  3.  
  4. $db = mysql_connect("localhost", "XXXXXX","XXXXXXXXX");
  5. mysql_select_db("bonzaii_staty",$db);
  6.  
  7. $wynik = mysql_query("SELECT * FROM Stats_player WHERE player='". $_GET['id'] ."'") or die(mysql_error());
  8. $wynik2 = mysql_query("SELECT * FROM Stats_move WHERE player='". $_GET['id'] ."'") or die(mysql_error());
  9. $wynik3 = mysql_query("SELECT * FROM Stats_block WHERE player='". $_GET['id'] ."' AND blockID='56'") or die(mysql_error());
  10. $wiersz = mysql_fetch_array($wynik);
  11. $wiersz2 = mysql_fetch_array($wynik2);
  12. $wiersz3 = mysql_fetch_array($wynik3);
  13.  
  14. $dni = floor($wiersz['playtime'] / 86400);
  15. $godzin = floor(($wiersz['playtime'] - $dni*86400) / 3600);
  16. $minut = floor(($wiersz['playtime'] - $godzin*3600 - $dni*86400) / 60);
  17. $sekund = floor($wiersz['playtime'] - $godzin*3600 - $dni*86400 - $minut*60);
  18.  
  19. $czas = "".$dni." d ".$godzin." g ".$minut." m ".$sekund." s.";
  20. $dystans = round($wiersz2['distance']);
  21.  
  22. $ip = 'bonzaii.eu';
  23. $port = 25565;
  24. $sprawdz = @fsockopen($ip, $port, $empty, $empty, 1);
  25.  
  26.  
  27.  
  28.         $tlo = imagecreatefrompng('tlo.png');
  29.         $bialy = imagecolorallocate($tlo, 255, 255, 255);
  30.         $czerwony = imagecolorallocate($tlo, 255, 0, 0);
  31.         $zielony = imagecolorallocate($tlo, 0, 255, 0);
  32.         $niebieski = imagecolorallocate($tlo, 0, 0, 255);
  33.         $ciemnozielony = imagecolorallocate($tlo, 25, 105, 25);
  34.         $jasnoniebieski = imagecolorallocate($tlo, 35, 125, 225);
  35.         $zielony2 = imagecolorallocate($tlo, 25, 150, 25);
  36.         $lajtowy = imagecolorallocate($tlo, 255, 180, 0);
  37.  
  38.         $arial = 'arial.ttf';
  39.         $visitor = 'visitor1.ttf';
  40.         $gremlins = 'gremlins.ttf';
  41.         $gothika = 'gothika.ttf';
  42.         $impact = 'impact-label.ttf';
  43.         $impact2 = 'impact-label-reversed.ttf';
  44.         $resident = 'resident-evil.ttf';
  45.         $tr = 'tr.ttf';
  46.         $final = 'final.ttf';
  47.  
  48.        
  49. if($wiersz['player'] == null){
  50. imagettftext($tlo, 20, 0, 350, 35, $bialy, $gothika, "Bonzaii.eu");
  51. if($sprawdz !== FALSE)
  52. {
  53.         imagettftext($tlo, 13, 0, 390, 50, $zielony, $visitor, "ONLINE");
  54. }else{
  55.         imagettftext($tlo, 13, 0, 385, 50, $czerwony, $visitor, "OFFLINE");
  56. }  
  57.  
  58. imagettftext($tlo, 15, 0, 20, 65, $jasnoniebieski, $tr, "Niepoprawny nick");
  59. imagettftext($tlo, 15, 0, 20, 85, $jasnoniebieski, $tr, "lub brak uzytkownika w bazie");
  60.  
  61. }else{
  62.    
  63.         imagettftext($tlo, 20, 40, 266, 115, $bialy, $gothika, "Bonzaii.eu");
  64.  
  65. if($sprawdz !== FALSE)
  66. {
  67.         imagettftext($tlo, 13, 40, 310, 100, $zielony, $visitor, "ONLINE");
  68. }else{
  69.         imagettftext($tlo, 13, 40, 305, 105, $czerwony, $visitor, "OFFLINE");
  70. }      
  71.        
  72.  
  73.         imagettftext($tlo, 13, 0, 100, 25, $jasnoniebieski, $tr, $wiersz['player']);
  74.        
  75.         imagettftext($tlo, 13, 0, 20, 45, $ciemnozielony, $gremlins, "czas online ");
  76.         imagestring($tlo, 4, 127, 32, $czas, $lajtowy);
  77.        
  78.         imagettftext($tlo, 13, 0, 20, 65, $ciemnozielony, $gremlins, "dolaczen  ");
  79.         imagestring($tlo, 4, 110, 52, $wiersz['joins'], $lajtowy);
  80.  
  81.         imagettftext($tlo, 13, 0, 20, 85, $ciemnozielony, $gremlins, "jadl juz ");
  82.         imagettftext($tlo, 13, 0, 135, 85, $ciemnozielony, $gremlins, "razy");
  83.         imagestring($tlo, 4, 100, 72, $wiersz['omnomnom'], $lajtowy);
  84.  
  85.         imagettftext($tlo, 13, 0, 20, 105, $ciemnozielony, $gremlins, "przeszedl blokow");
  86.         imagestring($tlo, 4, 180, 92, $dystans, $lajtowy);
  87.        
  88.         $diax = imagecreatefrompng('DiamondOre.png');
  89.         imagecopy($tlo,$diax,400,32,0,0,16,16);
  90.         imagestring($tlo, 4, 425, 32, $wiersz3['break'], $lajtowy);
  91.        
  92.         $bench = imagecreatefrompng('workbenchfront.png');
  93.         imagecopy($tlo,$bench,400,52,0,0,16,16);
  94.         imagestring($tlo, 4, 425, 52, $wiersz['itemscrafted'], $lajtowy);
  95.        
  96.         imagestring($tlo, 4, 400, 72, "XP", $zielony2);
  97.         imagestring($tlo, 4, 425, 72, $wiersz['xpgained'], $lajtowy);
  98.        
  99.         $word = imagecreatefrompng('speech-bubble.png');
  100.         imagecopy($tlo,$word,400,92,0,0,16,16);
  101.         imagestring($tlo, 4, 425, 92, $wiersz['wordssaid'], $lajtowy);
  102.  
  103. }
  104.  
  105.     imagepng($tlo);
  106.     imagedestroy($tlo);
  107. ?>
Advertisement
Add Comment
Please, Sign In to add comment