From 229a089d4514270885701006cfca58a2ede418c7 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 11 Jun 2012 07:46:43 +0100 Subject: [PATCH] Now checks for updates of ICEcoder & CodeMirror Extended this process to check for firstly ICEcoder updates and then CodeMirror Both working via their own remotely sourced latest-version.txt files If ICEcoder is up to date, if performs a check on CodeMirrors version no. --- index.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 55b4d6c..b9d5c8a 100644 --- a/index.php +++ b/index.php @@ -10,12 +10,18 @@ if (!$allowedIP) { header('Location: /'); }; -// Test for latest CodeMirror version -if ($testcMVersion) { - $cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt")); - $cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n"); - if ($cMThisVer<$cMLatestVer) { - echo ''; +// Check for updates of ICEcoder & CodeMirror +if ($checkUpdates) { + $ICEcoderLatestVer = json_encode(file_get_contents("http://icecoder.net/latest-version.txt")); + $ICEcoderLatestVer = rtrim(ltrim($ICEcoderLatestVer,"\""),"\"\\n"); + if (ltrim($versionNo,"v ")alert(\'ICEcoder '.$ICEcoderLatestVer.' now released\n\nPlease upgrade\');'; + } else { + $cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt")); + $cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n"); + if ($cMThisVer<$cMLatestVer) { + echo ''; + } } } ?>