Problem z zmianą STEAMID na nazwę użytkownika

Założony przez  Najaranyxd1.

Do obecnego kodu chciałbym dodać funkcję, która zmienia steamID na nazwę profilu na steam. KOD:
<?php
   $IkonaGracza = $PoczatekStrony;  
           while ($Admins = mysqli_fetch_assoc($WynikWynikow)) {
$IkonaGracza++;
$Steam = $Admins['auth_data'];
   echo'
<tr class="ipsClearfix" style="text-align: center">
   <td>'.$IkonaGracza.'</td>
<td>'.$Steam.'</td>
<td><a href="http://steamcommunity.com/profiles/'.ProfilSteam($Steam).'" class="ipsButton ipsButton_verySmall ipsButton_fullWidth ipsSocial ipsSocial_steam">
               <span class="ipsSocial_icon"><i class="fa fa-steam"></i></span>
               <span class="ipsSocial_text">Pokaż</span>
               </a></td>
       </tr>
       ';
?>
<?php
};

function ProfilSteam($ProfilSteamID) {
   if (preg_match('/^STEAM_/', $ProfilSteamID)) {
       $parts = explode(':', $ProfilSteamID);
       return bcadd(bcadd(bcmul($parts[2], '2'), '76561197960265728'), $parts[1]);
   } elseif (is_numeric($ProfilSteamID) && strlen($ProfilSteamID) < 16) {
       return bcadd($ProfilSteamID, '76561197960265728');
   } else {
       return $ProfilSteamID;
   }
}
/*
function ProfilSteam($ProfilSteamID, $type = 1, $instance = 1) {
   if (preg_match('/^STEAM_/', $ProfilSteamID)) {
       $parts = explode(':', str_replace('STEAM_', '', $ProfilSteamID));
       $universe = (int)$parts[0];
       if ($universe == 0)
           $universe = 1;
       $steamID = ($universe << 56) | ($type << 52) | ($instance << 32) | ((int)$parts[2] << 1) | (int)$parts[1];
       return $steamID;
   } elseif (is_numeric($ProfilSteamID) && strlen($ProfilSteamID) < 16) {
       return (1 << 56) | ($type << 52) | ($instance << 32) | $ProfilSteamID;
   } else {
       return $ProfilSteamID;
   }
} */
function toSteamID($ProfilSteamID) {
   if (is_numeric($ProfilSteamID) && strlen($ProfilSteamID) >= 16) {
       $z = bcdiv(bcsub($ProfilSteamID, '76561197960265728'), '2');
   } elseif (is_numeric($ProfilSteamID)) {
       $z = bcdiv($ProfilSteamID, '2');
   } else {
       return $ProfilSteamID;
   }
   $y = bcmod($ProfilSteamID, '2');
   return 'STEAM_0:' . $y . ':' . floor($z);
}
function IDUzytkownika($ProfilSteamID) {
   if (preg_match('/^STEAM_/', $ProfilSteamID)) {
       $split = explode(':', $ProfilSteamID);
       return $split[2] * 2 + $split[1];
   } elseif (preg_match('/^765/', $ProfilSteamID) && strlen($ProfilSteamID) > 15) {
       return bcsub($ProfilSteamID, '76561197960265728');
   } else {
       return $ProfilSteamID;
   }
}
Przy użyciu:
function EchoPlayerName($steamid){
   $xml = simplexml_load_file("http://steamcommunity.com/profiles/$steamid/?xml=1");//link to user xml
   if(!empty($xml)) {
       $username = $xml->steamID;
       echo $username;
   }
}

I mam problem z połączeniem tego, mógłby ktoś mnie nakierować?
Close ;)



Użytkownicy przeglądający ten wątek:

1 gości