MadMakz
/
Misc-Tools
Archived
1
0
Fork 0

PHP/Steam/SGS: Added XML version

This commit is contained in:
MadMakz 2012-10-14 16:13:42 +02:00
parent ec7178a8fb
commit dde46b0b7c
1 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,49 @@
<?php
/*
* SteamGroupStatus (XML)
* Copyright (C) 2012 Maximilian "MadMakz" Lotz
*
* http://madmakz.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
$gruppe = "valve"; // Groupname at the end of http://steamcommunity.com/groups/
echo stgrp_status($gruppe);
function stgrp_status($group = false){
if(!$group){ return "<div class=\"blockrow\"><b>No group set.</b></div>"; }
$url = simplexml_load_file("http://steamcommunity.com/groups/".$group."/memberslistxml");
if(!$url){
return "<div class=\"blockrow\"><b>Steamcommunity appears to be down.</b></div>";
}
$return = "<div class=\"blockrow\">\n";
$return .= "<a class=\"clanname\" href='http://steamcommunity.com/groups/$group' target='_blank'>".$url->groupDetails->groupName."</a>\n";
$return .= "<br>\n";
$return .= "<span class=\"resultsb\">".$url->groupDetails->memberCount." Members</span>\n";
$return .= "<br>\n";
$return .= "<span class=\"membersInGame\"><font color=#8bc53f>".$url->groupDetails->membersInGame." In-Game</font></span>\n";
$return .= "<br>";
$return .= "<span class=\"membersOnline\"><font color=#62a7e3>".$url->groupDetails->membersOnline." Online</font></span>\n";
$return .= "</div>";
return $return;
}
?>