Guest User

Untitled

a guest
Jan 6th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. <?php
  2. $query = $_GET['id'];
  3. $imageQuery = $_GET['image'];
  4. $blurQuery= $_GET['blur'];
  5. $primary= $_GET['primary'];
  6. $secondary= $_GET['secondary'];
  7. $tertiary= $_GET['tertiary'];
  8.  
  9. $curl = curl_init();
  10.  
  11. curl_setopt_array($curl, array(
  12. CURLOPT_URL => "https://api.roleplay.co.uk/v1/player/".$query,
  13. CURLOPT_RETURNTRANSFER => true,
  14. CURLOPT_TIMEOUT => 30,
  15. CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  16. CURLOPT_CUSTOMREQUEST => "GET",
  17. CURLOPT_HTTPHEADER => array(
  18. "cache-control: no-cache"
  19. ),
  20. ));
  21.  
  22. $api= curl_exec($curl);
  23. $err = curl_error($curl);
  24.  
  25. curl_close($curl);
  26.  
  27. $api= json_decode($api, true);
  28.  
  29. $blur = false;
  30.  
  31. if ($blurQuery == "true") {
  32. $blur = "blur";
  33. } else {
  34. $blur = "";
  35. }
  36.  
  37.  
  38. $imageLink = "images/background1.png";
  39.  
  40. if ($imageQuery > 1 && $imageQuery < 5) {
  41. $imageLink = "images/background".$imageQuery.$blur.".png";
  42. } else {
  43. $imageLink = "images/background1.png";
  44. }
  45.  
  46. $primaryColor = #21b1ff;
  47. $secondaryColor= #21b1ff;
  48. $tertiaryColor= #ffffff;
  49.  
  50. $name = $api['name'];
  51. $cash = $api['cash'];
  52. $bank = $api['bank'];
  53. $totalCash = "£".number_format($cash+$bank);
  54. $vehicles= count($api['vehicles']);
  55.  
  56. header('Content-Type: image/png;');
  57. $im = @imagecreatefrompng($imageLink) or die("Didn't work - contact Ant Arni");
  58. imagettftext($im, 35, 0, 20, 63, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Bold.ttf', $name);
  59. imagettftext($im, 20, 0, 20, 120, imagecolorallocate($im, 255, 255, 255), 'OpenSans-Regular.ttf', "I have");
  60. imagettftext($im, 20, 0, 100, 120, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Regular.ttf', $totalCash);
  61. imagettftext($im, 20, 0, 20, 160, imagecolorallocate($im, 255, 255, 255), 'OpenSans-Regular.ttf', "I own");
  62. imagettftext($im, 20, 0, 100, 160, imagecolorallocate($im, 33, 177, 255), 'OpenSans-Regular.ttf', $vehicles." vehicles");
  63. imagepng($im);
  64. imagedestroy($im);
  65. ?>
Advertisement
Add Comment
Please, Sign In to add comment