repeaters.php

pull/1/head
Tom Early 6 years ago
parent 1e80dd58cd
commit b030baebdc

@ -1,90 +1,93 @@
<table class="table table-striped table-hover"> <table class="table table-striped table-hover">
<tr class="table-center"> <tr class="table-center">
<th class="col-md-1">#</th> <th class="col-md-1">#</th>
<th class="col-md-1">Flag</th> <th class="col-md-1">Flag</th>
<th class="col-md-2">DV Station</th> <th class="col-md-2">DV Station</th>
<th class="col-md-1">Band</th> <th class="col-md-1">Band</th>
<th class="col-md-2">Last Heard</th> <th class="col-md-2">Last Heard</th>
<th class="col-md-2">Linked for</th> <th class="col-md-2">Linked for</th>
<th class="col-md-1">Protocol</th> <th class="col-md-1">Protocol</th>
<th class="col-md-1">Module</th><?php <th class="col-md-1">Module</th><?php
if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') { if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') {
echo ' echo '
<th class="col-md-1">IP</th>'; <th class="col-md-1">IP</th>';
} }
?> ?>
</tr> </tr>
<?php <?php
$Reflector->LoadFlags(); $Reflector->LoadFlags();
for ($i=0;$i<$Reflector->NodeCount();$i++) { for ($i=0;$i<$Reflector->NodeCount();$i++) {
echo ' echo '<tr class="table-center">
<tr class="table-center"> <td>'.($i+1).'</td>
<td>'.($i+1).'</td> <td>';
<td>'; list ($Flag, $Name) = $Reflector->GetFlag($Reflector->Nodes[$i]->GetCallSign());
list ($Flag, $Name) = $Reflector->GetFlag($Reflector->Nodes[$i]->GetCallSign()); if (file_exists("./img/flags/".$Flag.".png")) {
if (file_exists("./img/flags/".$Flag.".png")) { echo '<a href="#" class="tip"><img src="./img/flags/'.$Flag.'.png" class="table-flag" alt="'.$Name.'"><span>'.$Name.'</span></a>';
echo '<a href="#" class="tip"><img src="./img/flags/'.$Flag.'.png" class="table-flag" alt="'.$Name.'"><span>'.$Name.'</span></a>'; }
} echo '</td>
echo '</td> <td><a href="http://www.aprs.fi/'.$Reflector->Nodes[$i]->GetCallSign();
<td><a href="http://www.aprs.fi/'.$Reflector->Nodes[$i]->GetCallSign(); if ($Reflector->Nodes[$i]->GetSuffix() != "") echo '-'.$Reflector->Nodes[$i]->GetSuffix();
if ($Reflector->Nodes[$i]->GetSuffix() != "") echo '-'.$Reflector->Nodes[$i]->GetSuffix(); echo '" class="pl" target="_blank">'.$Reflector->Nodes[$i]->GetCallSign();
echo '" class="pl" target="_blank">'.$Reflector->Nodes[$i]->GetCallSign(); if ($Reflector->Nodes[$i]->GetSuffix() != "") { echo '-'.$Reflector->Nodes[$i]->GetSuffix(); }
if ($Reflector->Nodes[$i]->GetSuffix() != "") { echo '-'.$Reflector->Nodes[$i]->GetSuffix(); } echo '</a></td>
echo '</a></td> <td>';
<td>'; if (($Reflector->Nodes[$i]->GetPrefix() == 'REF') || ($Reflector->Nodes[$i]->GetPrefix() == 'XRF')) {
if (($Reflector->Nodes[$i]->GetPrefix() == 'REF') || ($Reflector->Nodes[$i]->GetPrefix() == 'XRF')) { switch ($Reflector->Nodes[$i]->GetPrefix()) {
switch ($Reflector->Nodes[$i]->GetPrefix()) { case 'REF' : echo 'REF-Link'; break;
case 'REF' : echo 'REF-Link'; break; case 'XRF' : echo 'XRF-Link'; break;
case 'XRF' : echo 'XRF-Link'; break; }
} }
} else {
else { switch ($Reflector->Nodes[$i]->GetSuffix()) {
switch ($Reflector->Nodes[$i]->GetSuffix()) { case 'A' : echo '23cm'; break;
case 'A' : echo '23cm'; break; case 'B' : echo '70cm'; break;
case 'B' : echo '70cm'; break; case 'C' : echo '2m'; break;
case 'C' : echo '2m'; break; case 'D' : echo 'Dongle'; break;
case 'D' : echo 'Dongle'; break; case 'G' : echo 'Internet-Gateway'; break;
case 'G' : echo 'Internet-Gateway'; break; default : echo '';
default : echo ''; }
} }
} echo '</td>
echo '</td> <td>'.date("d.m.Y H:i", $Reflector->Nodes[$i]->GetLastHeardTime()).'</td>
<td>'.date("d.m.Y H:i", $Reflector->Nodes[$i]->GetLastHeardTime()).'</td> <td>'.FormatSeconds(time()-$Reflector->Nodes[$i]->GetConnectTime()).' s</td>
<td>'.FormatSeconds(time()-$Reflector->Nodes[$i]->GetConnectTime()).' s</td> <td>'.$Reflector->Nodes[$i]->GetProtocol().'</td>
<td>'.$Reflector->Nodes[$i]->GetProtocol().'</td> <td>'.$Reflector->Nodes[$i]->GetLinkedModule().'</td>';
<td>'.$Reflector->Nodes[$i]->GetLinkedModule().'</td>'; if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') {
if ($PageOptions['RepeatersPage']['IPModus'] != 'HideIP') { echo '<td>';
echo ' $Bytes = explode(".", $Reflector->Nodes[$i]->GetIP());
<td>'; $MC = $PageOptions['RepeatersPage']['MasqueradeCharacter'];
$Bytes = explode(".", $Reflector->Nodes[$i]->GetIP()); if ($Bytes !== false && count($Bytes) == 4) {
$MC = $PageOptions['RepeatersPage']['MasqueradeCharacter']; switch ($PageOptions['RepeatersPage']['IPModus']) {
if ($Bytes !== false && count($Bytes) == 4) { case 'ShowLast1ByteOfIP':
switch ($PageOptions['RepeatersPage']['IPModus']) { echo $MC.'.'.$MC.'.'.$MC.'.'.$Bytes[3];
case 'ShowLast1ByteOfIP' : echo $MC.'.'.$MC.'.'.$MC.'.'.$Bytes[3]; break; break;
case 'ShowLast2ByteOfIP' : echo $MC.'.'.$MC.'.'.$Bytes[2].'.'.$Bytes[3]; break; case 'ShowLast2ByteOfIP':
case 'ShowLast3ByteOfIP' : echo $MC.'.'.$Bytes[1].'.'.$Bytes[2].'.'.$Bytes[3]; break; echo $MC.'.'.$MC.'.'.$Bytes[2].'.'.$Bytes[3]; break;
default : echo $Reflector->Nodes[$i]->GetIP(); case 'ShowLast3ByteOfIP':
} echo $MC.'.'.$Bytes[1].'.'.$Bytes[2].'.'.$Bytes[3];
} else { break;
$ipstr = $Reflector->Nodes[$i]->GetIP(); default:
$count = substr_count($ipstr, ":"); echo $Reflector->Nodes[$i]->GetIP();
if ($count > 1) { }
if (1 == substr_count($ipstr, "::")) { $ipstr = str_replace("::", str_repeat(":", 9 - $count), $ipstr); } } else {
if (7 == substr_count($ipstr, ":")) { $ipstr = $Reflector->Nodes[$i]->GetIP();
echo $MC.':'.$MC.':'.$MC.':'.$MC; $count = substr_count($ipstr, ":");
$Bytes = explode(":", $ipstr); if ($count > 1) {
for( $k=4; $k<8; $k++) { echo (0==strlen($Bytes[$k])) ? ':0' : ':'.$Bytes[$k]; } if (1 == substr_count($ipstr, "::")) { $ipstr = str_replace("::", str_repeat(":", 9 - $count), $ipstr); }
if (7 == substr_count($ipstr, ":")) {
echo $MC.':'.$MC.':'.$MC.':'.$MC.':'.$MC.':'.$MC;
$Bytes = explode(":", $ipstr);
for( $k=6; $k<8; $k++) { echo (0==strlen($Bytes[$k])) ? ':0' : ':'.$Bytes[$k]; }
}
} }
} }
} echo '</td>';
echo '</td>';
} }
echo ' echo '</tr>';
</tr>';
if ($i == $PageOptions['RepeatersPage']['LimitTo']) { $i = $Reflector->NodeCount()+1; } if ($i == $PageOptions['RepeatersPage']['LimitTo']) { $i = $Reflector->NodeCount()+1; }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.