Merge pull request #77 from phl0/dev

Various PHP errors in log
This commit is contained in:
Florian (DF2ET) 2017-01-10 21:25:02 +01:00 committed by GitHub
commit 7d97b6b670
5 changed files with 24 additions and 21 deletions

View file

@ -32,7 +32,7 @@ if ($_GET['section'] == "localTx") {
$listElem[3] = getName($listElem[2]);
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";
@ -47,7 +47,7 @@ if ($_GET['section'] == "localTx") {
if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) {
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";

View file

@ -25,8 +25,11 @@ function getMMDVMHostFileVersion() {
function getFirmwareVersion() {
$logPath = MMDVMLOGPATH."/".MMDVMLOGPREFIX."-".date("Y-m-d").".log";
$logLines = explode("\n", `grep "MMDVM protocol version" $logPath`);
$firmware = substr($logLines[count($logLines)-2], strpos($logLines[count($logLines)-2], "description")+13, strlen($logLines[count($logLines)-2])-strpos($logLines[count($logLines)-2], "description")+13);
if (strlen($firmware) > 0) {
$firmware = "n/a";
if (count($logLines) >= 2) {
$firmware = substr($logLines[count($logLines)-2], strpos($logLines[count($logLines)-2], "description")+13, strlen($logLines[count($logLines)-2])-strpos($logLines[count($logLines)-2], "description")+13);
}
if ($firmware != "n/a") {
$fp = fopen('/tmp/MMDVMFirmware.txt', 'w');
fwrite($fp, $firmware);
fclose($fp);
@ -45,26 +48,26 @@ function setDMRNetwork($network) {
}
function getDMRNetwork() {
if (file_exists('config/DMRNetwork.txt')) {
$fp = fopen('config/DMRNetwork.txt', 'r');
$network = fread($fp, filesize("config/DMRNetwork.txt"));
$filename = 'config/DMRNetwork.txt';
$network = '';
if (file_exists($filename)) {
$fp = fopen($filename, 'r');
$network = fread($fp, filesize($filename));
fclose($fp);
return $network;
} else {
return "";
}
return $network;
}
function getDMRNetwork2() {
if (file_exists('../config/DMRNetwork.txt')) {
$fp = fopen('../config/DMRNetwork.txt', 'r');
$network = fread($fp, filesize("../config/DMRNetwork.txt"));
$filename = '../config/DMRNetwork.txt';
$network = '';
if (file_exists($filename)) {
$fp = fopen($filename, 'r');
$network = fread($fp, filesize($filename));
fclose($fp);
return $network;
} else {
return "";
}
return $network;
}
function getDMRMasterState() {
@ -445,7 +448,7 @@ function getLastHeard($logLines, $onlyLast) {
}
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
$listElem[2] = "<a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a>";
} else {
$listElem[2] = "<a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</a>";

View file

@ -36,7 +36,7 @@ for ($i = 0; ($i < $totalLH); $i++) {
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";

View file

@ -41,7 +41,7 @@ for ($i = 0; $i < count($localTXList); $i++) {
echo"<td nowrap>$listElem[1]</td>";
if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";

View file

@ -27,7 +27,7 @@ foreach ($lastHeard as $listElem) {
echo"<td nowrap>$listElem[1]</td>";
/*if ($listElem[2] !== "??????????") {
if (!is_numeric($listElem[2])) {
if (constant("SHOWQRZ")) {
if (defined("SHOWQRZ")) {
echo"<td nowrap><a target=\"_new\" href=\"https://qrz.com/db/$listElem[2]\">".str_replace("0","&Oslash;",$listElem[2])."</a></td>";
} else {
echo"<td nowrap><a target=\"_new\" href=\"http://dmr.darc.de/dmr-userreg.php?callsign=$listElem[2]\">".$listElem[2]."</td>";