Raised This Month: $51 Target: $400
 12% 

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
8088
Veteran Member
Join Date: Jan 2008
Old 06-26-2011 , 22:20   Re: Convert STEAMID to Steam Community ID
Reply With Quote #301

I don't really feel like uploading all kinds of versions for various CMSs since this script was meant to form a standalone page, but you can try to make it work yourself. Have a try by using print (or printf) instead of echo. If that doesn't work, chances are it expects you to work with output buffering/control. Either way, their documentation should help you further.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 06-30-2011 , 01:51   Re: Convert STEAMID to Steam Community ID
Reply With Quote #302

Personally I grabbed the code of one of the versions that supports caching and modified it to only get what I wanted. If you are always going to be using an icon that is a particular size you should just hard code it that way so it will load faster.
__________________
zeroibis is offline
8088
Veteran Member
Join Date: Jan 2008
Old 06-30-2011 , 02:06   Re: Convert STEAMID to Steam Community ID
Reply With Quote #303

I'm not sure what you mean by that (if it was directed at me at all).
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Mist2
New Member
Join Date: Dec 2009
Old 08-14-2011 , 12:41   Re: Convert STEAMID to Steam Community ID
Reply With Quote #304

Sorry this is totally off topic

- 8088 spoke to you on steam a while back , not sure if you would be interested

I own Steamid.co.uk , I had a dynamic profile thing i spent weeks on piecing together which has now been taken down – The start of it used the idea of your script and then change the input all around and went off and grabbed the XML which was then processed and then outputted.

I have BIG plans for the website however its very advanced – I don’t obviously want to mention them on a public forum , But it will require registration , mysql and a few queries ect.

Wanted it to be a great project, I can do graphics and design – And a little coding

Just wondered if you where / or knew any one intrested?


Cheers , Martin

Mist2 is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 08-14-2011 , 13:04   Re: Convert STEAMID to Steam Community ID
Reply With Quote #305

Quote:
Originally Posted by Mist2 View Post
Sorry this is totally off topic
Don't you think it would be more useful to send 8088 a PM?
__________________
DarthNinja is offline
Stinkyfax
BANNED
Join Date: Aug 2007
Old 11-09-2011 , 10:34   Re: Convert STEAMID to Steam Community ID
Reply With Quote #306

Quote:
Originally Posted by devicenull View Post
Some MySQL stored procedures to do this for you (Note: Assumes you are entering these using the command line client, otherwise you may need to fiddle with the delimiters)

Code:
DELIMITER | 
drop function SteamToInt|

create function SteamToInt(steamid varchar(64))
RETURNS bigint(64)
BEGIN
    declare authserver int;
    declare authid int;

    set authserver = cast(substr(steamid,9,1) as unsigned integer);
    set authid = cast(substr(steamid,11) as unsigned integer);
    return 76561197960265728+(authid*2)+authserver;
END |

drop function IntToSteam|

create function IntToSteam(communityid bigint(64))
RETURNS varchar(64)
BEGIN
    declare ret varchar(64);
    declare authserver int;
    declare authid bigint;

    set communityid = communityid-76561197960265728;
    set authserver = mod(communityid,2);
    set communityid = communityid-authserver;
    set authid = communityid/2;
    set ret = concat("STEAM_0:",authserver,":",authid);
    return ret;
END |
DELIMITER ;
Usage:
Code:
select SteamToInt("STEAM_0:1:1199"), IntToSteam(76561197960268127);

For those who get next error on creating those functions:
Code:
ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
add keyword DETERMENISTIC between RETURNS an BEGIN keywords
Stinkyfax is offline
McFlurry
Veteran Member
Join Date: Mar 2010
Location: RemoveEdict(0);
Old 12-29-2011 , 17:06   Re: Convert STEAMID to Steam Community ID
Reply With Quote #307

I realized that berni's original stock doesn't work if "(auth*2) + 60265728 + server" exceeds or is equal to 100,000,000. So I wrote this stock that should work for a very long time(unfortunately only until the above overflows the integer). This is a modification of berni's stock on page 8.
PHP Code:
//authsize can simply be strlen(auth)+1
stock AuthIDToFriendID(const String:auth[], authsizeString:friend[], friendsize)
{    
    if(
StrEqual(auth"BOT"))
    {
        
Format(friendfriendsize"");
        return;
    }    
    
decl String:authcopy[authsize];
    
strcopy(authcopyauthsizeauth);
    
ReplaceString(authcopystrlen(authcopy), "STEAM_""");

    if(
StrEqual(authcopy"ID_LAN"))
    {
        
Format(friendfriendsize"");
        return;
    }

    
decl String:toks[3][16];

    
ExplodeString(authcopy":"tokssizeof(toks), sizeof(toks[]));

    new 
iserver StringToInt(toks[1]);
    new 
iauth StringToInt(toks[2]);

    new 
ifriend = (iauth*2) + 60265728 iserver;
    new 
part1 765611979;
    if(
ifriend >= 100000000)
    {
        
decl String:part3[32];
        
decl String:part2[32];
        
Format(part3sizeof(part3), "%d"ifriend);
        new 
size strlen(part3)-8;
        
Format(part2sizeof(part2), "");
        for(new 
i;i<size;i++)
        {
            
part2[i] = part3[i];
        }    
        
Format(part3sizeof(part3), "%s"part3[size]);
        
part1 += StringToInt(part2);
        
Format(friendfriendsize"%d%s"part1part3);
    }
    else
    {
        
Format(friendfriendsize"%d%d"part1ifriend);
    }    

__________________

Last edited by McFlurry; 12-30-2011 at 22:23.
McFlurry is offline
Send a message via Skype™ to McFlurry
pizzahut
Senior Member
Join Date: Oct 2004
Old 01-02-2012 , 15:59   Re: Convert STEAMID to Steam Community ID
Reply With Quote #308

Quote:
Originally Posted by 8088 View Post
Try this one. Solely using cURL this time, so the allow_url_fopen setting won't matter.
I had the same issues with BC Math and allow_url_fopen so I used the cURL version of your script. I had two issues though with custom URLs:

- $a is only set if the item is numeric, thus this line doesn't work:
Code:
curl_setopt($ch,CURLOPT_URL,'http://steamcommunity.com/id/'.$a.'?xml=1');
I've replaced it with
Code:
curl_setopt($ch,CURLOPT_URL,'http://steamcommunity.com/id/'.$item.'?xml=1');
- The function pre is undefined, causing the script to stop:
Code:
pre($info);
I've commented it out.

On a side note, $notice isn't set. If an error pops up regarding it, the lines containing this variable can be commented out.

Last edited by pizzahut; 01-02-2012 at 17:04.
pizzahut is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-22-2012 , 05:58   Re: Convert STEAMID to Steam Community ID
Reply With Quote #309

For the interested few, I've designed a quick SourceMod function to produce CommunityIDs (SteamID64) that will work with all individual SteamIDs, including the newer ones.

https://forums.alliedmods.net/showthread.php?t=183443
__________________
11530 is offline
nelsonsimpsonz
Member
Join Date: Feb 2012
Old 05-22-2012 , 17:11   Re: Convert STEAMID to Steam Community ID
Reply With Quote #310

how i convert very steamids ?
nelsonsimpsonz is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode