AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   Convert STEAMID to Steam Community ID (https://forums.alliedmods.net/showthread.php?t=60899)

8088 10-09-2010 11:20

Re: Convert STEAMID to Steam Community ID
 
No URL, no errors...how do you expect to be helped?

cooltruck 10-09-2010 13:07

Re: Convert STEAMID to Steam Community ID
 
Well there was no errors I would just input the steam id and the page refreshes and does not give the output. I am not uploading the .php onto my webhost, already tried did not work.

8088 10-09-2010 13:18

Re: Convert STEAMID to Steam Community ID
 
Oh ok.

cooltruck 10-10-2010 14:54

Re: Convert STEAMID to Steam Community ID
 
Got any Ideas you can advise on how to fix this :)

8088 10-10-2010 16:21

Re: Convert STEAMID to Steam Community ID
 
Tons. But, like I hinted, it will be a lot easier to narrow it down if you provide relevant information. Like errors (enable error reporting) and a link to your page.

raylapa 10-19-2010 16:29

Re: Convert STEAMID to Steam Community ID
 
Hi folks!

First of all - nice work! I have integrated the script (slightly modified) into our community website.

Only one thing: if you put in just the community ID like 7656119XXXXXXXXXX it gives you a "Error: invalid input" ...

If you put in the complete URL http://steamcommunity.com/profiles/7656119XXXXXXXXXX it works perfectly.

Tested as well at noobsticks.com - same error.

Rizla 10-23-2010 02:38

Re: Convert STEAMID to Steam Community ID
 
anyone help me with this? its only returning one link and thats the one thats already in there:

Code:

//convert the steam id
$auth_id = mysql_query("SELECT authid FROM sb_admins WHERE srv_group = 'Rizla Server' OR srv_group = 'Lower Server Admins' OR srv_group = 'Server Admins'");
$community_id *= 2;
$community_id += 76561197960265728;
$community_id += substr($authid, 8, 1);
$site = "http://steamcommunity.com/profiles/".$community_id ."";


//show the data
 
Print "<table border cellpadding=3>"; while($info = mysql_fetch_array( $data ))
{
Print "<tr>"; Print "<td>".$info['user'] . "</td> "; Print "<td>".$info['authid'] . " </td>"; Print "<td>$site</td></tr>"; } Print "</table>";

im a total php noob, been trying to get this working for a few hours now, looked through countless pages for help

it returns this and only this for every row:
http://steamcommunity.com/profiles/76561197960265736

8088 10-23-2010 09:58

Re: Convert STEAMID to Steam Community ID
 
Rizla, I suppose you're trying to do something like this:
PHP Code:

//prepare the query
$sql "SELECT authid FROM sb_admins WHERE srv_group = 'Rizla Server' OR srv_group = 'Lower Server Admins' OR srv_group = 'Server Admins'";

//perform the query and store the resource in '$query'
$query mysql_query($sql);

//see if there are any results at all
if(mysql_num_rows($query) > 0)
{
    
//there is one or more results, start printing the table
    
print '<table border="1" cellpadding="3">';
    
    
//fetch every possible row from the resource and do nice stuff with it
    
while($info mysql_fetch_assoc$data ))
    {
        
//convert the steamid into a community id
        
$community_id = ((substr($authid10)) * 2) + 1197960265728 + (substr($authid81)); 
        
        
//create a link to the Steam community profile
        
$site 'http://steamcommunity.com/profiles/'.$community_id;
        
        
//print the table row with all the info
        
print '<tr><td>'.$info['user'].'</td><td>'.$info['authid'].'</td><td>'.$site.'</td></tr>';
    }
    
//close the table
    
print '</table>';
}
//there are no results
else print 'No results'

Quote:

Originally Posted by raylapa (Post 1329602)
Only one thing: if you put in just the community ID like 7656119XXXXXXXXXX it gives you a "Error: invalid input" ...

Thanks, I'll post a fix later.

Rizla 10-23-2010 17:52

Re: Convert STEAMID to Steam Community ID
 
thanks for your help, but if i just use the commnuity id converting part i only gives me:

http://steamcommunity.com/profiles/

if i use your whole thing whilst still using my first query i get:

http://steamcommunity.com/profiles/1197960265728 for all of them still

[removed that part - fixed]

8088 10-23-2010 18:08

Re: Convert STEAMID to Steam Community ID
 
Oops, I made a mistake while copy/pasting.

Replace
PHP Code:

while($info mysql_fetch_assoc$data )) 

with
PHP Code:

while($info mysql_fetch_assoc($query)) 



All times are GMT -4. The time now is 06:33.

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