X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fextensions%2Fext-country.php;h=5e62d49da6326ac38ad2d756fa3bbd8145ee4227;hp=1f3466aa979b383c0bd5b233e039451554719e33;hb=596c8ab32594401ca84abfbfe35513ddfff31bec;hpb=20741b93fd58620af677a7f1039ffd16ea6ec689 diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 1f3466aa97..5e62d49da6 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -41,10 +41,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0.4'); +setThisExtensionVersion('0.0.5'); // 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')); +setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5')); // Keep this extension always active! setExtensionAlwaysActive('Y'); @@ -59,7 +59,7 @@ switch (getExtensionMode()) { `descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland', `is_active` ENUM('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`id`), -UNIQUE (`code`)", +UNIQUE INDEX (`code`)", 'Country codes and their full-length descriptions'); // Insert first (Germany) country @@ -69,14 +69,20 @@ UNIQUE (`code`)", addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {OPEN_CONFIG}mt_word{CLOSE_CONFIG} anmelden können.', 8); addAdminMenuSql('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1); + // This extension depends on ext-user + addExtensionDependency('user'); + // Add entry to user table - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `country_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"); break; case 'remove': // Do stuff when removing extension // SQL commands to run addDropTableSql('countries'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'"); + + // Unregister filter + unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -90,8 +96,7 @@ UNIQUE (`code`)", break; case 'update': // Update an extension - switch (getCurrentExtensionVersion()) - { + switch (getCurrentExtensionVersion()) { case '0.0.1': // SQL queries for v0.0.1 // Update notes (these will be set as task text!) setExtensionUpdateNotes("SQL-Dateien hinzugefügt, die Sie mit z.B. phpMyAdmin einspielen können. (DOCS/country/README.de lesen!)"); @@ -111,7 +116,18 @@ UNIQUE (`code`)", // Update notes (these will be set as task text!) setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle."); break; - } + + case '0.0.5': // SQL queries for v0.0.5 + // Register a filter + registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun()); + + // This depends on ext-register + addExtensionDependency('register'); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Filter zum Mitgliederanmeldeformular hinzugefügt."); + break; + } // END - switch break; case 'modify': // When the extension got modified @@ -126,7 +142,7 @@ UNIQUE (`code`)", default: // Unknown extension mode logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); break; -} +} // END - switch -// +// [EOF] ?>