View Single Post
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