PHP/Steam/SGS: Added XML version
This commit is contained in:
parent
ec7178a8fb
commit
dde46b0b7c
|
@ -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;
|
||||
}
|
||||
?>
|
Reference in New Issue