]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-order.php
Fixes for running SQL queries
[mailer.git] / inc / extensions / ext-order.php
index 938d97c57f807a520433fc2aca8ba6d340431c30..ff17638453563a78b33d7bd9dbfac596e0af602c 100644 (file)
@@ -38,13 +38,13 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
-$EXT_VERSION = "0.4.9";
+$EXT_VERSION = "0.5.0";
 
 // Auto-set extension version
 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
 
 // Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.1", "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", "0.4.7", "0.4.8", "0.4.9");
+$EXT_VER_HISTORY = array("0.0", "0.1", "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", "0.4.7", "0.4.8", "0.4.9", "0.5.0");
 
 switch ($EXT_LOAD_MODE)
 {
@@ -75,7 +75,7 @@ case "update": // Update an extension
        {
        case "0.1": // SQL queries for v0.1
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'";
-               $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (action, what, title, sort, descr) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+               $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
 
                // Update notes (these will be set as task text!)
                $UPDATE_NOTES = "Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.";
@@ -83,7 +83,7 @@ case "update": // Update an extension
 
        case "0.1.1": // SQL queries for v0.1.1
                $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='config_order' LIMIT 1";
-               $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (action, what, title, sort, descr) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
+               $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`, `what`, `title`, `sort`, `descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')";
                $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
 
                // Update notes (these will be set as task text!)
@@ -298,16 +298,32 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us
                $UPDATE_NOTES = "Bei Löschung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen {!POINTS!} wieder gutgeschrieben werden sollen oder in den Jackpot landen.";
                break;
 
+       case "0.5.0": // SQL queries for v0.5.0
+               $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_url_blacklist`";
+               $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_url_blacklist` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`url` VARCHAR(255) NOT NULL DEFAULT '',
+`pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`pool_id`)
+) TYPE=MYISAM COMMENT='URL blacklist'";
+
+               // Update notes (these will be set as task text!)
+               $UPDATE_NOTES = "Tabelle für URL-Sperrliste angelegt.";
+               break;
        }
        break;
 
+case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+       break;
+
 default: // Do stuff when extension is loaded
        // Do daily reset only when installed and extension version is at least 0.1.1
-       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "0.1.1"))
-       {
+       if ((isBooleanConstantAndTrue('__DAILY_RESET')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('mxchange_installed')) && (isBooleanConstantAndTrue('admin_registered')) && (GET_EXT_VERSION("order") >= "0.1.1")) {
                // Reset mail order values
                $result_ext = SQL_QUERY("UPDATE `"._MYSQL_PREFIX."_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
-       }
+       } // END - if
        break;
 }