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.
This commit is contained in:
Matt Pass
2012-06-11 07:46:43 +01:00
parent 49ca9d75f9
commit 229a089d45

View File

@@ -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 '<script>alert(\'Code Mirror '.$cMLatestVer.' now released\n\nPlease upgrade\');</script>';
// 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 ")<ltrim($ICEcoderLatestVer,"v ")) {
echo '<script>alert(\'ICEcoder '.$ICEcoderLatestVer.' now released\n\nPlease upgrade\');</script>';
} else {
$cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
$cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n");
if ($cMThisVer<$cMLatestVer) {
echo '<script>alert(\'Code Mirror '.$cMLatestVer.' now released\n\nPlease upgrade\');</script>';
}
}
}
?>