public function LoadXML() { if ($this->XMLFile != null) { $handle = fopen($this->XMLFile, 'r'); $this->XMLContent = fread($handle, filesize($this->XMLFile)); fclose($handle); $this->ServiceName = substr($this->XMLContent, strpos($this->XMLContent, "<XLX") + 4, 3); if (!is_numeric($this->ServiceName)) { $this->ServiceName = null; return false; } $this->ReflectorName = "XLX" . $this->ServiceName; $LinkedPeersName = "XLX" . $this->ServiceName . " linked peers"; $LinkedNodesName = "XLX" . $this->ServiceName . " linked nodes"; $LinkedUsersName = "XLX" . $this->ServiceName . " heard users"; $XML = new ParseXML(); $AllNodesString = $XML->GetElement($this->XMLContent, $LinkedNodesName); $tmpNodes = $XML->GetAllElements($AllNodesString, "NODE"); for ($i = 0; $i < count($tmpNodes); $i++) { $Node = new Node($XML->GetElement($tmpNodes[$i], 'Callsign'), $XML->GetElement($tmpNodes[$i], 'IP'), $XML->GetElement($tmpNodes[$i], 'LinkedModule'), $XML->GetElement($tmpNodes[$i], 'Protocol'), $XML->GetElement($tmpNodes[$i], 'ConnectTime'), $XML->GetElement($tmpNodes[$i], 'LastHeardTime')); $this->AddNode($Node); } $AllStationsString = $XML->GetElement($this->XMLContent, $LinkedUsersName); $tmpStations = $XML->GetAllElements($AllStationsString, "STATION"); for ($i = 0; $i < count($tmpStations); $i++) { $Station = new Station($XML->GetElement($tmpStations[$i], 'Callsign'), $XML->GetElement($tmpStations[$i], 'Via node'), $XML->GetElement($tmpStations[$i], 'Via peer'), $XML->GetElement($tmpStations[$i], 'LastHeardTime')); $this->AddStation($Station, false); } $AllPeersString = $XML->GetElement($this->XMLContent, $LinkedPeersName); $tmpPeers = $XML->GetAllElements($AllPeersString, "PEER"); for ($i = 0; $i < count($tmpPeers); $i++) { $Peer = new Peer($XML->GetElement($tmpPeers[$i], 'Callsign'), $XML->GetElement($tmpPeers[$i], 'IP'), $XML->GetElement($tmpPeers[$i], 'LinkedModule'), $XML->GetElement($tmpPeers[$i], 'Protocol'), $XML->GetElement($tmpPeers[$i], 'ConnectTime'), $XML->GetElement($tmpPeers[$i], 'LastHeardTime')); $this->AddPeer($Peer, false); } $this->Version = $XML->GetElement($this->XMLContent, "Version"); } }
<?php $Result = @fopen($CallingHome['ServerURL'] . "?do=GetReflectorList", "r"); if (!$Result) { die("HEUTE GIBTS KEIN BROT"); } $INPUT = ""; while (!feof($Result)) { $INPUT .= fgets($Result, 1024); } fclose($Result); $XML = new ParseXML(); $Reflectorlist = $XML->GetElement($INPUT, "reflectorlist"); $Reflectors = $XML->GetAllElements($Reflectorlist, "reflector"); ?> <table class="listingtable"> <tr> <th width="40">#</th> <th width="75">Reflector</th> <th width="120">Country</th> <th width="90">Service</th> <th width="400">Comment</th> </tr> <?php $odd = ""; for ($i = 0; $i < count($Reflectors); $i++) { $NAME = $XML->GetElement($Reflectors[$i], "name"); $COUNTRY = $XML->GetElement($Reflectors[$i], "country"); $LASTCONTACT = $XML->GetElement($Reflectors[$i], "lastcontact");
<?php $Result = @fopen($CallingHome['ServerURL'] . "?do=GetReflectorList", "r"); $INPUT = ""; if ($Result) { while (!feof($Result)) { $INPUT .= fgets($Result, 1024); } $XML = new ParseXML(); $Reflectorlist = $XML->GetElement($INPUT, "reflectorlist"); $Reflectors = $XML->GetAllElements($Reflectorlist, "reflector"); } fclose($Result); ?> <table class="listingtable"> <tr> <th width="25">#</th> <th width="100">XLX Peer</th> <th width="154">Last Heard</th> <th width="156">Linked for</th> <th width="90">Protocol</th> <th width="67">Module</th><?php if ($PageOptions['PeerPage']['IPModus'] != 'HideIP') { echo ' <th width="125">IP</th>'; } ?> </tr> <?php $odd = ""; $Reflector->LoadFlags();