kworld status/version fix/other fixes

This commit is contained in:
Karl Hudgell 2016-03-25 11:29:29 +00:00
parent 9bdd4cbf85
commit a4f44f002b
9 changed files with 139 additions and 14 deletions

43
Servers_KWorld.php Normal file
View File

@ -0,0 +1,43 @@
<!--Force IE6 into quirks mode with this comment tag-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!--This script should appear below your LINK stylesheet tags -->
<script src="styleswitch.js" type="text/javascript">
/***********************************************
* Style Sheet Switcher v1.1- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
</script>
<script type="text/javascript">
window.onload=function(){
var formref=document.getElementById("switchform")
indicateSelected(formref.switchcontrol)
}
</script>
</head>
<body>
<?php
/*
* Script: Server Status
* Author: Martin Dixon
* From: Tutorial-Resource.com
* URL: www.tutorial-resource.com
* Version: 1.0
* License: Free
*/
# Get our Bootstrap file.
require "ss_bootstrap_kworld.php";
# Print our Server Status.
echo $serverStatus
?>
</body>

View File

@ -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 ^<?php >>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

View File

@ -25,6 +25,8 @@
<br />
<br />
KWorld Enabled: <input name="kworldenabled" id="id" type="checkbox" <?php if($KWorldEnabled > "0") echo "checked=checked; "; ?> /><br />
KWorld Widget Enabled: <input name="KworldWidget" id="id" type="checkbox" <?php if($KworldWidget > "0") echo "checked=checked; "; ?> /><br />
<br />
<br />
Services Widget Enabled: <input name="servicesvisible" id="id" type="checkbox" <?php if($servicesvisible > "0") echo "checked=checked; "; ?> /><br />
Clock Widget Enabled: <input name="clockvisible" id="id" type="checkbox" <?php if($clockvisible > "0") echo "checked=checked; "; ?> /><br />

View File

@ -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);

View File

@ -55,6 +55,14 @@ if ($servicesvisible > "0") {
require "services.php";
} else {
}
?>
</p>
<?php
if ($KworldWidget > "0") {
require "Servers_KWorld.php";
} else {
}
?>
</p>
@ -65,7 +73,6 @@ if ($drivespacevisible > "0") {
}
?>
</div>
</div>
</body>

View File

@ -8,8 +8,8 @@
var nextRow = $(row).next();
nextRow.toggle();
}
function togglebodyServers() {
$('#serverstable tbody').toggle();
function togglebodykworld() {
$('#kworldstable tbody').toggle();
}
</script>
@ -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 = "<table id='serverstable' width='190' border='0' cellspacing='0' cellpadding='1'><thead><tr onclick='togglebodyServers()'><th style='text-align: left;'><font color='white'>Server</font></th><th style='text-align: left;'><font color='white'>Status</font></th></tr></thead>";
$serverStatus = "<table id='kworldstable' width='190' border='0' cellspacing='0' cellpadding='1'><thead><tr onclick='togglebodykworld()'><th style='text-align: left;'><font color='white'>K-World Status</font></th><th style='text-align: left;'><font color='white'></font></th></tr></thead>";
}
# 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 .= "<td BGCOLOR='#FFFFFF'>{$serviceName}</td><td BGCOLOR='#FFFFFF'>{$statusText}</td></tbody></tr>";
}
# 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 = "<font color='red'>Down</font>";
}
else
{
$statusText = "<font color='green'>Up</font>";
}
# Set the status Row.
$serverStatus .= "<td BGCOLOR='#FFFFFF'>{$serviceName}</td><td BGCOLOR='#FFFFFF'>{$statusText}</td></tbody></tr>";
}
# 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 = "<font color='red'>Down</font>";
}
else
{
$statusText = "<font color='green'>Up</font>";
}
# Set the status Row.
$serverStatus .= "<td BGCOLOR='#FFFFFF'>{$serviceName}</td><td BGCOLOR='#FFFFFF'>{$statusText}</td></tbody></tr>";
}
# Finish service status table.
$serverStatus .= "</table>";
# File Complete.

View File

@ -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']["<a href='$http/$server1url' target=\'_blank\'>$server1name</a>"] = 80;
$configs['services2']["<a href='$http/$server2url' target=\'_blank\'>$server2name</a>"] = 80;
$configs['services3']["<a href='$http/$server3url' target=\'_blank\'>$server3name</a>"] = 80;
$configs['services4']["<a href='$http/$server4url' target=\'_blank\'>$server4name</a>"] = 80;
$configs['services1']["<a href='$http2$kknowledge' target=\'_blank\'>KKnowledge</a>"] = 80;
$configs['services2']["<a href='$knews' target=\'_blank\'>KNews</a>"] = 80;
$configs['services3']["<a href='$kloud' target=\'_blank\'>KLoud</a>"] = 80;
$configs['services4']["<a href='$konvos' target=\'_blank\'>Konvos</a>"] = 80;
$configs['services5']["<a href='$kspot' target=\'_blank\'>KSpot</a>"] = 80;
$configs['services6']["<a href='$webclip' target=\'_blank\'>Klips</a>"] = 80;
?>

View File

@ -1,3 +1,3 @@
<?php
echo "<p style=\" text-align: center;\">New Update Available</p>";
echo "<p style=\" text-align: center;\">New Update ($remoteversion) Available</p>";
?>

View File

@ -1,4 +1,4 @@
<?php
//// KLANDING VERSION
$remoteversion = "2.5"; //
$remoteversion = "2.5.1"; //
?>