示例#1
0
}
// Erreichbarkeit der Updateinformation prüfen und bei Verbindung
// verfügbare Admidio Versionen vom Server einlesen (Textfile)
// Zunächst die Methode selektieren (CURL bevorzugt)
if (@file_get_contents('http://www.admidio.org/update.txt') === false) {
    // Admidio Versionen nicht auslesbar
    $stableVersion = 'n/a';
    $betaVersion = 'n/a';
    $betaRelease = '';
    $versionUpdate = 99;
} else {
    $update_info = file_get_contents('http://www.admidio.org/update.txt');
    // Admidio Versionen vom Server übergeben
    $stableVersion = getUpdateVersion($update_info, 'Version=');
    $betaVersion = getUpdateVersion($update_info, 'Beta-Version=');
    $betaRelease = getUpdateVersion($update_info, 'Beta-Release=');
    // Keine Stabile Version verfügbar (eigentlich unmöglich)
    if ($stableVersion === '') {
        $stableVersion = 'n/a';
    }
    // Keine Beatversion verfügbar
    if ($betaVersion === '') {
        $betaVersion = 'n/a';
        $betaRelease = '';
    }
    // Auf Update prüfen
    $versionUpdate = checkVersion(ADMIDIO_VERSION, $stableVersion, $betaVersion, $betaRelease, ADMIDIO_VERSION_BETA);
}
// Nur im Anzeigemodus geht es weiter, ansonsten kann der aktuelle Updatestand
// in der Variable $version_update abgefragt werden.
// $version_update (0 = Kein Update, 1 = Neue stabile Version, 2 = Neue Beta-Version, 3 = Neue stabile + Beta Version, 99 = Keine Verbindung)
示例#2
0
文件: index.php 项目: petrospe/frog
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                              <li class='stat-count'><span>" . implode("", getExpirationInfo("descr")) . "</span><span>Services Expiration date</span></li>";
     if (implode("", getExpirationInfo("updateto")) > (new \DateTime())->format('Y-m-d')) {
         echo "<li class='stat-percent'><span class='text-success'>" . implode("", getExpirationInfo("updateto")) . "</span></li>";
     } else {
         echo "<li class='stat-percent'><span class='text-error'>" . implode("", getExpirationInfo("updateto")) . "</span></li>";
     }
     echo "              </ul>\r\n                    </div>\r\n                </div>";
 } else {
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                            <li class='stat-count'><span>" . Yii::app()->user->name . "</span><span>User does not exist in Customers</span></li>\r\n                        </ul>\r\n                    </div>\r\n                </div>";
 }
 if (!empty(getUpdateVersion("max(version)"))) {
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                            <li class='stat-count'><a href='" . implode("", getUpdateVersion("max(file_path)")) . "' target='_blank'><span>" . implode("", getUpdateVersion("max(version)")) . "</span></a><span>User Update Version</span></li>";
     if (implode("", getExpirationInfo("updateto")) > (new \DateTime())->format('Y-m-d')) {
         echo "<li class='stat-percent'><span class='text-success'>" . implode("", getUpdateVersion("max(upddate)")) . "</span></li>";
     } else {
         echo "<li class='stat-percent'><span class='text-error'>" . implode("", getUpdateVersion("max(upddate)")) . "</span></li>";
     }
     echo "              </ul>\r\n                    </div>\r\n                </div>";
 } else {
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                            <li class='stat-count'><span>" . Yii::app()->user->name . "</span><span>Unknown Update Version</span></li>\r\n                        </ul>\r\n                    </div>\r\n                </div>";
 }
 if (!empty(getInstalledVersion("max(au.version)"))) {
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                            <li class='stat-count'><span>" . implode("", getInstalledVersion("max(au.version)")) . "</span><span>User Installed Version</span></li>";
     if (implode("", getExpirationInfo("updateto")) > (new \DateTime())->format('Y-m-d')) {
         echo "<li class='stat-percent'><span class='text-success'>" . implode("", getInstalledVersion("max(condate)")) . "</span></li>";
     } else {
         echo "<li class='stat-percent'><span class='text-error'>" . implode("", getInstalledVersion("max(condate)")) . "</span></li>";
     }
     echo "              </ul>\r\n                    </div>\r\n                </div>";
 } else {
     echo "      <div class='span4 '>\r\n                    <div class='stat-block'>\r\n                        <ul>\r\n                            <li class='stat-count'><span>" . Yii::app()->user->name . "</span><span>No info about Installed Version</span></li>\r\n                        </ul>\r\n                    </div>\r\n                </div>";