From 18598a798ea97bf32b0edf4bcfcb9a05d5862666 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 26 Oct 2016 01:39:19 +0200 Subject: [PATCH 1/2] Use correct variables in links to DMR DARC page --- ajax.php | 30 +++++++++++++++++++++--------- include/functions.php | 15 ++++++++++----- include/lh.php | 16 +++++++++++----- include/localtx.php | 16 +++++++++++----- txinfo.php | 14 ++++++++++---- 5 files changed, 63 insertions(+), 28 deletions(-) diff --git a/ajax.php b/ajax.php index 3f96fe1..386af60 100644 --- a/ajax.php +++ b/ajax.php @@ -26,19 +26,31 @@ if ($_GET['section'] == "localTx") { if (defined("ENABLEXTDLOOKUP")) { if ($listElem[6] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) { $listElem[3] = getName($listElem[2]); - if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; - } else { - $listElem[2] = "".$listElem[2].""; + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; + } else { + $listElem[2] = "".$listElem[2].""; + } + } else { + $listElem[2] = "".$listElem[2].""; + } } array_push($lastHeard, $listElem); } } else { if ($listElem[5] == "RF" && ($listElem[1]=="D-Star" || startsWith($listElem[1], "DMR") || $listElem[1]=="YSF" || $listElem[1]=="P25")) { - if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; - } else { - $listElem[2] = "".$listElem[2].""; + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; + } else { + $listElem[2] = "".$listElem[2].""; + } + } else { + $listElem[2] = "".$listElem[2].""; + } } array_push($lastHeard, $listElem); } @@ -220,4 +232,4 @@ if ($_GET['section'] == "sysinfo") { \ No newline at end of file +?> diff --git a/include/functions.php b/include/functions.php index 87a4d53..8002d92 100644 --- a/include/functions.php +++ b/include/functions.php @@ -360,12 +360,17 @@ function getLastHeard($logLines, $onlyLast) { $listElem[3] = "---"; } } - if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; - } else { - $listElem[2] = "".$listElem[2].""; + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + $listElem[2] = "".str_replace("0","Ø",$listElem[2]).""; + } else { + $listElem[2] = "".$listElem[2].""; + } + } else { + $listElem[2] = "".$listElem[2].""; + } } - array_push($lastHeard, $listElem); $counter++; } diff --git a/include/lh.php b/include/lh.php index 3206e25..44be830 100644 --- a/include/lh.php +++ b/include/lh.php @@ -34,11 +34,17 @@ for ($i = 0; ($i < $totalLH); $i++) { echo""; echo"$listElem[0]"; echo"$listElem[1]"; - if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - echo"".str_replace("0","Ø",$listElem[2]).""; - } else { - echo"".$listElem[2].""; - } + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + echo"".str_replace("0","Ø",$listElem[2]).""; + } else { + echo"".$listElem[2].""; + } + } else { + echo"".$listElem[2].""; + } + } if (defined("ENABLEXTDLOOKUP")) { echo "".getName($listElem[2]).""; } diff --git a/include/localtx.php b/include/localtx.php index 5fa49f2..d8a4450 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -38,11 +38,17 @@ for ($i = 0; $i < count($localTXList); $i++) { echo""; echo"$listElem[0]"; echo"$listElem[1]"; - if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - echo"".str_replace("0","Ø",$listElem[2]).""; - } else { - echo"".$listElem[2].""; - } + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + echo"".str_replace("0","Ø",$listElem[2]).""; + } else { + echo"".$listElem[2].""; + } + } else { + echo"".$listElem[2].""; + } + } if (defined("ENABLEXTDLOOKUP")) { echo "$listElem[3]"; } diff --git a/txinfo.php b/txinfo.php index aa987f3..526fef8 100644 --- a/txinfo.php +++ b/txinfo.php @@ -19,10 +19,16 @@ foreach ($lastHeard as $listElem) { echo ""; echo"$listElem[0]"; echo"$listElem[1]"; - /*if (constant("SHOWQRZ") && $listElem[2] !== "??????????" && !is_numeric($listElem[2])) { - echo"".str_replace("0","Ø",$listElem[2]).""; - } else { - echo"".$listElem[2].""; + /*if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + echo"".str_replace("0","Ø",$listElem[2]).""; + } else { + echo"".$listElem[2].""; + } + } else { + echo"".$listElem[2].""; + } }*/ echo"$listElem[2]"; From b67935d3215094229e94ece55655590cba88e60e Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 26 Oct 2016 01:47:11 +0200 Subject: [PATCH 2/2] Align with previous (DOS) formatting / line endings --- include/lh.php | 22 +++++++++++----------- include/localtx.php | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/lh.php b/include/lh.php index 44be830..55e723c 100644 --- a/include/lh.php +++ b/include/lh.php @@ -34,17 +34,17 @@ for ($i = 0; ($i < $totalLH); $i++) { echo""; echo"$listElem[0]"; echo"$listElem[1]"; - if ($listElem[2] !== "??????????") { - if (!is_numeric($listElem[2])) { - if (constant("SHOWQRZ")) { - echo"".str_replace("0","Ø",$listElem[2]).""; - } else { - echo"".$listElem[2].""; - } - } else { - echo"".$listElem[2].""; - } - } + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + echo"".str_replace("0","Ø",$listElem[2]).""; + } else { + echo"".$listElem[2].""; + } + } else { + echo"".$listElem[2].""; + } + } if (defined("ENABLEXTDLOOKUP")) { echo "".getName($listElem[2]).""; } diff --git a/include/localtx.php b/include/localtx.php index d8a4450..2f1d6f5 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -38,17 +38,17 @@ for ($i = 0; $i < count($localTXList); $i++) { echo""; echo"$listElem[0]"; echo"$listElem[1]"; - if ($listElem[2] !== "??????????") { - if (!is_numeric($listElem[2])) { - if (constant("SHOWQRZ")) { - echo"".str_replace("0","Ø",$listElem[2]).""; - } else { - echo"".$listElem[2].""; - } - } else { - echo"".$listElem[2].""; - } - } + if ($listElem[2] !== "??????????") { + if (!is_numeric($listElem[2])) { + if (constant("SHOWQRZ")) { + echo"".str_replace("0","Ø",$listElem[2]).""; + } else { + echo"".$listElem[2].""; + } + } else { + echo"".$listElem[2].""; + } + } if (defined("ENABLEXTDLOOKUP")) { echo "$listElem[3]"; }