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

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 02-14-2008 , 13:25   Re: Convert STEAMID to Steam Community ID
Reply With Quote #51

This is awsome +karma for sure!
Styles is offline
Send a message via AIM to Styles
8088
Veteran Member
Join Date: Jan 2008
Old 02-14-2008 , 18:58   Re: Convert STEAMID to Steam Community ID
Reply With Quote #52

Quote:
Originally Posted by mindstormmaster View Post
It looks like there's some code missing.
Oops, my bad. Thanks for clearing it up, KoST.
8088 is offline
yam90
Member
Join Date: Jan 2007
Old 02-18-2008 , 08:51   Re: Convert STEAMID to Steam Community ID
Reply With Quote #53

Quote:
Originally Posted by Seather View Post
I made a PHP script that batch converts both ways.

http://www.joe.to/moo/sid_convert.php

Source code attached.

you don't need to clean the input, you can paste your admins ini and have the output be the same as your input except for the links
How do i convert FriendID to SteamID? I've forgot
yam90 is offline
KoST
Senior Member
Join Date: Jul 2005
Old 02-18-2008 , 16:28   Re: Convert STEAMID to Steam Community ID
Reply With Quote #54

there u go..

PHP Code:
<?php
    $friendid
="nnnnnnnnnnnnnnnnn";
    if (
substr($friendid,-1)%2==0$server=0; else $server=1;
    
$auth=bcsub($friendid,'76561197960265728');
    
$auth=bcsub($auth,$server);
    
$auth=bcdiv($auth,2);
    echo 
"STEAM_0:".$server.':'.$auth;
?>
__________________

Last edited by KoST; 02-18-2008 at 20:20.
KoST is offline
S1acker
Junior Member
Join Date: Aug 2007
Old 03-09-2008 , 05:51   Re: Convert STEAMID to Steam Community ID
Reply With Quote #55

ty
S1acker is offline
Rick87
New Member
Join Date: Mar 2008
Old 03-10-2008 , 13:24   Re: Convert STEAMID to Steam Community ID
Reply With Quote #56

Hi,

Firstly, this script is the reason I've registered, many thanks for making it and sharing it, all those who contributed.

I'm having some problems getting it working though. First off I can't install memcache on my server, and so have removed the storage line at the end, and these lines at the start (including the closing "}" for the if statement)

PHP Code:
 $mc=new Memcache;
    if (!@
$mc->connect('localhost', <the port number to which memcached is listening to>)) {
        echo 
'memcached unavailable';
     return 
false;
    }
    
    
$ret=@$mc->get('xd'.$id);
    if (!
$ret){ 
That chunk above has been removed. I get an error about SSL transport when connecting, as seen at http://www.k-designs.org.uk/steam/steam.php and I'm at a loss as to the cause. I'd be very grateful for any assistance that people could lend.

I am using the full code that Kost posted on page 5, with the friends2steam function that 80880 posted on the same page.
Rick87 is offline
8088
Veteran Member
Join Date: Jan 2008
Old 03-10-2008 , 21:39   Re: Convert STEAMID to Steam Community ID
Reply With Quote #57

The error you are getting
Quote:
(...)
Warning: file_get_contents(http://steamcommunity.com/profiles/)
(...)
shows that somehow an incomplete (thus unusable) URL is generated. If you open the URL that is being tried to open (http://steamcommunity.com/profiles/), you get redirected to https://steamcommunity.com/profiles/ by Valve. And since you don't have the openssl module enabled, you are getting this particular error. But even if you would have openssl enabled, you'd still have a useless result.

The original code reads
PHP Code:
$data=file_get_contents("http://steamcommunity.com/profiles/".$id); 
where $id is the calculated community id. You really need to use this (or something similar) ;)
8088 is offline
Rick87
New Member
Join Date: Mar 2008
Old 03-11-2008 , 04:17   Re: Convert STEAMID to Steam Community ID
Reply With Quote #58

Thanks 8088, that's exactly what I'm using though. I'll do some troubleshooting later to see if the URL isn't being correctly generated or not, many thanks.
Rick87 is offline
Rick87
New Member
Join Date: Mar 2008
Old 03-11-2008 , 13:52   Re: Convert STEAMID to Steam Community ID
Reply With Quote #59

I've tracked down the error. The steam2friend function isn't giving any output, or even an error. I tried manually forcing the variable to be my friendid as a test, but then PHP shifts it into exponential format and things go awry. I feel like such a noob right now! Many thanks for your help.
Rick87 is offline
8088
Veteran Member
Join Date: Jan 2008
Old 03-11-2008 , 20:41   Re: Convert STEAMID to Steam Community ID
Reply With Quote #60

My offer to contact me through Steam still stands ;)
8088 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 16:30.


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