Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.31 KB | None | 0 0
  1. <?php
  2. include("../class/userclass.php");
  3.  
  4. $rbxUsername = $_POST["username"];
  5.  
  6. $assetTypeNames = ["Hat", "Face", "Gear", "HairAccessory", "FaceAccessory", "NeckAccessory", "ShoulderAccessory", "FrontAccessory"];
  7. $allUserAssetsList = [];
  8.  
  9. $getAllLimitedsFromConnectedAccounts = $userClass->getAllLimitedsFromConnectedAccounts();
  10. $getAllLimitedsUAID = $userClass->getAllLimitedsUAID();
  11.  
  12. foreach($getAllLimitedsFromConnectedAccounts as &$data) {
  13.     $username = $data[1];
  14.     $rbxid = $data[2];
  15.     $RID = $data[0];
  16.     foreach($assetTypeNames as &$value) {
  17.         $ch = curl_init();
  18.         curl_setopt($ch, CURLOPT_URL, "https://inventory.roblox.com/v1/users/" . $rbxid . "/assets/collectibles?assetType=" . $value . "&sortOrder=Asc&limit=100");
  19.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  20.         curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
  21.         $getData = curl_exec($ch);
  22.         curl_close($ch);
  23.         $getDataJson = json_decode($getData, true);
  24.         $getDataJsonArray = $getDataJson['data'];
  25.         foreach($getDataJsonArray as &$value2) {
  26.             $assetId = $value2["assetId"];
  27.             $userAssetId = $value2["userAssetId"];
  28.             $RAP = $value2["recentAveragePrice"];
  29.             $name = $value2["name"];
  30.             if(!in_array($userAssetId, $getAllLimitedsUAID)) {
  31.                 array_push($allUserAssetsList, [$assetId, $userAssetId, $RAP, $name, $username, $rbxid, $RID]);
  32.             }
  33.         }
  34.     }
  35. }
  36.  
  37. foreach($allUserAssetsList as &$value3) {
  38.     echo '
  39.    <div class="col-xs-6 col-md-3 col-lg-3">
  40.                                                 <div style="cursor: pointer;" value="' . $value3[1] . '" value2="' . $value3[0] . '" value3="' . $value3[6] . '" class="thumbnail limitedTypeSelect">
  41.                                                     <a href="#">
  42.                                                         <img src="https://www.roblox.com/Game/Tools/ThumbnailAsset.ashx?aid=' . $value3[0] . '&fmt=png&wd=420&ht=420" alt="thumb1" class="thumbimg">
  43.                                                     </a>
  44.                                                     <div style="height: 140px;" class="caption">
  45.                                                         <p><strong>' . $value3[3] . '</strong></p>
  46.                                                        <h6><strong>' . $value3[2] . ' RAP</strong></h6>
  47.                                                        <h6><strong>Owned By: ' . $value3[4] . '</strong></h6>
  48.                                                     </div>
  49.                                                 </div>
  50.                                             </div>
  51.     ';
  52. }
  53.  
  54. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement