Change of latest version URL, not JSON encoded

Now calling /latest-version which is a tidier URL and also passing user
version no to this
This URL now tracks usage via Google Analytics, so I can begin to get an
idea of which version nos users are on, geo data, overall usage etc
No longer using json_encode as it's not JSON encoded, instead splitting
on line breaks and grabbing first array value as the version no
This commit is contained in:
Matt Pass
2013-02-25 16:39:46 +00:00
parent a7a5ada4d9
commit d6a82d1962

View File

@@ -8,7 +8,8 @@ if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*"
$updateMsg = '';
// Check for updates
if ($ICEcoder["checkUpdates"]) {
$icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
$icv = explode("\n",file_get_contents("http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"]));
$icv = $icv[0];
$icv = rtrim(ltrim($icv,'"'),'"\\n');
if ($ICEcoder["versionNo"]<$icv) {
$updateMsg = ";top.ICEcoder.dataMessage('<b>UPDATE INFO:</b> ICEcoder v ".$icv." now available. (Your version is v ".$ICEcoder["versionNo"]."). Get it free from <a href=\\'http://icecoder.net\\' target=\\'_blank\\' style=\\'color:#ddd\\'>icecoder.net</a>');";