]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-register.php
Mailer project continued:
[mailer.git] / inc / extensions / ext-register.php
index 26b080afc728cbcd36058b9d8a49ada825445316..4f61667a6b2f3951da4c5b0178eb73fb4cb1a911 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * 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 *
  * it under the terms of the GNU General Public License as published by *
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.5.5');
+setThisExtensionVersion('0.5.7');
 
 // Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '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', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5'));
+setExtensionVersionHistory(array('0.0.0', '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', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running
@@ -58,23 +58,29 @@ switch (getExtensionMode()) {
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='register' LIMIT 1");
                addDropTableSql('must_register');
 
-               // Unregister a filter
-               unregisterFilter(__FUNCTION__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
+               // Unregister points data
+               unregisterExtensionPointsData('register_welcome');
+               unregisterExtensionPointsData('referral_bonus');
+               unregisterExtensionPointsData('referral_bonus_ref');
+
+               // Unregister filter
+               unregisterFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', true, isExtensionDryRun());
+               unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='N', `visible`='Y' WHERE `what`='register' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='N',`visible`='Y' WHERE `what`='register' LIMIT 1");
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='Y', `visible`='N' WHERE `what`='register' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='Y',`visible`='N' WHERE `what`='register' LIMIT 1");
                break;
 
        case 'update': // Update an extension
                switch (getCurrentExtensionVersion()) {
-                       case '0.1.0': // SQL queries for v0.1
+                       case '0.1.0': // SQL queries for v0.1.0
                                addDropTableSql('must_register');
                                addCreateTableSql('must_register', "
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -84,12 +90,12 @@ PRIMARY KEY (`id`)",
                                        'Data which fields the user must fill out');
 
                                // Add all entries as required (DO NOT DELETE THEM FROM DATABASE!)
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip','Y')");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city','Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('surname', 'Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('family', 'Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('street_nr', 'Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('cntry', 'Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('zip', 'Y')");
+                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('city', 'Y')");
 
                                // Add admin menu
                                addAdminMenuSql('setup','config_register','Pflichtfelder','Stellen Sie hier die Pflichtfelder sowohl im Anmeldeformular, als auch im Mitgliedsbereich unter <strong>Profildaten &auml;ndern</strong> ein.', 12);
@@ -99,7 +105,7 @@ PRIMARY KEY (`id`)",
                                break;
 
                        case '0.1.1': // SQL queries for v0.1.1
-                               // This update depends on sql_patches update!
+                               // This update depends on ext-sql_patches update!
                                addExtensionDependency('sql_patches');
 
                                // Update notes (these will be set as task text!)
@@ -107,11 +113,11 @@ PRIMARY KEY (`id`)",
                                break;
 
                        case '0.1.3': // SQL queries for v0.1.3
-                               // This update depends on sql_patches update!
+                               // This update depends on ext-sql_patches update!
                                addExtensionDependency('sql_patches');
 
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Standard Referal-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
+                               setExtensionUpdateNotes("Standard Referral-Id kann per Admin-Bereich eingestellt werden (war vorher nur in modules.php und index.php direkt eingebbar.)");
                                break;
 
                        case '0.1.4': // SQL queries for v0.1.4
@@ -181,7 +187,7 @@ PRIMARY KEY (`id`)",
 
                        case '0.2.7': // SQL queries for v0.2.7
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Referal-Id wird endlich korrekt gesetzt.");
+                               setExtensionUpdateNotes("Referral-Id wird endlich korrekt gesetzt.");
                                break;
 
                        case '0.2.8': // SQL queries for v0.2.8
@@ -209,9 +215,6 @@ PRIMARY KEY (`id`)",
                                setExtensionUpdateNotes("Einbindung der Erweiterung <strong>country</strong>, die Sie sich noch optional von <strike>meiner Seite herunterladen</strike> m&uuml;ssen.<br />
 <br />
 <strong>Wichtig: Laden Sie noch das Template <strong>guest_register.tpl</strong> mit hoch, welches unter templates/".getLanguage()."/html/guest/ zu finden ist!</strong>");
-
-                               // Depends on 'country'
-                               addExtensionDependency('country');
                                break;
 
                        case '0.3.3': // SQL queries for v0.3.3
@@ -303,7 +306,7 @@ PRIMARY KEY (`id`)",
 
                        case '0.5.0': // SQL queries for v0.5.0
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Fehlermeldung <em><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{?PATH?}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></em> beseitigt.");
+                               setExtensionUpdateNotes("Fehlermeldung <span class=\"bad\"><strong>Fatal error:</strong> Call to undefined function registerGenerateCategoryTable() in <strong>{?PATH?}/inc/modules/guest/what-register.php</strong> on line <strong>434</strong></span> beseitigt.");
                                break;
 
                        case '0.5.1': // SQL queries for v0.5.1
@@ -318,7 +321,7 @@ PRIMARY KEY (`id`)",
 
                        case '0.5.3': // SQL queries for v0.5.3
                                // Register a filter
-                               registerFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, isExtensionDryRun());
+                               registerFilter(__FILE__, __LINE__, 'register_must_fillout', 'REGISTER_MUST_FILLOUT', false, true, isExtensionDryRun());
 
                                // Run these SQLs
                                addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('gender','Y')");
@@ -327,7 +330,7 @@ PRIMARY KEY (`id`)",
                                addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_must_register` (`field_name`, `field_required`) VALUES ('marker','Y')");
 
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugef&uuml;gt, weitere Felder in <em>{?_MYSQL_PREFIX?}_must_register</em> eingef&uuml;gt.");
+                               setExtensionUpdateNotes("Filter <strong>register_must_fillout</strong> hinzugef&uuml;gt, weitere Felder in <span class=\"bad\">{?_MYSQL_PREFIX?}_must_register</span> eingef&uuml;gt.");
                                break;
 
                        case '0.5.4': // SQL queries for v0.5.4
@@ -343,6 +346,29 @@ PRIMARY KEY (`id`)",
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Weiteren Men&uuml;punkt aus <strong>menu-{?DEFAULT_LANG?} heraus geholt.");
                                break;
+
+                       case '0.5.6': // SQL queries for v0.5.6
+                               // Register points data
+                               registerExtensionPointsData('register_welcome', 'points', 'LOCKED', 'DIRECT');
+
+                               // This depends on ext-sql_patches
+                               addExtensionDependency('sql_patches');
+
+                               // Update notes
+                               setExtensionUpdateNotes("Anmeldewillkommensgutschrift wird nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
+                               break;
+
+                       case '0.5.7': // SQL queries for v0.5.7
+                               // Register a filter
+                               registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'PRE_USER_REGISTRATION_GENERIC', false, true, isExtensionDryRun());
+
+                               // Register points data
+                               registerExtensionPointsData('referral_bonus', 'points', 'LOCKED', 'DIRECT');
+                               registerExtensionPointsData('referral_bonus_ref', 'points', 'LOCKED', 'DIRECT');
+
+                               // Update notes
+                               setExtensionUpdateNotes("Anmeldeformular komplett auf drei Filter umgestrickt (mehr dazu siehe Wiki) und weitere Verwendungszwecke registriert.");
+                               break;
                } // END - switch
                break;