diff --git a/system/pages/admin/version.php b/system/pages/admin/version.php index d8e4ade5..0381d6ba 100644 --- a/system/pages/admin/version.php +++ b/system/pages/admin/version.php @@ -14,17 +14,28 @@ $title = 'Version check'; // fetch version //$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.'); //$myaac_version = fgets($file); -$myaac_version = file_get_contents('http://my-aac.org/VERSION'); +$myaac_version = @file_get_contents('http://my-aac.org/VERSION'); +if(!$myaac_version) { + warning('Error while fetching version info from http://my-aac.org. Site might be offline.'); + return; +} // compare them -if(version_compare($myaac_version, MYAAC_VERSION) <= 0) - echo '

MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version. -
View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here') . '

'; -else - echo '

You\'re using outdated version.
+$version_compare = version_compare($myaac_version, MYAAC_VERSION); +if($version_compare == 0) { + success('MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version. +
View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here')); +} +else if($version_compare < 0) { + echo success('Woah, seems you\'re using newer version as latest released one! MyAAC latest released version is ' . $myaac_version . ', and you\'re using version ' . MYAAC_VERSION . '. +
View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here')); +} +else { + warning('You\'re using outdated version.
Your version: ' . MYAAC_VERSION . '
Latest version: ' . $myaac_version . '
- Download available at: www.my-aac.org

'; + Download available at: www.my-aac.org'); +} /* function version_revert($version)