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

Convert STEAMID to Steam Community ID


Post New Thread Reply   
 
Thread Tools Display Modes
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 10-23-2010 , 19:27   Re: Convert STEAMID to Steam Community ID
Reply With Quote #261

still only returns:

http://steamcommunity.com/profiles/1197960265728

heres the whole thing, perhaps you can spot a problem:

Code:
<?php /*
Rizlas Admin Display
*/
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8">
        <title>SB Admins Page</title>
    </head>
    <body style="color: rgb(0, 0, 0);"
 alink="#ff0000" link="#ff9900" vlink="#ff9900">
 
         <?php 

// includes the connection file
include "connect.php";


//find the data

mysql_select_db("tmfgamin_bans") or die(mysql_error()); 
$data = mysql_query("SELECT user,authid FROM sb_admins WHERE srv_group = 'Rizla Server' OR srv_group = 'Lower Server Admins' OR srv_group = 'Server Admins'") or die(mysql_error());

//prepare the query
$sql = "SELECT user,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($query))
    {
        //convert the steamid into a community id
        $community_id = ((substr($authid, 10)) * 2) + 1197960265728 + (substr($authid, 8, 1)); 
        
        //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'; 


?>
    </body>
</html>
and you can see it here:

http://www.tmfgaming.com/main/admins/admins.php

(it still needs some touching up )
Rizla is offline
8088
Veteran Member
Join Date: Jan 2008
Old 10-23-2010 , 21:31   Re: Convert STEAMID to Steam Community ID
Reply With Quote #262

Hm, I must've been sleeping during my previous posts.

Replace
PHP Code:
$authid 
with
PHP Code:
$info['authid'
and add
PHP Code:
$community_id '7656'.$community_id
after
PHP Code:
$community_id = ((substr($info['authid'], 10)) * 2) + 1197960265728 + (substr($info['authid'], 81)); 
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 10-23-2010 , 21:56   Re: Convert STEAMID to Steam Community ID
Reply With Quote #263

I love you
Rizla is offline
raylapa
Junior Member
Join Date: Nov 2009
Old 10-25-2010 , 16:25   Re: Convert STEAMID to Steam Community ID
Reply With Quote #264

any ideas for "Error: invalid input" ?
or did I miss something which was written earlier in this huge thread?

btw @Rizla: would you mind if I´d take your script as a guideline for our Member-grid? Just perfect, did check your site...
raylapa is offline
8088
Veteran Member
Join Date: Jan 2008
Old 10-25-2010 , 21:04   Re: Convert STEAMID to Steam Community ID
Reply With Quote #265

Quote:
Originally Posted by raylapa View Post
any ideas for "Error: invalid input" ?
or did I miss something which was written earlier in this huge thread?
You didn't miss anything, I just haven't had the time to post a fix. Will do soon.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
raylapa
Junior Member
Join Date: Nov 2009
Old 10-26-2010 , 03:32   Re: Convert STEAMID to Steam Community ID
Reply With Quote #266

no hurry - just to make sure it did not got lost
(I know how it feels if always everybody want´s you to fix something... )
raylapa is offline
8088
Veteran Member
Join Date: Jan 2008
Old 10-26-2010 , 11:30   Re: Convert STEAMID to Steam Community ID
Reply With Quote #267

Found it :)
Quote:
Originally Posted by raylapa View Post
Only one thing: if you put in just the community ID like 7656119XXXXXXXXXX it gives you a "Error: invalid input" ...
Replace
PHP Code:
}else if ((is_numeric($data)) && (ereg('7656119'$a))){ 
with
PHP Code:
}else if ((is_numeric($data)) && (ereg('7656119'$data))){ 
and it should work as expected.

I've replaced the attachment in the original post.
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
raylapa
Junior Member
Join Date: Nov 2009
Old 10-26-2010 , 13:22   Re: Convert STEAMID to Steam Community ID
Reply With Quote #268

replaced and checked - working!

thx man!

http://jkal.de/tipps-hilfe/id-converter/
raylapa is offline
8088
Veteran Member
Join Date: Jan 2008
Old 10-26-2010 , 13:23   Re: Convert STEAMID to Steam Community ID
Reply With Quote #269

You're welcome :)
__________________
steamID converter with OpenSearch browser plugin
8088 is offline
Rizla
SourceMod Donor
Join Date: Jun 2010
Old 10-30-2010 , 10:39   Re: Convert STEAMID to Steam Community ID
Reply With Quote #270

Yes ray, np. im working on an entire backend actually and was thinking of sharing the admin display as it is something ive looked for and havent found and thinks its really useful.

want me to post the files?
Rizla 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:46.


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