Getting total/own points rewritten to filter:
[mailer.git] / inc / extensions / ext-user.php
index d59ca08dc01ff27675d437e224807a8523f64cb3..0bcac1b6b73a53666a3d578699df06e74de59175 100644 (file)
@@ -41,10 +41,10 @@ if (!defined('__SECURITY')) {
 } // END - if
 
 // Version number
-setThisExtensionVersion('0.3.8');
+setThisExtensionVersion('0.3.9');
 
 // 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.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'));
+setExtensionVersionHistory(array('0.0.0', '0.1.0', '0.1.1', '0.1.2', '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'));
 
 // Keep this extension always active!
 setExtensionAlwaysActive('Y');
@@ -181,6 +181,10 @@ INDEX (`stats_type`)
                addDropTableSql('user_stats');
                addDropTableSql('user_stats_data');
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
+
+               // Register new filters for gathering points
+               unregisterFilter(__FUNCTION__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun());
+               unregisterFilter(__FUNCTION__, __LINE__, 'get_own_points', 'USER_POINTS', true, isExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -421,11 +425,17 @@ PRIMARY KEY (`id`)
                                break;
 
                        case '0.3.8': // SQL queries for v0.3.8
-                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000');
-                               addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_points` ADD `locked_order_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000');
+                               // Update notes (these will be set as task text!)
+                               setExtensionUpdateNotes("Update verschoben nach ext-order (da es Werbeguthaben ist und nichts mit dem Mitglied selbst zu tun hat).");
+                               break;
+
+                       case '0.3.9': // SQL queries for v0.3.9
+                               // Register new filters for gathering points
+                               registerFilter(__FUNCTION__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun());
+                               registerFilter(__FUNCTION__, __LINE__, 'get_own_points', 'USER_POINTS', true, isExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes("Weiteres {?POINTS?}-Guthabenkonto "Werbeguthaben" hinzugefügt.");
+                               setExtensionUpdateNotes("Filter registriert, die das eigene {?POINTS?}-Guthaben des Mitgliedes zurückliefern.");
                                break;
                } // END - switch
                break;