// 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?
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 {
+ // Points shredded!
+ LOAD_TEMPLATE("admin_settings_saved", false, sprintf(ADMIN_POINTS_SHREDDED, $totalPoints));
}
// Remove links from DB