X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-del_email.php;h=a6d57eddf3f7012fd7d9e45ebb197936f534ca54;hb=c28537699175c4cb71a92e720541e9ce1381c8a3;hp=c2d870f324d3b262c9903dc236ddaaaa57d070dc;hpb=6d36252268cb1928efaab3862dfb5df8006ef60a;p=mailer.git
diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php
index c2d870f324..a6d57eddf3 100644
--- a/inc/modules/admin/what-del_email.php
+++ b/inc/modules/admin/what-del_email.php
@@ -8,15 +8,15 @@
* -------------------------------------------------------------------- *
* Short description : Delete a bonus or normal mail *
* -------------------------------------------------------------------- *
- * Kurzbeschreibung : Bonus- / Normal-Mail loeschen *
+ * Kurzbeschreibung : Bonus- / Mitglied-Mail loeschen *
* -------------------------------------------------------------------- *
- * *
- * Module by Robert Niedziela, Megacomputing *
- * web : http://mc-p.mcserver.de *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -38,13 +38,13 @@
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
// Init counter for deleted mails
-$cnt = '0';
+$count = '0';
if (isGetRequestParameterSet('mid')) {
// Load email data
@@ -57,18 +57,18 @@ if (isGetRequestParameterSet('mid')) {
$content = SQL_FETCHARRAY($result);
// Get points we shall pay back per mail
- // @TODO Unused: $price = getPaymentPoints($content['payment_id'], 'price');
+ $content['price'] = getPaymentPoints($content['payment_id'], 'price');
// @TODO Unused: cat_id, payment_id
// Prepare data for the template
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load template
- loadTemplate('admin_del_email_normal', false, $content);
+ loadTemplate('admin_delete_email_normal', false, $content);
// Load email template and send the email away
- $message_user = loadEmailTemplate('order-deleted', $content, $sender);
- sendEmail($sender, getMessage('MEMBER_ORDER_DELETED'), $message_user);
+ $message_user = loadEmailTemplate('order-deleted', $content, $content['sender']);
+ sendEmail($content['sender'], '{--MEMBER_ORDER_DELETED--}', $message_user);
// Fetch right stats_id from pool
$result_pool = SQL_QUERY_ESC("SELECT
@@ -94,48 +94,48 @@ LIMIT 1",
reduceRecipientReceivedMails('stats_id', getRequestParameter('mid'), $links);
// Calc total points and pay them back
- $totalPoints = $links * $price;
+ $totalPoints = $links * $content['price'];
// Shall we pay the points back to the user?
if ($totalPoints == 0) {
// No points repayed!
- loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_POINTS_REPAYED--}');
+ displayMessage('{--ADMIN_NO_POINTS_REPAYED--}');
} elseif (getConfig('repay_deleted_mails') != 'SHRED') {
- //* DEBUG: */ debugOutput($stats_id.':'.$totalPoints.'/'.$links.'/'.$price);
+ //* DEBUG: */ debugOutput($stats_id . ':' . $totalPoints . '/' . $links . '/' . $content['price']);
// Shall we payback to user or jackpot?
if (getConfig('repay_deleted_mails') == 'JACKPOT') {
// Set jackpot
- $sender = '0';
+ $content['sender'] = '0';
} // END - if
// Pay back points
- //* DEBUG: */ debugOutput('PAYBACK:'.$sender);
- addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, 0, false,'direct');
+ //* DEBUG: */ debugOutput('PAYBACK:'.$content['sender']);
+ addPointsDirectly('mail_deleted', $content['sender'], $totalPoints);
// Output message
if (getConfig('repay_deleted_mails') == 'REPAY') {
// Repayed
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_REPAYED',
- translateComma($totalPoints)
+ displayMessage(getMaskedMessage('ADMIN_POINTS_REPAYED',
+ '{%pipe,translateComma=' . $totalPoints . '%}'
));
} else {
// To jackpot
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_TO_JACKPOT',
- translateComma($totalPoints)
+ displayMessage(getMaskedMessage('ADMIN_POINTS_TO_JACKPOT',
+ '{%pipe,translateComma=' . $totalPoints . '%}'
));
}
} else {
// Points shredded!
- loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_POINTS_SHREDDED', translateComma($totalPoints)));
+ displayMessage(getMaskedMessage('ADMIN_POINTS_SHREDDED', '{%pipe,translateComma=' . $totalPoints . '%}'));
}
// Remove links from DB
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s",
array(bigintval($stats_id)), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
// Load template for link
- loadTemplate('admin_settings_saved', false, '{--ADMIN_REMOVE_STATS_ENTRY--}');
+ displayMessage('{--ADMIN_REMOVE_STATS_ENTRY--}');
} // END - if
// Free the result
@@ -144,13 +144,13 @@ LIMIT 1",
// Delete mail from queue
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('mid'))), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
// Output link for manually removing stats entry
- outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $cnt));
+ outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $count));
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, '{--ADMIN_NORMAL_MAIL_ALREADY_DELETED--}');
+ displayMessage('{--ADMIN_NORMAL_MAIL_ALREADY_DELETED--}');
}
// Free result
@@ -161,10 +161,10 @@ LIMIT 1",
array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
// Output message
- loadTemplate('admin_settings_saved', false, '{--ADMIN_USER_STATS_REMOVED--}');
+ displayMessage('{--ADMIN_USER_STATS_REMOVED--}');
} elseif ((isGetRequestParameterSet('bid')) && (isExtensionActive('bonus'))) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s",
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
// Delete mail only once
@@ -176,33 +176,32 @@ LIMIT 1",
reduceRecipientReceivedMails('bonus_id', getRequestParameter('bid'), $content['mails_sent']);
// Init counter for deleted mails
- $cnt = '0';
+ $count = '0';
// Delete bonus mail entirely from database
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
- $content['cnt'] = $cnt;
+ $content['cnt'] = $count;
// Load template
- loadTemplate('admin_del_email_bonus', false, $content);
+ loadTemplate('admin_delete_email_bonus', false, $content);
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
+ displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
}
// Free result
SQL_FREERESULT($result);
} elseif ((isGetRequestParameterSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s",
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
// Delete mail only once
@@ -211,33 +210,32 @@ LIMIT 1",
$content = SQL_FETCHARRAY($result);
// Init counter for deleted mails
- $cnt = '0';
+ $count = '0';
// Delete bonus mail entirely from database
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
- $cnt += SQL_AFFECTEDROWS();
+ $count += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
- $content['cnt'] = $cnt;
+ $content['cnt'] = $count;
// Load template
- loadTemplate('admin_del_email_notify', false, $content);
+ loadTemplate('admin_delete_email_notify', false, $content);
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, '{--ADMIN_NOTIFY_MAIL_ALREADY_DELETED--}');
+ displayMessage('{--ADMIN_NOTIFY_MAIL_ALREADY_DELETED--}');
}
// Free result
SQL_FREERESULT($result);
} else {
// No mail orders fond
- loadTemplate('admin_settings_saved', false, '{--ADMIN_WRONG_CALL--}');
+ displayMessage('{--ADMIN_WRONG_CALL--}');
}
// [EOF]