View Single Post
8088
Veteran Member
Join Date: Jan 2008
Old 12-30-2009 , 19:19   Re: Convert STEAMID to Steam Community ID
Reply With Quote #231

More or less. Here's a quick and dirty with help of DarthNinja's code:
PHP Code:
<?php
if ($_GET['s'])
{
    
$steam_id=strtolower($_GET['s']);
    if (
substr($steam_id,0,7)=='steam_0') {
        
$tmp=explode(':',$steam_id);
    }
    if ((
count($tmp)==3) && is_numeric($tmp[1]) && is_numeric($tmp[2])){

        
//The 'Magic Number': 76561197960265728
        //Split up so it can be calculated without an extension.



        
$steamidCalc=($tmp[2]*2)+$tmp[1]; //Work out step 1
        
$calckey='1197960265728'//Second bit of the magic number
        
$pre='7656'//First bit of the magic number

        
$steamcid=$steamidCalc+$calckey//works out the ending of the steam community ID

        
$link="http://steamcommunity.com/profiles/";
        
//echo $link; echo $pre; echo $steamcid;
        
header('Location: http://steamcommunity.com/profiles/'.$pre.$steamcid);

    };
}
?>
Usage: steamid.php?s=STEAM_0:1:23456
__________________
steamID converter with OpenSearch browser plugin
8088 is offline