Obsolete update check replaced with SVN revision
authorRoland Häder <roland@mxchange.org>
Tue, 9 Sep 2008 12:26:08 +0000 (12:26 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 9 Sep 2008 12:26:08 +0000 (12:26 +0000)
inc/databases.php
inc/language/de.php
inc/modules/admin/what-updates.php
inc/patch-system.php
templates/de/html/admin/admin_update_download.tpl

index 2057f13..1440b29 100644 (file)
@@ -114,7 +114,7 @@ define('USAGE_BASE', "usage");
 define('SERVER_URL', "http://www.mxchange.org");
 
 // This current patch level
-define('CURR_PATCH_LEVEL', "514");
+define('CURR_SVN_REVISION', "279");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index 863d2d5..038970c 100644 (file)
@@ -1006,9 +1006,9 @@ define('ENTER_SUB_REASON', "Grund des Abzuges");
 define('ADMIN_SUB_POINTS', "{!POINTS!} abziehen");
 define('ADMIN_SUB_POINTS_FROM_ALL', "Allen Mitgliedern {!POINTS!} abziehen");
 define('PATCH_DESCRIPTION', "Beschreibung zum Patch");
-define('DOWNLOAD_ZIP', "Direktes ZIP-Archiv downloaden");
-define('DOWNLOAD_BZIP2', "Direkten Tar-Ball downloaden");
-define('DOWNLOAD_FROM_SERVER', "&Uuml;ber unseren Server downloaden");
+define('DOWNLOAD_SVN', "SVN-Version herunterladen");
+define('SVN_REPOSITORY', "SVN-Repository");
+define('SVN_CHECKOUT_COMMAND', "SVN auschecken mit:");
 define('DOWNLOAD_NOW', "Jetzt downloaden!");
 define('ADMIN_MEMBER_STATS_TITLE', "Einstellungen an der Mitglieder-Statistik");
 define('ADMIN_MEMBER_STATS_LIMIT', "Anzahl Mailbuchungen pro Seite");
index c0db3f8..6e1e23f 100644 (file)
@@ -44,9 +44,9 @@ ADD_DESCR("admin", basename(__FILE__));
 $ONLINE['code'] = "???";
 
 // Get response from our server in an array
-$response = GET_URL("check-updates2.php");
+$response = GET_URL("check-updates3.php");
 
-if (empty($response[0]) && empty($response[1]) && empty($response[2])) {
+if (empty($response[0]) && empty($response[1]) && empty($response[2]) && empty($response[3])) {
        // Error!
        $response = array("", "", "");
 } else {
@@ -71,8 +71,9 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2])) {
 
                // Which is the latest version on server?
                $ONLINE = array(
-                       'version' => str_replace("\n", "", $response[0]),
-                       'changed' => str_replace("\n", "", $response[1])
+                       'version'  => str_replace("\n", "", $response[0]),
+                       'changed'  => str_replace("\n", "", $response[1]),
+                       'revision' => str_replace("\n", "", $response[2]),
                );
 
                // Array for available patches
@@ -82,7 +83,7 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2])) {
                        'ctime' => array()
                );
 
