To let MySQL do the math, the query should look like this:
Code:
SELECT user,authid,srv_group,gid,
CAST(MID(authid,9,1) AS UNSIGNED) + CAST('76561197960265728' AS UNSIGNED) + CAST(MID(authid, 11,10)*2 AS UNSIGNED) AS friendid
FROM ADMINS_TABLE
WHERE srv_group = 'SERVER GROUP 1' OR srv_group = 'SERVER GROUP 2' OR srv_group = 'SERVER GROUP 3'
ORDER BY gid ASC
To use it, admins.php, between "//prepare the query" and "//there are no result", should be something like this:
PHP Code:
$sql = "SELECT user,authid,srv_group,gid,
CAST(MID(authid,9,1) AS UNSIGNED) + CAST('76561197960265728' AS UNSIGNED) + CAST(MID(authid, 11,10)*2 AS UNSIGNED) AS friendid
FROM ADMINS_TABLE
WHERE srv_group = 'SERVER GROUP 1' OR srv_group = 'SERVER GROUP 2' OR srv_group = 'SERVER GROUP 3'
ORDER BY gid ASC";
//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 '<div align="center">
<a href="LINK TO YOUR BANNER">
<img src="YOUR BANNER SRC" alt="" title=""></a></div>
<p>ENTER YOUR INTRO TEXT HERE</p></div align="center"><table border="0" cellpadding="2" cellspacing="2" width="100%">';
//fetch every possible row from the resource and do nice stuff with it
while($info = mysql_fetch_assoc($query))
{
//create a link to the Steam community profile
$site = 'http://steamcommunity.com/profiles/'.$info['friendid'];
//print the table row with all the info
print '<tr><td><img src="http://www.steamprofile.com/profile/simple/steam/'.$info['authid'].'.png" ></td><td align="center"><a href="steam://friends/add/'.$info['friendid'].'">Add as Friend</a></td><td align="center"><a href='.$site.'>Steam Community Page</a></td><td>'.$info['srv_group'].'</td></tr><tr><td colspan="4"><hr></td></tr>';
}
//close the table
print '</table><br><div align="center"><p><small>Special thanks to Voogru for the conversions, 8088 on Allied Modders for helping to fix. Steamprofile.com for their images. Depictation.net for their cache and whoever else I forgot! Sorry.<br><br>© 2010 TmF Gaming</p></small><br><br></div></div>';
}
__________________