From 77893ce5a9a714046cf654e054022b088db7595c Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sun, 5 Jun 2016 19:00:37 +0000 Subject: [PATCH] code beautifying --- include/functions.php | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/include/functions.php b/include/functions.php index 0a1932b..786911f 100644 --- a/include/functions.php +++ b/include/functions.php @@ -15,7 +15,7 @@ function getMMDVMHostFileVersion() { // returns creation-time of MMDVMHost as version-number $filename = MMDVMHOSTPATH."/MMDVMHost"; if (file_exists($filename)) { - return date("d M y", filectime($filename)); + return date("d M y", filectime($filename)); } } @@ -76,7 +76,7 @@ function showMode($mode, $mmdvmconfigs) { } } } else { - echo "label-default"; + echo "label-default"; } ?>"> 0 ) { $source = "Network"; } - + switch ($mode) { case "D-Star": $duration = $dstarduration; @@ -260,9 +260,6 @@ function getLastHeard($logLines) { function getActualMode($metaLastHeard, $mmdvmconfigs) { // returns mode of repeater actual working in - //$lastHeard = $metaLastHeard; - //array_multisort($lastHeard,SORT_DESC); - //$listElem = $lastHeard[0]; $listElem = $metaLastHeard[0]; $timestamp = new DateTime($listElem[0]); $mode = $listElem[1]; @@ -342,7 +339,6 @@ function getActualLink($logLines, $mode) { //M: 2016-05-02 07:04:10.504 D-Star link status set to "Verlinkt zu DCS002 S" //M: 2016-04-03 16:16:18.638 DMR Slot 2, received network voice header from 4000 to 2625094 //M: 2016-04-03 19:30:03.099 DMR Slot 2, received network voice header from 4020 to 2625094 - //array_multisort($logLines,SORT_DESC); switch ($mode) { case "D-Star": if (isProcessRunning(IRCDDBGATEWAY)) { @@ -354,7 +350,7 @@ function getActualLink($logLines, $mode) { case "DMR Slot 1": foreach ($logLines as $logLine) { if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 1") { - $to = ""; + $to = ""; if (strpos($logLine,"to")) { $to = trim(substr($logLine, strpos($logLine,"to") + 3)); } @@ -368,7 +364,7 @@ function getActualLink($logLines, $mode) { case "DMR Slot 2": foreach ($logLines as $logLine) { if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { - $to = ""; + $to = ""; if (strpos($logLine,"to")) { $to = trim(substr($logLine, strpos($logLine,"to") + 3)); } @@ -391,8 +387,8 @@ function getActualReflector($logLines, $mode) { //array_multisort($logLines,SORT_DESC); foreach ($logLines as $logLine) { - if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { - $from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6); + if(substr($logLine, 27, strpos($logLine,",") - 27) == "DMR Slot 2") { + $from = substr($logLine, strpos($logLine,"from") + 5, strpos($logLine,"to") - strpos($logLine,"from") - 6); if (strlen($from) == 4 && startsWith($from,"4")) { if ($from == "4000") { @@ -401,7 +397,7 @@ function getActualReflector($logLines, $mode) { return "Reflector ".$from; } } - } + } } return "Reflector not linked"; }