makes switchRefl. only working on DMRplus-Network, not on BM because options-line in MMDVM.ini is not supported by BrandMeister

This commit is contained in:
dg9vh 2017-03-28 20:20:10 +00:00
parent 3c11027861
commit 8fa0bce46c
3 changed files with 16 additions and 21 deletions

View file

@ -858,23 +858,8 @@ function getGitVersion(){
}
}
function getDMRReflectors($network) {
$refls = array();
switch ($network) {
case "DMRPLUS":
$refls = getDMRReflectorsFromURL("http://ham-dmr.de/reflector.db");
break;
case "BRANDMEISTER":
$refls = getDMRReflectorsFromURL("http://185.79.71.94/reflector.db");
break;
}
return $refls;
}
function getDMRReflectorsFromURL($url) {
$data = file_get_contents($url);
function getDMRReflectors() {
$data = file_get_contents("http://ham-dmr.de/reflector.db");
$rows = explode("\n",$data);
$refls = array();
foreach($rows as $row) {
@ -882,4 +867,14 @@ function getDMRReflectorsFromURL($url) {
}
return $refls;
}
function getBrandMeisterDMRMasterList() {
$data = file_get_contents("http://185.79.71.94/dmr/dmrmaster.php");
$rows = explode("\n",$data);
$masters = array();
foreach($rows as $row) {
$masters[] = str_getcsv($row,"@",'');
}
return $masters;
}
?>

View file

@ -135,15 +135,15 @@ if (defined("ENABLENETWORKSWITCHING")) {
<button onclick="window.location.href='./scripts/switchnetwork.php?network=BRANDMEISTER'" type="button" class="btn btn-default navbar-btn"><span class="glyphicon glyphicon-fire" aria-hidden="true"></span>&nbsp;<?php echo _("BrandMeister"); ?></button>
<?php
}
if (defined("ENABLEREFLECTORSWITCHING") && (getEnabled("DMR Network", $mmdvmconfigs) == 1)) {
$reflectors = getDMRReflectors("DMRPLUS");
if (defined("ENABLEREFLECTORSWITCHING") && (getEnabled("DMR Network", $mmdvmconfigs) == 1) && !recursive_array_search(gethostbyname(getConfigItem("DMR Network", "Address", $mmdvmconfigs)),getBrandMeisterDMRMasterList()) ) {
$reflectors = getDMRReflectors();
?>
<form method = "get" action ="./scripts/switchreflector.php" class="form-inline" role="form">
<div class="form-group">
<select id="reflector" name="reflector" class="form-control" style="width: 80px;">
<?php
foreach ($reflectors as $reflector) {
if (strlen($reflector[1])>0)
if (isset($reflector[1]))
echo'<option value="'.$reflector[0].'">'.$reflector[1].'</option>';
}
?>

View file

@ -1,3 +1,3 @@
<?php
define("VERSION", "20170323-2 (".getGitVersion().")");
define("VERSION", "20170328-1 (".getGitVersion().")");
?>