From a4f44f002b6587790c5e35be16d077628de692d2 Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Fri, 25 Mar 2016 11:29:29 +0000 Subject: [PATCH] kworld status/version fix/other fixes --- Servers_KWorld.php | 43 ++++++++++++++++++++++++++++++++++ Update.bat | 23 +++++++++++++++++-- config/set1.php | 2 ++ config/write1.php | 7 ++++++ left.php | 9 +++++++- ss_bootstrap_kworld.php | 51 +++++++++++++++++++++++++++++++++++++---- ss_configs_kworld.php | 14 +++++++---- updatenotify2.php | 2 +- version.txt | 2 +- 9 files changed, 139 insertions(+), 14 deletions(-) create mode 100644 Servers_KWorld.php diff --git a/Servers_KWorld.php b/Servers_KWorld.php new file mode 100644 index 0000000..ecb5ef0 --- /dev/null +++ b/Servers_KWorld.php @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + diff --git a/Update.bat b/Update.bat index fb4f943..4625a90 100644 --- a/Update.bat +++ b/Update.bat @@ -390,6 +390,25 @@ findstr "uptimevisible" config.php >nul 2>&1 goto END :END + rem KworldWidget episodes +findstr "KworldWidget" config.php >nul 2>&1 + if errorlevel 1 goto ONE + if errorlevel 0 goto ZERO + goto END + :ZERO + echo KworldWidget Already Updated + goto END + :ONE + echo ^>config.php + echo //// KworldWidget >> config.php + echo $KworldWidget = "1"; >> config.php + echo $http2 = "http://"; >> config.php + echo $https = "https://"; >> config.php + echo //// >> config.php + echo ^?^> >> config.php + echo KworldWidget Widget Updated + goto END + :END @@ -413,8 +432,8 @@ findstr "localversion" config.php >nul 2>&1 goto END :END :ONE - cscript replace.vbs "config.php" "2.4" "2.5" - echo Version Updated to 2.5 + cscript replace.vbs "config.php" "2.5" "2.5.1" + echo Version Updated to 2.5.1 goto END :END diff --git a/config/set1.php b/config/set1.php index 3a664d4..ecfe6f2 100644 --- a/config/set1.php +++ b/config/set1.php @@ -25,6 +25,8 @@

KWorld Enabled: "0") echo "checked=checked; "; ?> />
+ KWorld Widget Enabled: "0") echo "checked=checked; "; ?> />
+

Services Widget Enabled: "0") echo "checked=checked; "; ?> />
Clock Widget Enabled: "0") echo "checked=checked; "; ?> />
diff --git a/config/write1.php b/config/write1.php index c6df1da..25b8049 100644 --- a/config/write1.php +++ b/config/write1.php @@ -23,6 +23,7 @@ $mediawidget21 = $_POST['mediawidget2']; $mediastatscolour1 = $_POST['mediastatscolour']; $mediastatstextcolour1 = $_POST['mediastatstextcolour']; $uptimevisible1 = $_POST['uptimevisible']; +$KworldWidget1 = $_POST['KworldWidget']; // $fl='../config.php'; @@ -45,6 +46,12 @@ $content = preg_replace( '/\$widgetcolour = \"(.*?)\";/', '$widgetcolour = "#' } else { $content = preg_replace( '/\$showversion = \"(.*?)\";/', '$showversion = "1";', $content); } + // KworldWidget Settings + if (empty($KworldWidget1)) { + $content = preg_replace( '/\$KworldWidget = \"(.*?)\";/', '$KworldWidget = "0";', $content); + } else { + $content = preg_replace( '/\$KworldWidget = \"(.*?)\";/', '$KworldWidget = "1";', $content); + } // clockvisible Settings if (empty($clockvisible1)) { $content = preg_replace( '/\$clockvisible = \"(.*?)\";/', '$clockvisible = "0";', $content); diff --git a/left.php b/left.php index 34ded63..27e1072 100644 --- a/left.php +++ b/left.php @@ -55,6 +55,14 @@ if ($servicesvisible > "0") { require "services.php"; } else { +} +?> +

+ "0") { + require "Servers_KWorld.php"; +} else { + } ?>