-               if (($response[2] != "[EOF]") && ($ONLINE['version'] == FULL_VERSION)) {
+               if (($response[3] != "[EOF]") && ($ONLINE['version'] == FULL_VERSION)) {
                        // We have found new patches (newer than FULL_VERSION)
                        $max = str_replace("\n", "", $response[sizeof($response) - 2]); $TOTAL_SIZE = "0";
 
@@ -123,10 +124,11 @@ if (empty($response[0]) && empty($response[1]) && empty($response[2])) {
 if (empty($ONLINE['version'])) {
        // Disconnected?
        LOAD_TEMPLATE("admin_settings_saved", false, "<FONT class=\"admin_failed\">".ADMIN_CANNOT_CHECK_VERSION." (".$ONLINE['code'].")</FONT>");
-} elseif ($ONLINE['version'] != FULL_VERSION) {
+} elseif (($ONLINE['version'] != FULL_VERSION) || ($ONLINE['revision'] != CURR_SVN_REVISION)) {
        // New full-version available (all previous released patches are included in this version!)
        define('__ONLINE_VERSION', $ONLINE['version']);
        define('__ONLINE_CHANGE' , MAKE_DATETIME($ONLINE['changed'], "2"));
+       define('__ONLINE_REVISION', $ONLINE['revision']);
 
        // Load template
        LOAD_TEMPLATE("admin_update_download");
index e3ec443..1965995 100644 (file)
@@ -39,10 +39,10 @@ if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
 }
 
 // Check for patch level differences between databases and current hard-coded
-if (CURR_PATCH_LEVEL > $_CONFIG['patch_level']) {
+if (CURR_SVN_REVISION > $_CONFIG['patch_level']) {
        // Update database and CONFIG array
-       UPDATE_CONFIG(array("patch_level", "path_ctime"), array(CURR_PATH_LEVEL, "UNIX_TIMESTAMP()"));
-       $_CONFIG['patch_level'] = CURR_PATCH_LEVEL;
+       UPDATE_CONFIG(array("patch_level", "path_ctime"), array(CURR_SVN_REVISION, "UNIX_TIMESTAMP()"));
+       $_CONFIG['patch_level'] = CURR_SVN_REVISION;
        $_CONFIG['patch_ctime'] = time();
 } // END - if
 
index 91f7161..5e78bb2 100644 (file)
@@ -10,7 +10,7 @@
        <TR>
                <TD align="right" width="350">{--YOUR_VERSION_IS--}:</TD>
                <TD width="10" class="seperator">&nbsp;</TD>
-               <TD><STRONG>v{!FULL_VERSION!}</STRONG></TD>
+               <TD><STRONG>v{!FULL_VERSION!} {!CURR_SVN_REVISION!}</STRONG></TD>
        </TR>
        <TR>
                <TD height="2" colspan="3" class="seperator">&nbsp;</TD>
@@ -18,7 +18,7 @@
        <TR>
                <TD align="right" width="350">{--ONLINE_VERSION_IS--}:</TD>
                <TD width="10" class="seperator">&nbsp;</TD>
-               <TD><STRONG>v{--__ONLINE_VERSION--}</STRONG></TD>
+               <TD><STRONG>v{!__ONLINE_VERSION!} {!__ONLINE_REVISION!}</STRONG></TD>
        </TR>
        <TR>
                <TD height="2" colspan="3" class="seperator">&nbsp;</TD>
        <TR>
                <TD align="right" width="350">{--UPDATE_CREATE_TIME--}:</TD>
                <TD width="10" class="seperator">&nbsp;</TD>
-               <TD><STRONG>{--__ONLINE_CHANGE--}</STRONG></TD>
+               <TD><STRONG>{!__ONLINE_CHANGE!}</STRONG></TD>
+       </TR>
+       <TR>
+               <TD height="2" colspan="3" class="seperator">&nbsp;</TD>
        </TR>
        <TR>
                <TD height="10" colspan="3" class="seperator bottom2">&nbsp;</TD>
                                </TD>
                        </TR>
                        <TR>
-                               <TD align="right" height="25">{--DOWNLOAD_ZIP--}:&nbsp;</TD>
-                               <TD align="center"><STRONG><A
-                                       href="http://prdownloads.sourceforge.net/mxchange/mxchange-{--__ONLINE_VERSION--}.zip?download"
-                                       target="_blank">{--DOWNLOAD_NOW--}</A></STRONG></TD>
-                       </TR>
-                       <TR>
-                               <TD align="right" height="25">{--DOWNLOAD_BZIP2--}:&nbsp;</TD>
-                               <TD align="center"><STRONG><A
-                                       href="http://prdownloads.sourceforge.net/mxchange/mxchange-{--__ONLINE_VERSION--}.bzip2?download"
-                                       target="_blank">{--DOWNLOAD_NOW--}</A></STRONG></TD>
-                       </TR>
-                       <TR>
-                               <TD align="right" height="25">
-                               {--DOWNLOAD_FROM_SERVER--}:&nbsp;</TD>
-                               <TD align="center"><STRONG><A
-                                       href="{--SERVER_URL--}/cms/index/wht/downloads" target="_blank">{--DOWNLOAD_NOW--}</A></STRONG>
+                               <TD width="50%" align="right" height="40" style="padding-right:5px">
+                                       {--DOWNLOAD_SVN--}:
+                               </TD>
+                               <TD width="50%" align="center">
+                                       <STRONG><A href="{!SERVER_URL!}/cms/index/wht/svn" target="_blank">{--DOWNLOAD_NOW--}</A></STRONG>
                                </TD>
                        </TR>
                </TABLE>
                </TD>
        </TR>
        <TR>
-               <TD height="30" colspan="3" class="admin_footer seperator">&nbsp;</TD>
+               <TD colspan="3" class="admin_footer">
+                       {--SVN_CHECKOUT_COMMAND--}<br />
+                       svn co {!SERVER_URL!}/repos/mxchange-application/branches/{!FULL_VERSION!}/
+               </TD>
        </TR>
 </TABLE>