// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
if (isGetRequestParameterSet('mid')) {
// Load email data
- $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `payment_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`, `sender`, `subject`, `url`, `timestamp`, `cat_id`, `payment_id` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('mid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// Load data
- list ($id, $sender, $subject, $url, $timestamp, $payId) = SQL_FETCHROW($result);
- SQL_FREERESULT($result);
+ $content = SQL_FETCHARRAY($result);
// Get points we shall pay back per mail
- $price = getPaymentPoints($payId, 'price');
+ // @TODO Unused: $price = getPaymentPoints($content['payment_id'], 'price');
+ // @TODO Unused: cat_id, payment_id
// Prepare data for the template
- $content['id'] = $id;
- $content['sender'] = generateUserProfileLink($sender);
- $content['subject'] = $subject;
- $content['url'] = generateDerefererUrl($url);
- $content['url_raw'] = $url;
- $content['timestamp'] = generateDateTime($timestamp, 0);
+ $content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Load template
loadTemplate('admin_del_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);
+ sendEmail($sender, '{--MEMBER_ORDER_DELETED--}', $message_user);
// Fetch right stats_id from pool
$result_pool = SQL_QUERY_ESC("SELECT
// Shall we pay the points back to the user?
if ($totalPoints == 0) {
// No points repayed!
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_POINTS_REPAYED'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NO_POINTS_REPAYED--}');
} elseif (getConfig('repay_deleted_mails') != 'SHRED') {
- //* DEBUG: */ outputHtml($stats_id.':'.$totalPoints.'/'.$links.'/'.$price."<br />");
+ //* DEBUG: */ debugOutput($stats_id.':'.$totalPoints.'/'.$links.'/'.$price);
// Shall we payback to user or jackpot?
if (getConfig('repay_deleted_mails') == 'JACKPOT') {
// Set jackpot
} // END - if
// Pay back points
- //* DEBUG: */ outputHtml("PAYBACK:".$sender."<br />");
- addPointsThroughReferalSystem('mail_deleted', $sender, $totalPoints, true, 0, false,'direct');
+ //* DEBUG: */ debugOutput('PAYBACK:'.$sender);
+ addPointsDirectly('mail_deleted', $sender, $totalPoints);
// Output message
if (getConfig('repay_deleted_mails') == 'REPAY') {
outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $cnt));
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NORMAL_MAIL_ALREADY_DELETED'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NORMAL_MAIL_ALREADY_DELETED--}');
}
+
+ // Free result
+ SQL_FREERESULT($result);
} elseif (isGetRequestParameterSet('pid')) {
// Remove stats entries
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_stats` WHERE `pool_id`=%s LIMIT 1",
array(bigintval(getRequestParameter('pid'))), __FILE__, __LINE__);
// Output message
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_USER_STATS_REMOVED'));
+ loadTemplate('admin_settings_saved', false, '{--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
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
loadTemplate('admin_del_email_bonus', false, $content);
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_BONUS_MAIL_ALREADY_DELETED'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
}
// Free result
SQL_FREERESULT($result);
-} elseif ((isGetRequestParameterSet('nid')) && (getExtensionVersion('bonus') >= '0.8.7')) {
+} 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
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
loadTemplate('admin_del_email_notify', false, $content);
} else {
// Mail already deleted!
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NOTIFY_MAIL_ALREADY_DELETED'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_NOTIFY_MAIL_ALREADY_DELETED--}');
}
// Free result
SQL_FREERESULT($result);
} else {
// No mail orders fond
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_WRONG_CALL'));
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_WRONG_CALL--}');
}
-//
+// [EOF]
?>