Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84.
<?php // konwersja STEAM_ID na STEAM_64 function GetID($steam_id) { $auth = explode(':', $steam_id); $fid = $auth[2]; $fid *=2; $fid += 76561197960265728; $fid += $auth[1]; return $fid; } // pobranie danych o graczu function GetPlayerInfo($steam) { $xml = @simplexml_load_file("http://steamcommunity.com/profiles/$steam?xml=1"); if(xml) { $Steam_array = array( "Name" => $xml -> steamID, "Sid" => $xml -> steamID64, "online" => $xml -> onlineState, "avatar" => $xml -> avatarIcon, ); return $Steam_array; } } // pobranie STEAM_ID $steamID=$_GET['id']; // ew. konwersja w razie potrzeby if(!preg_match('/^d+$/u',$steamID)){ $steamID=preg_replace('/^steam_/ui','',$steamID); if(preg_match('/^d:d:d+$/u',$steamID)) $steamID=GetID($steamID); else die("ERR 01 :: Niepoprawne STEAM_ID"); } // pobranie danych o użytkowniku $name = GetPlayerInfo($steamID); //$name = GetPlayerInfo("76561198030298845"); // IMG // utworzenie obrazka z tla $im = imagecreatefrompng("SteamBg1.png"); // kolor bialy $grey = imagecolorallocate($im, 150, 150, 150); // czcionki define('TEMPESTA', 'tempesta.ttf'); define('TAHOMA', 'tahoma.ttf'); define('VERDANA', 'verdana.ttf'); define('TAHOMA_BOLD', 'tahoma_bold.ttf'); // okreslenie typu zawartosci header('Content-type: image/png'); $num=-1; foreach($name as & $i){ switch(++$num){ case 0:{ // nick imagettftext($im, 10, 0, 220, 50, $grey, VERDANA, $i); break; } case 1:{ // SteamID imagettftext($im, 10, 0, 220, 75, $grey, VERDANA, $i); break; } case 2:{ // SteamID imagettftext($im, 10, 0, 220, 100, $grey, VERDANA, $i); break; } } } imagepng($im); imagedestroy($im); ?>
Dodanych wklejek: 11179
Powered By (Pav32) Pastebin © 2011