From 6790c2ac764a936149fa80d11cbebe51302d5615 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Sat, 11 Jun 2016 20:30:40 +0000 Subject: [PATCH] added YSFGatewayinfo and active YSFReflectors-List --- include/functions.php | 70 +++++++++++++++++++++++++++++++++----- include/localtx.php | 2 +- include/repeaterinfo.php | 6 ++-- include/ysfgatewayinfo.php | 50 +++++++++++++++++++++++++++ index.php | 3 ++ setup.php | 24 +++++++++++++ 6 files changed, 143 insertions(+), 12 deletions(-) create mode 100644 include/ysfgatewayinfo.php diff --git a/include/functions.php b/include/functions.php index 786911f..4434cd0 100644 --- a/include/functions.php +++ b/include/functions.php @@ -21,14 +21,26 @@ function getMMDVMHostFileVersion() { function getMMDVMConfig() { // loads MMDVM.ini into array for further use - $mmdvmconfigs = array(); + $conf = array(); if ($configs = fopen(MMDVMINIPATH."/".MMDVMINIFILENAME, 'r')) { while ($config = fgets($configs)) { - array_push($mmdvmconfigs, trim ( $config, " \t\n\r\0\x0B")); + array_push($conf, trim ( $config, " \t\n\r\0\x0B")); } fclose($configs); } - return $mmdvmconfigs; + return $conf; +} + +function getYSFGatewayConfig() { + // loads MMDVM.ini into array for further use + $conf = array(); + if ($configs = fopen(YSFGATEWAYINIPATH."/".YSFGATEWAYINIFILENAME, 'r')) { + while ($config = fgets($configs)) { + array_push($conf, trim ( $config, " \t\n\r\0\x0B")); + } + fclose($configs); + } + return $conf; } function getCallsign($mmdvmconfigs) { @@ -82,7 +94,7 @@ function showMode($mode, $mmdvmconfigs) { -1)) { + array_push($reflectors,$name); + array_push($reflectorlist, array($name, $description, $id, $concount, $timestamp)); + } + } + } + array_multisort($reflectorlist); + return $reflectorlist; +} + //Some basic inits $mmdvmconfigs = getMMDVMConfig(); -$logLines = getLog(); -$reverseLogLines = $logLines; -array_multisort($reverseLogLines,SORT_DESC); -$lastHeard = getLastHeard($reverseLogLines); +$logLinesMMDVM = getMMDVMLog(); +$reverseLogLinesMMDVM = $logLinesMMDVM; +array_multisort($reverseLogLinesMMDVM,SORT_DESC); +$lastHeard = getLastHeard($reverseLogLinesMMDVM); +$YSFGatewayconfigs = getYSFGatewayConfig(); +$logLinesYSFGateway = getYSFGatewayLog(); +$reverseLogLinesYSFGateway = $logLinesYSFGateway; +array_multisort($reverseLogLinesYSFGateway,SORT_DESC); ?> diff --git a/include/localtx.php b/include/localtx.php index f8d667a..b6133fe 100644 --- a/include/localtx.php +++ b/include/localtx.php @@ -1,6 +1,6 @@ diff --git a/include/repeaterinfo.php b/include/repeaterinfo.php index 84c01f9..12d1e43 100644 --- a/include/repeaterinfo.php +++ b/include/repeaterinfo.php @@ -13,9 +13,9 @@ "; echo"".getActualMode($lastHeard, $mmdvmconfigs).""; - echo"".getActualLink($reverseLogLines, "D-Star").""; - echo"".getActualLink($reverseLogLines, "DMR Slot 1").""; - echo"".getActualLink($reverseLogLines, "DMR Slot 2")."/". getActualReflector($logLines, "DMR Slot 2") .""; + echo"".getActualLink($reverseLogLinesMMDVM, "D-Star").""; + echo"".getActualLink($reverseLogLinesMMDVM, "DMR Slot 1").""; + echo"".getActualLink($reverseLogLinesMMDVM, "DMR Slot 2")."/". getActualReflector($reverseLogLinesMMDVM, "DMR Slot 2") .""; echo"\n"; ?> diff --git a/include/ysfgatewayinfo.php b/include/ysfgatewayinfo.php new file mode 100644 index 0000000..5853f3c --- /dev/null +++ b/include/ysfgatewayinfo.php @@ -0,0 +1,50 @@ + +
+ +
YSFGateway-Infos
+ + + + ">YSFGateway Process is down! + +
">YSFGateway Process is running
+
+
+ +
Reflectors-Info
+ + + + 0) { + ?> + + + + + + + + "; + for ($i = 0; $i < 5; $i++) { + echo""; + } + echo ""; + } + } +?> +
NameDescriptionIDConnectionsLast info of
$reflector[$i]
+
diff --git a/index.php b/index.php index 1294a98..41cd113 100644 --- a/index.php +++ b/index.php @@ -43,6 +43,9 @@ include "include/repeaterinfo.php"; include "include/modes.php"; include "include/lh.php"; include "include/localtx.php"; +if (defined("SHOWPROGRESSBARS")) { + include "include/ysfgatewayinfo.php"; +} ?>
+
+

YSFGateway-Configuration

+ +
+ Enable YSFGateway +
+
+
+ Path to YSFGateway-logfile + +
+
+ Logfile-prefix + +
+
+ Path to YSFGateway.ini + +
+
+ YSFGateway.ini-filename + +
+

ircddbgateway-Configuration