]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-sql_patches.php
pool delivery won't no longer work on daily reset, daily reset won't work in DEBUG_MO...
[mailer.git] / inc / extensions / ext-sql_patches.php
index b332e0d9b91e1a8cd72fd312677939b0e335fa81..e7821b302615e11efd495390d54c9aeccf9cf52f 100644 (file)
@@ -38,13 +38,13 @@ if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
 }
 
 // Version number
-$EXT_VERSION = "0.4.5";
+$EXT_VERSION = "0.4.6";
 
 // Auto-set extension version
 if (!isset($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5");
+$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "0.2.0", "0.2.1", "0.2.2", "0.2.3", "0.2.4", "0.2.5", "0.2.6", "0.2.7", "0.2.8", "0.2.9", "0.3.0", "0.3.1", "0.3.2", "0.3.3", "0.3.4", "0.3.5", "0.3.6", "0.3.7", "0.3.8", "0.3.9", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -244,7 +244,7 @@ PRIMARY KEY(id)
 
        case "0.1.8": // SQL queries for v0.1.8
                // Update notes (these will be set as task text!)
-               $UPDATE_NOTES = "mad_counter und last_mad werden nun aus der Datenbank geladen";
+               $UPDATE_NOTES = "mad_count und last_mad werden nun aus der Datenbank geladen";
                break;
 
        case "0.1.9": // SQL queries for v0.1.9
@@ -289,8 +289,7 @@ PRIMARY KEY(id)
 
        case "0.2.4": // SQL queries for v0.2.4
                $auto_type = "png"; // PNG image is the default
-               if ((file_exists(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg'))
-               {
+               if ((FILE_READABLE(PATH."theme/".GET_CURR_THEME()."/images/code_bg.jpg")) && function_exists('imagecreatefromjpeg')) {
                        // Switch to JPEG format
                        $auto_type = "jpg";
                }
@@ -565,6 +564,15 @@ PRIMARY KEY (id)
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Täglichen/wöchentlichen/monatlichen Reset verbessert.";
                break;
+
+       case "0.4.6": // SQL queries for v0.4.6
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD gender ENUM ('M','F') NOT NULL DEFAULT 'M'";
+               $SQLs[] = "UPDATE "._MYSQL_PREFIX."_user_data SET gender=sex WHERE sex != 'M'";
+               $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP sex";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Offensives Wort "Sex" gegen "Gender" ausgetauscht.";
+               break;
        }
        break;
 
@@ -588,19 +596,21 @@ default: // Do stuff when extension is loaded
                                require_once(PATH."inc/extensions/ext-cache.php");
                                if ($cacheInstance->cache_file("extensions", true)) $cacheInstance->cache_destroy();
                                if ($cacheInstance->cache_file("mod_reg", true)) $cacheInstance->cache_destroy();
-                       }
-               }
+                       } // END - if
+               } // END - if
 
                // Test again
                if ((!empty($_CONFIG['file_hash'])) && (!empty($_CONFIG['master_salt'])) && (!empty($_CONFIG['pass_scramble']))) {
                        // File hash fas generated so we can also file the secret file... hopefully.
-                       if ((file_exists(PATH."inc/.secret/.".$_CONFIG['file_hash'])) && (is_readable(PATH."inc/.secret/.".$_CONFIG['file_hash']))) {
-                               $_CONFIG['secret_key'] = implode("", file(PATH."inc/.secret/.".$_CONFIG['file_hash']));
+                       $hashFile = sprintf("%sinc/.secret/.%s", PATH, $_CONFIG['file_hash']);
+                       if (FILE_READABLE($hashFile)) {
+                               // Read file
+                               $_CONFIG['secret_key'] = implode("", file($hashFile));
                        } else {
                                // Cannot read secret file!
                                mxchange_die("Cannot read secret file!");
                        }
-               }
+               } // END - if
 
                // Transfer words/numbers to constants
                define('POINTS'  , $dummy['points_word']);