* $Author:: $ *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
// Init counter for deleted mails
$count = '0';
-if (isGetRequestParameterSet('mid')) {
+if (isGetRequestElementSet('mid')) {
// Load email data
$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__);
+ array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
$content = SQL_FETCHARRAY($result);
// Get points we shall pay back per mail
- $content['price'] = getPaymentPoints($content['payment_id'], 'price');
+ $content['price'] = getPaymentData($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_delete_email_normal', false, $content);
+ loadTemplate('admin_delete_email_normal', FALSE, $content);
// Load email template and send the email away
$message_user = loadEmailTemplate('member_order_deleted', $content, $content['sender']);
WHERE
s.`pool_id`=%s
LIMIT 1",
- array(bigintval(getRequestParameter('mid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
if (SQL_NUMROWS($result_pool) == 1) {
// Fetch stats id
list($stats_id) = SQL_FETCHROW($result_pool);
// Get all user links
- $links = countSumTotalData($stats_id, 'user_links', 'userid', 'stats_id', true);
+ $links = countSumTotalData($stats_id, 'user_links', 'userid', 'stats_id', TRUE);
// Reset sent mails for recipient(s)
- reduceRecipientReceivedMails('stats_id', getRequestParameter('mid'), $links);
+ reduceRecipientReceivedMails('stats_id', getRequestElement('mid'), $links);
// Calc total points and pay them back
$totalPoints = $links * $content['price'];
} // END - if
// Pay back points
- addPointsThroughReferalSystem('mail_deleted', $content['sender'], $totalPoints);
+ initReferralSystem();
+ addPointsThroughReferralSystem('mail_deleted', $content['sender'], $totalPoints);
// Output message
if (getConfig('repay_deleted_mails') == 'REPAY') {
$count += SQL_AFFECTEDROWS();
// Load template for link
- displayMessage('<a href="{%url=modules.php?module=admin&what=del_email&pid=' . bigintval(getRequestParameter('mid')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
+ displayMessage('<a href="{%url=modules.php?module=admin&what=del_email&pid=' . bigintval(getRequestElement('mid')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
} // END - if
// Free the result
// 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__);
+ array(bigintval(getRequestElement('mid'))), __FILE__, __LINE__);
$count += SQL_AFFECTEDROWS();
// Output link for manually removing stats entry
// Free result
SQL_FREERESULT($result);
-} elseif (isGetRequestParameterSet('pid')) {
+} elseif (isGetRequestElementSet('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__);
+ array(bigintval(getRequestElement('pid'))), __FILE__, __LINE__);
// Output message
displayMessage('{--ADMIN_USER_STATS_REMOVED--}');
-} elseif ((isGetRequestParameterSet('bid')) && (isExtensionActive('bonus'))) {
+} elseif ((isGetRequestElementSet('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 LIMIT 1",
- array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
$content = SQL_FETCHARRAY($result);
// Reset sent mails for recipient(s)
- reduceRecipientReceivedMails('bonus_id', getRequestParameter('bid'), $content['mails_sent']);
+ reduceRecipientReceivedMails('bonus_id', getRequestElement('bid'), $content['mails_sent']);
// Init counter for deleted mails
$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__);
+ array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
$count += SQL_AFFECTEDROWS();
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
- array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('bid'))), __FILE__, __LINE__);
$count += SQL_AFFECTEDROWS();
// Prepare data for the template
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_email_bonus', false, $content);
+ loadTemplate('admin_delete_email_bonus', FALSE, $content);
} else {
// Mail already deleted!
displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
// Free result
SQL_FREERESULT($result);
-} elseif ((isGetRequestParameterSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
+} elseif ((isGetRequestElementSet('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 LIMIT 1",
- array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('nid'))), __FILE__, __LINE__);
// Delete mail only once
if (SQL_NUMROWS($result) == 1) {
// 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__);
+ array(bigintval(getRequestElement('nid'))), __FILE__, __LINE__);
$count += SQL_AFFECTEDROWS();
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
- array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
+ array(bigintval(getRequestElement('nid'))), __FILE__, __LINE__);
$count += SQL_AFFECTEDROWS();
// Prepare data for the template
$content['count'] = $count;
// Load template
- loadTemplate('admin_delete_email_notify', false, $content);
+ loadTemplate('admin_delete_email_notify', FALSE, $content);
} else {
// Mail already deleted!
displayMessage('{--ADMIN_NOTIFY_MAIL_ALREADY_DELETED--}');