@@ -65,7 +73,6 @@ if ($drivespacevisible > "0") { } ?> - diff --git a/ss_bootstrap_kworld.php b/ss_bootstrap_kworld.php index 62ea25c..90fd39a 100644 --- a/ss_bootstrap_kworld.php +++ b/ss_bootstrap_kworld.php @@ -8,8 +8,8 @@ var nextRow = $(row).next(); nextRow.toggle(); } - function togglebodyServers() { - $('#serverstable tbody').toggle(); + function togglebodykworld() { + $('#kworldstable tbody').toggle(); } @@ -25,11 +25,11 @@ */ # Load the configurations. -require "ss_configs_servers.php"; +require "ss_configs_kworld.php"; # Start a variable to contain Service Status. if ($serverstatusvisible > "0") { - $serverStatus = ""; + $serverStatus = "
ServerStatus
"; } # Process all services1 montiored. @@ -76,7 +76,7 @@ foreach( $configs['services2'] as $serviceName => $servicePort ) foreach( $configs['services3'] as $serviceName => $servicePort ) { # Determine Port Status. - $status = @fsockopen($configs['server_ip3'], $servicePort, $errno, $errstr, 5); + $status = @fsockopen($configs['server_ip3'], 443, $errno, $errstr, 5); # What is the result. if( !$status ) @@ -112,6 +112,47 @@ foreach( $configs['services4'] as $serviceName => $servicePort ) $serverStatus .= ""; } +# Process all services1 montiored. +foreach( $configs['services5'] as $serviceName => $servicePort ) +{ + # Determine Port Status. + $status = @fsockopen($configs['server_ip5'], $servicePort, $errno, $errstr, 5); + + # What is the result. + if( !$status ) + { + $statusText = "Down"; + } + else + { + $statusText = "Up"; + } + + # Set the status Row. + $serverStatus .= ""; +} + +# Process all services1 montiored. +foreach( $configs['services6'] as $serviceName => $servicePort ) +{ + # Determine Port Status. + $status = @fsockopen($configs['server_ip6'], $servicePort, $errno, $errstr, 5); + + # What is the result. + if( !$status ) + { + $statusText = "Down"; + } + else + { + $statusText = "Up"; + } + + # Set the status Row. + $serverStatus .= ""; +} + + # Finish service status table. $serverStatus .= "
K-World Status
{$serviceName}{$statusText}
{$serviceName}{$statusText}
{$serviceName}{$statusText}
"; # File Complete. diff --git a/ss_configs_kworld.php b/ss_configs_kworld.php index 265f6e8..7fa795e 100644 --- a/ss_configs_kworld.php +++ b/ss_configs_kworld.php @@ -16,6 +16,8 @@ $configs['services1'] = array(); $configs['services2'] = array(); $configs['services3'] = array(); $configs['services4'] = array(); +$configs['services5'] = array(); +$configs['services6'] = array(); /******** DO NOT EDIT THESE CONFIG LINES. @@ -28,12 +30,16 @@ $configs['server_ip'] = $server1url; // The Servers URL or IP to check. $configs['server_ip2'] = $server2url; // The Servers URL or IP to check. $configs['server_ip3'] = $server3url; // The Servers URL or IP to check. $configs['server_ip4'] = $server4url; // The Servers URL or IP to check. +$configs['server_ip5'] = $server4url; // The Servers URL or IP to check. +$configs['server_ip6'] = $server4url; // The Servers URL or IP to check. # For services1 simply add new lines with the Name and port number. - $configs['services1']["$server1name"] = 80; - $configs['services2']["$server2name"] = 80; - $configs['services3']["$server3name"] = 80; - $configs['services4']["$server4name"] = 80; + $configs['services1']["KKnowledge"] = 80; + $configs['services2']["KNews"] = 80; + $configs['services3']["KLoud"] = 80; + $configs['services4']["Konvos"] = 80; + $configs['services5']["KSpot"] = 80; + $configs['services6']["Klips"] = 80; ?> \ No newline at end of file diff --git a/updatenotify2.php b/updatenotify2.php index 307f02b..0ddf4ff 100644 --- a/updatenotify2.php +++ b/updatenotify2.php @@ -1,3 +1,3 @@ New Update Available

"; + echo "

New Update ($remoteversion) Available

"; ?> \ No newline at end of file diff --git a/version.txt b/version.txt index 9266364..e05f223 100644 --- a/version.txt +++ b/version.txt @@ -1,4 +1,4 @@ \ No newline at end of file