]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-nickname.php
0.0.0 shall be our first version
[mailer.git] / inc / extensions / ext-nickname.php
index 618d44b9f92184a1cf8706357b5d18a6e94bf864..363d9920dba685735e5ce76b64e3f572280a5625 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,13 +41,13 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.1.9');
+setThisExtensionVersion('0.2.0');
 
-// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(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'));
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.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'));
 
 switch (getExtensionMode()) {
-       case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+       case 'register': // Do stuff when installation is running
                // SQL commands to run
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD nickname VARCHAR(255) NOT NULL DEFAULT ''");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD nick_userid ENUM ('nick','userid') NOT NULL DEFAULT 'userid'");
@@ -60,7 +58,7 @@ switch (getExtensionMode()) {
                // SQL commands to run
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname'");
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname')");
-               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
+               addDropTableSql('nickname_history');
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -76,13 +74,11 @@ switch (getExtensionMode()) {
        case 'update': // Update an extension
                switch (getCurrentExtensionVersion()) {
                        case '0.0.1': // SQL queries for v0.0.1
-                               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='nickname' AND ext_has_css='N' LIMIT 1");
-
                                // This update depends on sql_patches update!
-                               addExtensionUpdateDependency('sql_patches');
+                               addExtensionDependency('sql_patches');
 
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("CSS-Datei kann per Adminbereich ein- und ausgeschaltet werden.");
+                               setExtensionUpdateNotes("Veraltetes Update entfernt.");
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
@@ -101,9 +97,9 @@ switch (getExtensionMode()) {
                                break;
 
                        case '0.0.6': // SQL queries for v0.0.6
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_len` TINYINT(3) UNSIGNED NOT NULL DEFAULT 5");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_pattern` VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nickname_chars` VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
+                               addConfigAddSql('nickname_len', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
+                               addConfigAddSql('nickname_pattern', "VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
+                               addConfigAddSql('nickname_chars', "VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
                                addAdminMenuSql('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
 
                                // Update notes (these will be set as task text!)
@@ -176,28 +172,35 @@ switch (getExtensionMode()) {
 
                        case '0.1.9': // SQL queries for v0.1.9
                                addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
-                               addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
-                               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_nickname_history` (
+                               addDropTableSql('nickname_history');
+                               addCreateTableSql('nickname_history', "(
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `nickname` VARCHAR(255) NOT NULL DEFAULT '',
 `added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`last_used` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+`last_used` TIMESTAMP NULL DEFAULT NULL,
 INDEX `userid` (`userid`),
 INDEX (`last_used` DESC),
 PRIMARY KEY (`id`)
-) TYPE={?_TABLE_TYPE?} COMMENT='History of used nicknames'");
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'History of used nicknames'");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Historie eingegebener Nicknames hinzugefügt. Mitglied kann auf bereits verwendeter zurückgreifen und Liste selbst löschen.");
                                break;
-               }
+
+                       case '0.2.0': // SQL queries for v0.2.0
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_nickname_history` CHANGE `last_used` `last_used` TIMESTAMP NULL DEFAULT NULL");
+
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Ausgangswert ist nicht mehr 0000-00-00 00:00:00, sondern NULL.");
+                               break;
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
                break;
 
-       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+       case 'test': // For testing purposes
                break;
 
        case 'init': // Do stuff when extension is initialized