Administracja na serwerach Sieci Mentlegen
echo $headerinclude; ?>
$api = "9D1D79C9962E50E7C69104A7FD7398CA";
$connection = new mysqli('localhost', 'mentlege_admin', 'dasiaibartek', 'mentlege_forum');
$admins = array('mn', 'ttt', 'ci', 'rog');
/*
$query_arh = $connection->query("SELECT * FROM mybb_users WHERE uid = 1;") or die ($connection->error);
$arh_data = $query_arh->fetch_assoc();
$arh_avatar = $arh_data['avatar'];
$av = explode(':', $arh_avatar);
if ($arh_avatar != 'http://forum.mentlegen.pl/admin/styles/sharepoint/images/default_avatar.gif') {
if ($av == NULL || $av[0] != "http")
$arh_avatar = 'http://forum.mentlegen.pl/'.$arh_avatar;
}
$query_arhi = $connection->query("SELECT fid4 FROM mybb_userfields WHERE ufid = ".$arh_data['uid'].";") or die ($connection->error);
$arh_steamid = $query_arhi->fetch_assoc();
$arh_steamid = $arh_steamid['fid4'];
*/
function getFriendId($steamId)
{
//Test input steamId for invalid format
//Example SteamID: "STEAM_X:Y:ZZZZZZZZ"
$gameType = 0; //This is X. It's either 0 or 1 depending on which game you are playing (CSS, L4D, TF2, etc)
$authServer = 0; //This is Y. Some people have a 0, some people have a 1
$clientId = ''; //This is ZZZZZZZZ.
//Remove the "STEAM_"
$steamId = str_replace('STEAM_', '' ,$steamId);
//Split steamId into parts
$parts = explode(':', $steamId);
$gameType = $parts[0];
$authServer = $parts[1];
$clientId = $parts[2];
//Calculate friendId
$result = bcadd((bcadd('76561197960265728', $authServer)), (bcmul($clientId, '2')));
return($result);
}
/*
$arh_communityid = getFriendId($arh_steamid);
$arh_dane = simplexml_load_file('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$api.'&format=xml&steamids='.$arh_communityid) or die ('Dead');
echo $arh_dane;
$arh_web = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$api.'&format=json&steamids='.$arh_communityid);
$arh_dane = json_decode($arh_web, true);
$arh_dane = $arh_dane['response']['players'][0];
*/
//echo $arh_steamid;
/*
$arh = SteamID::getFromSteamID($arh_steamid);
if ($arh_dane['personastate'] == (1 || 2 || 4)) {
$arh_status = '
Online
';
}
else {
$arh_status = '
Offline
';
}
*/
$query = $connection->query("SELECT * FROM mybb_users WHERE usergroup = 4 OR usergroup = 10 OR additionalgroups LIKE '%,10,%' OR additionalgroups LIKE '10,%' OR additionalgroups = 10 OR additionalgroups LIKE '%,10' OR usergroup = 9 OR additionalgroups LIKE '%,9,%' OR additionalgroups LIKE '9,%' OR additionalgroups = 9 OR additionalgroups LIKE '%,9' OR usergroup = 22 OR additionalgroups LIKE '%,22,%' OR additionalgroups LIKE '22,%' OR additionalgroups = 22 OR additionalgroups LIKE '%,22' OR usergroup = 24 OR additionalgroups LIKE '%,24,%' OR additionalgroups LIKE '24,%' OR additionalgroups = 24 OR additionalgroups LIKE '%,24' OR usergroup = 23 OR additionalgroups LIKE '%,23,%' OR additionalgroups LIKE '23,%' OR additionalgroups = 23 OR additionalgroups LIKE '%,23';") or die ('Error');
if ($query->num_rows > 0) {
$web = 'http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$api.'&format=json&steamids=';
while ($data = $query->fetch_assoc()) {
$avatar = $data['avatar'];
if ($avatar == NULL)
$avatar = 'http://forum.mentlegen.pl/images/default_avatar.png';
$ava = explode(':', $avatar);
if ($avatar != 'http://forum.mentlegen.pl/admin/styles/sharepoint/images/default_avatar.gif') {
if ($ava == NULL || $ava[0] != "http")
$avatar = 'http://forum.mentlegen.pl/'.$avatar;
}
$id = $data['steamid'];
$usergroup = $data['usergroup'];
$agroups = explode(',', $data['additionalgroups']);
/*$player = SteamID::getFromSteamID($steamid);
$player_web = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key='.$api.'&format=json&steamids='.$communityid);
$player = json_decode($player_web, true);
$player = $player['response']['players'][0];
if ($player['personastate'] == (1 || 2 || 4)) {
$status = '