Final fixes for deleting emails and shredding points
authorRoland Häder <roland@mxchange.org>
Sun, 18 May 2008 19:20:21 +0000 (19:20 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 18 May 2008 19:20:21 +0000 (19:20 +0000)
inc/language/de.php
inc/modules/admin/what-del_email.php

index 077fcb6edd3aec12c3523c8c87fd2627eae50732..860316e7bf7cdd89e7cdc6e2ad70b00e6b9ad816 100644 (file)
@@ -1106,7 +1106,9 @@ define('REASON_DIRECT_PAYMENT', "Direkte Gutschrift (siehe evtl. vorangegangene
 define('SUBJECT_DIRECT_PAYMENT', "Direkte {!POINTS!}-Gutschrift durch das System");
 define('ADMIN_LOGOUT_SQL_PATCHES_DONE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung <strong>sql_patches</strong> installiert haben und dabei das Passort-Hashing ge&auml;ndert/verbessert wurde. Bitte erneut einloggen!");
 define('ADMIN_POINTS_REPAYED', "Es wurden dem Mitglied <u>%s</u> {!POINTS!} zur&uuml;ckgeschrieben.");
 define('SUBJECT_DIRECT_PAYMENT', "Direkte {!POINTS!}-Gutschrift durch das System");
 define('ADMIN_LOGOUT_SQL_PATCHES_DONE', "Sie wurden automatisch ausgeloggt, da Sie die Erweiterung <strong>sql_patches</strong> installiert haben und dabei das Passort-Hashing ge&auml;ndert/verbessert wurde. Bitte erneut einloggen!");
 define('ADMIN_POINTS_REPAYED', "Es wurden dem Mitglied <u>%s</u> {!POINTS!} zur&uuml;ckgeschrieben.");
+define('ADMIN_POINTS_TO_JACKPOT', "Es wurden <u>%s</u> {!POINTS!} in den Jackpot gelegt.");
 define('ADMIN_NO_POINTS_REPAYED', "Die Mailbuchung hatte keine {!POINTS!} zum zur&uuml;ckbuchen!");
 define('ADMIN_NO_POINTS_REPAYED', "Die Mailbuchung hatte keine {!POINTS!} zum zur&uuml;ckbuchen!");
+define('ADMIN_POINTS_SHREDDED', "Es wurden <u>%s</u> {!POINTS!} geschrettert.");
 define('EXTENSION_WARNING_EXT_INACTIVE', "Die Erweiterung <u>%s</u> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
 define('EXTENSION_WARNING_USER_LIMIT', "Die Erweiterung <u>user</u> ist nicht aktiv. Die Anzahl User pro Seite wurde auf 100 gesetzt. Bitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
 
 define('EXTENSION_WARNING_EXT_INACTIVE', "Die Erweiterung <u>%s</u> ist nicht aktiv. Dies kann zu St&ouml;rungen f&uuml;hren.<br />\nBitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
 define('EXTENSION_WARNING_USER_LIMIT', "Die Erweiterung <u>user</u> ist nicht aktiv. Die Anzahl User pro Seite wurde auf 100 gesetzt. Bitte aktivieren Sie diese unter <em>Verschiedenes-&gt;Erweiterungen</em>.");
 
index 635b6443e9a8399d987dfd9579420f75d676ad7f..19816688b55a6ebabdb094889ef16a3bc938914f 100644 (file)
@@ -91,20 +91,21 @@ WHERE s.pool_id=%d LIMIT 1",
                        // Free the result
                        SQL_FREERESULT($result);
 
                        // Free the result
                        SQL_FREERESULT($result);
 
-                       // Shall we pay the points back to the user?
-                       if ($_CONFIG['repay_deleted_mails'] != "NEVER") {
-                               // Get all user links
-                               $result = SQL_QUERY_ESC("SELECT COUNT(id) AS 'cnt' FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d",
-                                       array(bigintval($stats_id)), __FILE__, __LINE__);
+                       // Get all user links
+                       $result = SQL_QUERY_ESC("SELECT COUNT(id) AS 'cnt' FROM "._MYSQL_PREFIX."_user_links WHERE stats_id=%d",
+                               array(bigintval($stats_id)), __FILE__, __LINE__);
+
+                       // Get unconfirmed links for calculation of total points
+                       list($links) = SQL_FETCHROW($result);
 
 
-                               // Get unconfirmed links for calculation of total points
-                               list($links) = SQL_FETCHROW($result);
+                       // Free result
+                       SQL_FREERESULT($result);
 
 
-                               // Free result
-                               SQL_FREERESULT($result);
+                       // Calc total points and pay them back
+                       $totalPoints = $links * $price;
 
 
-                               // Calc total points and pay them back
-                               $totalPoints = $links * $price;
+                       // Shall we pay the points back to the user?
+                       if ($_CONFIG['repay_deleted_mails'] != 'SHRED') {
                                //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
                                if ($totalPoints > 0) {
                                        // Shall we payback to user or jackpot?
                                //* DEBUG: */ echo $stats_id.":".$totalPoints."/".$links."/".$price."<br />\n";
                                if ($totalPoints > 0) {
                                        // Shall we payback to user or jackpot?
@@ -118,13 +119,24 @@ WHERE s.pool_id=%d LIMIT 1",
                                        ADD_POINTS_REFSYSTEM($sender, $totalPoints, true, "0", false,"direct");
 
                                        // Output message
                                        ADD_POINTS_REFSYSTEM($sender, $totalPoints, true, "0", false,"direct");
 
                                        // Output message
-                                       LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_REPAYED,
-                                               number_format($totalPoints, 0, ",", ".")
-                                       ));
+                                       if ($_CONFIG['repay_deleted_mails'] == 'REPAY') {
+                                               // Repayed
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_REPAYED,
+                                                       number_format($totalPoints, 0, ",", ".")
+                                               ));
+                                       } else {
+                                               // To jackpot
+                                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_TO_JACKPOT,
+                                                       number_format($totalPoints, 0, ",", ".")
+                                               ));
+                                       }
                                } else {
                                        // No points repayed!
                                        LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_POINTS_REPAYED);
                                }
                                } else {
                                        // No points repayed!
                                        LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NO_POINTS_REPAYED);
                                }
+                       } else {
+                               // Points shredded!
+                               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_SHREDDED, $totalPoints));
                        }
 
                        // Remove links from DB
                        }
 
                        // Remove links from DB