inc/phpmailer/test/phpmailer_test.php svneol=native#text/plain
inc/phpmailer/test/phpunit.php svneol=native#text/plain
inc/phpmailer/test/test.png -text svneol=unset#image/png
+inc/pool-functions.php svneol=native#text/plain
inc/pool-update.php svneol=native#text/plain
inc/pool/.htaccess svneol=native#text/plain
inc/pool/pool- svneol=native#text/plain
./inc/modules/admin/what-bonus.php:46:// @TODO Unused at the moment
./inc/modules/admin/what-config_points.php:90: // @TODO Rewrite these two lines for new user_points columns (e.g. locked_order_points) with a filter
./inc/modules/admin/what-config_register.php:79: // @TODO Move this HTML code into a template
-./inc/modules/admin/what-del_email.php:57: // @TODO Unused: cat_id
+./inc/modules/admin/what-del_email.php:51: // @TODO Unused: cat_id
./inc/modules/admin/what-edit_user.php:18: * @TODO Add support for ext-country *
./inc/modules/admin/what-email_stats.php:46:// @TODO Unused at the moment
./inc/modules/admin/what-extensions.php:366: // @TODO Rewrite this to a filter
./inc/modules/admin/what-mem_add.php:124: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-mem_add.php:63: // @TODO Cant this be rewritten?
./inc/modules/admin/what-mem_add.php:79: // @TODO This can be somehow rewritten to a function
-./inc/modules/admin/what-unlock_emails.php:93: // @TODO Rewrite these if-blocks to a filter
+./inc/modules/admin/what-unlock_emails.php:78: // @TODO Rewrite these if-blocks to a filter
./inc/modules/admin/what-usage.php:89: // @TODO This code is double, see loadTemplate() and loadEmailTemplate() in functions.php
./inc/modules/admin/what-usr_online.php:49: // @TODO Add a filter for sponsor
-./inc/modules/frametester.php:95: // @TODO Rewrite this somehow
+./inc/modules/frametester.php:91: // @TODO Rewrite this somehow
./inc/modules/guest/what-beg.php:51:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
./inc/modules/guest/what-mediadata.php:188:// @TODO Rewrite all these if-blocks to filters
./inc/modules/guest/what-mediadata.php:67: // @TODO Find a better formular than this one
./inc/modules/member/what-rallyes.php:99: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&id=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
./inc/modules/member/what-reflinks.php:52:// @TODO Move this into a filter
./inc/modules/member/what-transfer.php:128: // @TODO Rewrite this to a filter
-./inc/modules/member/what-unconfirmed.php:177: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/modules/member/what-unconfirmed.php:244: // @TODO cat_id is unused
-./inc/modules/member/what-unconfirmed.php:247: // @TODO This 'userid' cannot be saved because of encapsulated EL code
-./inc/modules/order.php:78: // @TODO Unused: 2,4
-./inc/mysql-manager.php:1498: // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1522: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1838: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:2006: // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
-./inc/mysql-manager.php:2129: // @TODO Used generic 'userid' here
-./inc/mysql-manager.php:2350:// @TODO cacheFiles is not yet supported
+./inc/modules/member/what-unconfirmed.php:130: // @TODO This call cannot be saved as EL code cannot be "framed" in other EL code
+./inc/modules/member/what-unconfirmed.php:174: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/modules/member/what-unconfirmed.php:241: // @TODO cat_id is unused
+./inc/modules/member/what-unconfirmed.php:244: // @TODO This 'userid' cannot be saved because of encapsulated EL code
+./inc/modules/order.php:71: // @TODO Unused: timestamp
+./inc/mysql-manager.php:1509: // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1533: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1849: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2017: // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
+./inc/mysql-manager.php:2140: // @TODO Used generic 'userid' here
+./inc/mysql-manager.php:2361:// @TODO cacheFiles is not yet supported
./inc/mysql-manager.php:408: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:44:// @TODO Can we cache this?
+./inc/pool-functions.php:44:// @TODO "Hook" ext-html_mail into this to allow column `html_msg`
./inc/revision-functions.php:168:// @TODO This function does also set and get in 'cache_array'
./inc/template-functions.php:1048: // @TODO <label for="' . $prefix . '_' . $field . '"></<label> not working here
./inc/template-functions.php:1103: // @TODO Deprecate this thing
}
// "Getter" for a network's data by provided id number
-function getNetworkDataById ($networkId, $column = '') {
+function getNetworkDataFromId ($networkId, $column = '') {
// Ids lower one are not accepted
if (!isValidId($networkId)) {
// Not good, should be fixed
}
// "Getter" for all network type data by provided id number
-function getNetworkTypeDataById ($networkId) {
+function getNetworkTypeDataFromId ($networkId) {
// Ids lower one are not accepted
if (!isValidId($networkId)) {
// Not good, should be fixed
}
// "Getter" for a network request parameter data by provided id number
-function getNetworkRequestParamsDataById ($networkRequestId) {
+function getNetworkRequestParamsDataFromId ($networkRequestId) {
// Ids lower one are not accepted
if (!isValidId($networkRequestId)) {
// Not good, should be fixed
}
// "Getter" for a network array translation data by provided id number
-function getNetworkArrayTranslationsDataById ($networkTranslationId) {
+function getNetworkArrayTranslationsDataFromId ($networkTranslationId) {
// Ids lower one are not accepted
if (!isValidId($networkTranslationId)) {
// Not good, should be fixed
*/
function generateMetworkReferralLinkById ($networkId) {
// Simple output (no need for template!)
- $output = '<a href="{%network,getNetworkDataById,network_reflink=' . $networkId . '%}" target="_blank" title="{%network,getNetworkDataById,network_title=' . $networkId . '%}">{%network,getNetworkDataById,network_title=' . $networkId . '%}</a>';
+ $output = '<a href="{%network,getNetworkDataFromId,network_reflink=' . $networkId . '%}" target="_blank" title="{%network,getNetworkDataFromId,network_title=' . $networkId . '%}">{%network,getNetworkDataFromId,network_title=' . $networkId . '%}</a>';
// Return it
return $output;
// Is this selected?
if ($sel == 1) {
// Load this network's data
- $networkData = getNetworkDataById($networkId);
+ $networkData = getNetworkDataFromId($networkId);
// Is there found the network?
if (count($networkData) > 0) {
// Is there selections?
if (ifPostContainsSelections()) {
// Load network data
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Something has been selected, so start displaying one by one
$OUT = '';
$GLOBALS['network_request_params_disabled'] = array();
// Load network data
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Something has been selected, so start displaying one by one
$OUT = '';
// Is this selected?
if ($sel == 1) {
// Load this network's data
- $networkRequestData = getNetworkRequestParamsDataById($networkId);
+ $networkRequestData = getNetworkRequestParamsDataFromId($networkId);
// Is there found the network?
if (count($networkRequestData) > 0) {
$GLOBALS['network_array_translation_disabled'] = array();
// Load network data
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Something has been selected, so start displaying one by one
$OUT = '';
// Is this selected?
if ($sel == 1) {
// Load this network's data
- $networkTranslationsData = getNetworkArrayTranslationsDataById($networkId);
+ $networkTranslationsData = getNetworkArrayTranslationsDataFromId($networkId);
// Is there found the network?
if (count($networkTranslationsData) > 0) {
}
// Load all network type handlers by given network id and extract only network_type_id
- $networkTypes = getArrayFromArrayIndex(getNetworkTypeDataById(postRequestElement('network_id')), 'network_type_id');
+ $networkTypes = getArrayFromArrayIndex(getNetworkTypeDataFromId(postRequestElement('network_id')), 'network_type_id');
// Set generated array
setAjaxReplyContent(encodeJson($networkTypes));
}
// Getter for surfbar_actions table by given id number
-function getSurfbarActionsDataById ($columnName, $id) {
+function getSurfbarActionsDataFromId ($columnName, $id) {
// Is cache set?
if (!isset($GLOBALS[__FUNCTION__][$id][$columnName])) {
// Default is not found
if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
// 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(getRequestElement('id'))), __FILE__, __LINE__);
+ // @TODO Unused: cat_id
+ $content getPoolDataFromId(getRequestElement('id'));
// Delete mail only once
- if (SQL_NUMROWS($result) == 1) {
- // Load data
- // @TODO Unused: cat_id
- $content = SQL_FETCHARRAY($result);
-
+ if (count($content) > 0) {
// Prepare data for the template
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
// Mail already deleted!
displayMessage('{--ADMIN_BONUS_MAIL_ALREADY_DELETED--}');
}
-
- // Free result
- SQL_FREERESULT($result);
} 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",
// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Init type
$networkData['network_type_id'] = 0;
// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
$networkData['network_type_id'] = 0;
// Init disabled list
// Is there a network selected?
if (isGetRequestElementSet('network_id')) {
// Get its data for template
- $networkData = getNetworkDataById(getRequestElement('network_id'));
+ $networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Init disabled list
$GLOBALS['network_types_disabled'] = array();
// Check for mails
$result_main = SQL_QUERY("SELECT
`id`,
- `sender`,
+ `url`,
`subject`,
- `payment_id`,
+ `text`,
+ `sender`,
`timestamp`,
- `url`,
`target_send`,
+ `payment_id`,
`cat_id`
FROM
`{?_MYSQL_PREFIX?}_pool`
// Secure id number
$id = bigintval($id);
- // Order placed in queue...
- $result = SQL_QUERY_ESC('SELECT
- `url`,
- `subject`,
- `sender`,
- `payment_id`
-FROM
- `{?_MYSQL_PREFIX?}_pool`
-WHERE
- `id`=%s
-LIMIT 1',
- array($id), __FILE__, __LINE__);
-
- // Update wents fine?
- if (SQL_NUMROWS($result) == 1) {
- // Load data
- $content = SQL_FETCHARRAY($result);
-
- // Get payment from getter to avoid JOIN
- $content['payment'] = getPaymentData($content['payment_id', 'payment');
+ // Get pool data from given id
+ $content = getPoolDataFromId($id);
+ // Found some data?
+ if (count($content) > 0) {
// Is the surfbar installed?
// @TODO Rewrite these if-blocks to a filter
if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) {
sendEmail($content['sender'], '{--MEMBER_ORDER_ACCEPTED--}', $message_user);
// Unlock selected email
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW' WHERE `id`=%s AND `data_type`='ADMIN' LIMIT 1",
- array($id), __FILE__, __LINE__);
+ updatePoolDataById($id, 'data_type', 'NEW', NULL, " AND `data_type`='ADMIN'");
} // END - if
-
- // Free result
- SQL_FREERESULT($result);
} // END - foreach
// Set message
// Secure id number
$id = bigintval($id);
- // Load URL and subject from pool
- $result = SQL_QUERY_ESC("SELECT `url`, `subject`, `sender` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
- array($id), __FILE__, __LINE__);
-
- // Load data
- $content = SQL_FETCHARRAY($result);
-
- // Free result
- SQL_FREERESULT($result);
+ // Get pool data from given id
+ $content = getPoolDataFromId($id);
// Load email template and send it away
$message_user = loadEmailTemplate('member_order_rejected', $content, $content['sender']);
} // END - if
// Redirect URL
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `url`='%s',`data_type`='NEW' WHERE `id`=%s LIMIT 1",
- array(postRequestElement('redirect'), $id),__FILE__, __LINE__);
+ updatePoolDataById($id, NULL, array('url' => postRequestElement('redirect'), 'data_type' => 'NEW'));
// Prepare data for the row template
$content = array(
// Order number placed, is he also logged in?
if (isMember()) {
// Ok, test passed... :)
- $result = SQL_QUERY_ESC("SELECT `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1",
- array(bigintval(getRequestElement('order')), getMemberId()), __FILE__, __LINE__);
+ $content = getPoolDataFromId(getRequestElement('order'));
// Finally is the entry valid?
- if (SQL_NUMROWS($result) == 1) {
+ if ((count($content) > 0) && ($content['data_type'] == 'TEMP')) {
// Load subject and URL (but forwhat do we need the subject line here???
list($url) = SQL_FETCHROW($result);
// Matching line not found
redirectToUrl('modules.php?module=index&what=login');
}
-
- // Free memory
- SQL_FREERESULT($result);
} else {
// He is no longer logged in
redirectToUrl('modules.php?module=index&what=login');
// Load data
$content = SQL_FETCHARRAY($result_data);
- // Get price/time to avoid one JOIN
- $content['price'] = getPaymentPrice($content['payment_id']);
- $content['time'] = getPaymentData($content['payment_id'], 'time');
-
// Translate some data
$content['timestamp'] = generateDateTime($content['timestamp'], '2');
+ // @TODO This call cannot be saved as EL code cannot be "framed" in other EL code
$content['userid'] = getMemberId();
$content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN=' . $content['id'] . '%}';
$type = 'NEW';
} // END - if
- // Update sending pool
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='%s' WHERE `id`=%s AND `sender`=%s AND `data_type`='TEMP' LIMIT 1",
- array(
- $type,
- bigintval(getRequestElement('order')),
- getMemberId()
- ), __FILE__, __LINE__);
-
- // Finally is the entry valid?
- if (!SQL_HASZEROAFFECTED()) {
- // @TODO Unused: 2,4
- // Load mail again... 0 1 2 3 4 5 6 7
- $result = SQL_QUERY_ESC("SELECT `subject`, `text`, `receivers`, `payment_id`, `timestamp`, `url`, `cat_id`, `target_send` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s AND `sender`=%s LIMIT 1",
- array(
- bigintval(getRequestElement('order')),
- getMemberId()
- ), __FILE__, __LINE__);
-
- // Merge arrays
- $content = merge_array($content, SQL_FETCHARRAY($result));
-
- // Free result
- SQL_FREERESULT($result);
+ // Update pool data and check if the entry is valid
+ if (!updatePoolDataById(getRequestElement('order'), 'data_type', $type, NULL, sprintf(" AND `sender`=%s AND `data_type`='TEMP'", getMemberId()))) {
+ // Merge array with pool data
+ // @TODO Unused: timestamp
+ $content = merge_array($content, getPoolDataFromId(getRequestElement('order'));
// Fix empty subject line
if (empty($content['subject'])) {
'request',
'session',
'code',
+ 'pool',
'language',
'sql',
'expression',
return getPaymentData($paymentsId, 'price');
}
+// Get payment time
+function getPaymentTime ($paymentsId) {
+ // Return result
+ return getPaymentData($paymentsId, 'time');
+}
+
+// Get payment 'payment'
+function getPaymentPayment ($paymentsId) {
+ // Return result
+ return getPaymentData($paymentsId, 'payment');
+}
+
// "Getter" for payment data (cached)
-function getPaymentData ($paymentsId, $lookFor = 'price') {
+function getPaymentData ($paymentsId, $lookFor) {
// Default value...
$data[$lookFor] = NULL;
// Update 'mails_sent' if ext-sql_patches is updated
if (isExtensionInstalledAndNewer('sql_patches', '0.7.4')) {
// Update the pool
- SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `mails_sent`=`mails_sent`+1 WHERE `id`=%s LIMIT 1',
- array(bigintval($poolId)), __FUNCTION__, __LINE__);
+ updatePoolDataById($poolId, 'mails_sent', 1, '+');
} // END - if
$ret = 'done';
} else {
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 01/22/2013 *
+ * =================== Last change: 01/22/2013 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : pool-functions.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Functions for handling status codes *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Funktionen zum Umgang mit Status-Funktionen *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * 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 *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// "Getter" for pool data from given id number
+// @TODO "Hook" ext-html_mail into this to allow column `html_msg`
+function getPoolDataFromId ($poolId) {
+ // Init content array
+ $content = array();
+
+ // Search for pool data
+ $result = SQL_QUERY_ESC('SELECT
+ `id`,
+ `sender`,
+ `subject`,
+ `text`,
+ `receivers`,
+ `payment_id`,
+ `data_type`,
+ `timestamp`,
+ `url`,
+ `target_send`,
+ `cat_id`,
+ `zip`
+FROM
+ `{?_MYSQL_PREFIX?}_pool`
+WHERE
+ `id`=%s
+LIMIT 1',
+ array(bigintval($poolId)), __FUNCTION__, __LINE__);
+
+ // Is there an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load data
+ $content = SQL_FETCHARRAY($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Return found data
+ return $content;
+}
+
+// Update the pool
+function updatePoolDataById ($poolId, $columnName, $data, $updateMode = NULL, $whereSql = '', $moreSql = '') {
+ // Is update mode set?
+ if (!is_null($updateMode)) {
+ // Don't allow array as data here
+ assert(!is_array($data));
+
+ // Then use this on the column with this mode (mostly counters)
+ SQL_QUERY_ESC('UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`=`%s`%s%s WHERE `id`=%s' . $whereSql . ' LIMIT 1',
+ array(
+ $columnName,
+ $columnName,
+ $updateMode,
+ $data,
+ bigintval($poolId)
+ ), __FUNCTION__, __LINE__);
+ } elseif (is_array($data)) {
+ /*
+ * Update multiple columns, $columnName and $updateMode are being
+ * ignored as last doesn't work and first is given in $data array.
+ */
+ $sql = 'UPDATE `{?_MYSQL_PREFIX?}_pool` SET ';
+ foreach ($data as $key => $value) {
+ // Add it
+ $sql .= sprintf("`%s`='%s',", SQL_ESCAPE($key), SQL_ESCAPE($value));
+ } // END - foreach
+
+ // Finish SQL
+ $sql = substr($sql, 0, -1) . $moreSql . ' WHERE `id`=' . bigintval($id) . $whereSql . ' LIMIT 1';
+
+ // And finally run it
+ SQL_QUERY($sql, __FUNCTION__, __LINE__);
+ } else {
+ // Regular update
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `%s`='%s' WHERE `id`=%s" . $whereSql . ' LIMIT 1',
+ array(
+ $columnName,
+ $data,
+ bigintval($poolId)
+ ), __FUNCTION__, __LINE__);
+ }
+
+ // Return if it has an affected row
+ return (SQL_AFFECTEDROWS() == 1);
+}
+
+// [EOF]
+?>
`url`,
`target_send`,
`cat_id`
- ".$HTML."
+ " . $HTML . "
FROM
`{?_MYSQL_PREFIX?}_pool`
WHERE
// Parse all mails
while ($mailData = SQL_FETCHARRAY($result_main)) {
// Set mail order as 'active'. That means it will be sent out
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='ACTIVE' WHERE `id`=%s AND `data_type`='NEW' LIMIT 1",
- array($mailData['id']), __FILE__, __LINE__);
+ updatePoolDataById($mailData['id'], 'data_type', 'ACTIVE', NULL, " AND `data_type`='NEW'");
// Check fetched data for HTML
$isHtml = 'N';
- if (isset($mailData['html_msg'])) $isHtml = $mailData['html_msg'];
+ if (isset($mailData['html_msg'])) {
+ $isHtml = $mailData['html_msg'];
+ } // END - if
// Entry updated?
if (!SQL_HASZEROAFFECTED()) {
// Prepare the mail
$mailData['stats_id'] = bigintval($stats_id);
- // Prepare content
- $mailData['time'] = getPaymentData($mailData['payment_id'], 'time');
- $mailData['points'] = getPaymentData($mailData['payment_id'], 'payment');
-
// Load message template
$mailText = loadEmailTemplate('member_user_pool_normal', $mailData, bigintval($userid));
'cat_id' => $mailData['cat_id'],
'text' => $mailData['text'],
'url' => $mailData['url'],
- 'expiration' => '{%pipe,createFancyTime=' . getPaymentData($mailData['payment_id'], 'time') . '%}'
+ 'expiration' => '{%pipe,getPaymentTime,createFancyTime=' . $mailData['payment_id'] . '%}'
);
// Yes we do, so we notify admin and sender about fully sent mail!
} // END - if
// Set status to SEND because we completely send it away
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='SEND',`target_send`=0,`receivers`='' WHERE `id`=%s LIMIT 1",
- array(bigintval($mailData['id'])), __FILE__, __LINE__);
+ updatePoolDataById($mailData['id'], NULL, array('data_type' => 'SEND', 'target_send' => '0', 'receivers' => '');
// Update send-completed-time
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `timestamp_send`=UNIX_TIMESTAMP() WHERE `pool_id`=%s LIMIT 1",
elseif (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || ($count2 >= getConfig('max_send'))) {
// There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
$add = '';
- if ($GLOBALS['pool_cnt'] <= $mailData['target_send']) $add = ", target_send=target_send-".$GLOBALS['pool_cnt'];
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='NEW', receivers='%s'" . $add . " WHERE `id`=%s LIMIT 1",
- array(
- implode(';', $temporaryReceivers),
- bigintval($mailData['id'])
- ), __FILE__, __LINE__);
+ if ($GLOBALS['pool_cnt'] <= $mailData['target_send']) $add = ',`target_send`=`target_send`-' . $GLOBALS['pool_cnt'];
+ updatePoolDataById($mailData['id'], NULL, array('data_type' => 'NEW', 'receivers' => implode(';', $temporaryReceivers)), NULL, '', $add);
//* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'*');
break;
// User does not exists so we have add the sender's points back to sender's account
if (($receivers['id'] == '0') || (empty($receivers['id']))) {
// List was empty
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='SEND' WHERE `id`=%s LIMIT 1",
- array(bigintval($mailData['id'])), __FILE__, __LINE__);
+ updatePoolDataById($mailData['id'], 'data_type', 'SEND');
} else {
// Is the userid set?
if (isValidId($userid)) {
// User does not exists, pay points back
- $points = getPaymentPrice($mailData['payment_id']);
initReferralSystem();
- addPointsThroughReferralSystem('pool_payback', $mailData['sender_userid'], $points);
+ addPointsThroughReferralSystem('pool_payback', $mailData['sender_userid'], getPaymentPrice($mailData['payment_id']));
// Add points together and remove user
- $pointsBack[$mailData['sender_userid']] += $points;
+ $pointsBack[$mailData['sender_userid']] += getPaymentPrice($mailData['payment_id']);
} // END - if
// Count up
unset($temporaryReceivers[$key]);
// Update receivers
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `receivers`='%s' WHERE `id`=%s LIMIT 1",
- array(implode(';', $temporaryReceivers), bigintval($mailData['id'])), __FILE__, __LINE__);
+ updatePoolData($mailData['id'], 'receivers', implode(';', $temporaryReceivers));
}
} // END - foreach
} // END - if
array(bigintval($content['id'])), __FILE__, __LINE__, FALSE));
// Update status of order
- addSql(SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_pool` SET `data_type`='DELETED' WHERE `id`=%s LIMIT 1",
- array(bigintval($content['pool_id'])), __FILE__, __LINE__, FALSE));
+ updatePoolDataById($content['pool_id'], 'data_type', 'DELETED');
} // END - if
// Free memory
// Entry found?
if (SQL_NUMROWS($result) == 1) {
$data = merge_array($data, SQL_FETCHARRAY($result));
- $data['time'] = getPaymentData($data['payment_id'], 'time');
- $data['payment'] = getPaymentData($data['payment_id'], 'payment');
+ $data['time'] = getPaymentTime($data['payment_id']);
+ $data['payment'] = getPaymentPayment($data['payment_id']);
$isValid = TRUE;
} // END - if
break;
case 'BONUS':
- $result = SQL_QUERY_ESC("SELECT `time`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `time`, `points` AS `payment` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval($data['pool_id'])), __FILE__, __LINE__);
// Entry found?
Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%},
-Einer unserer Administratoren hat soeben Ihre Mailbuchung freigegeben. Sie wird von unserem System automatisch versendet! Bitte beachten Sie, dass dies ggf. zeitversetzt zu dieser Mail versendet wird. Hier sind nochmals URL und Betreff Ihrer Mailbuchung:
+Einer unserer Administratoren hat soeben Ihre Mailbuchung freigegeben. Sie wird von unserem System automatisch versendet! Bitte beachten Sie, dass dies ggf. zeitversetzt zu dieser Mail versendet wird.
+Hier sind nochmals alle Daten Ihrer Mailbuchung:
-----------------------------
Beworbene URL: $content[url]
-----------------------------
Betreffzeile: $content[subject]
-----------------------------
+Vergütung: {%pipe,getPaymentPayment,translateComma=$content[payment_id]%} {?POINTS?}
+-----------------------------
+Wartezeit: {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
+-----------------------------
+Beworbene Kategorie: {%pipe,getCategory=$content[cat_id]%}
+-----------------------------
+Werbetext:
+$content[text]
+-----------------------------
Sie können den Versand-Fortschritt im Mitgliedsmenü unter "Unbestätigte Mails" verfolgen. Sobald die Mail vollständig versendet wurde, erhalten Sie eine weitere Mail!
Einer unserer Administratoren hat soeben Ihre Mailbuchung gelöscht. Hier sind nochmals Ihre URL und Betreff Ihrer Mailbuchung:
----------------
+-----------------------------
Beworbene URL: $content[url]
----------------
+-----------------------------
Betreffzeile: $content[subject]
----------------
+-----------------------------
+Vergütung: {%pipe,getPaymentPayment,translateComma=$content[payment_id]%} {?POINTS?}
+-----------------------------
+Wartezeit: {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
+-----------------------------
+Beworbene Kategorie: {%pipe,getCategory=$content[cat_id]%}
+-----------------------------
+Werbetext:
+$content[text]
+-----------------------------
Ihre Mailbuchung wurde somit gelöscht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support.
Hier sind nochmals Ihre Daten aus dem Buchungsformular:
------------------------------------------------
Gebuchte Kategorie: {%pipe,getCategory=$content[cat_id]%}
+------------------------------------------------
Gebuchter Payment-Typ: {%pipe,getPaymentTitlePrice=$content[payment_id]%}
+------------------------------------------------
Betreffzeile in den Mails: $content[subject]
+------------------------------------------------
Gebuchte URL: $content[url]
+------------------------------------------------
Bezahlte {?POINTS?}: $content[payed_points]
------------------------------------------------
-----------------------------
Betreffzeile: $content[subject]
-----------------------------
+Vergütung: {%pipe,getPaymentPayment,translateComma=$content[payment_id]%} {?POINTS?}
+-----------------------------
+Wartezeit: {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
+-----------------------------
+Beworbene Kategorie: {%pipe,getCategory=$content[cat_id]%}
+-----------------------------
+Werbetext:
+$content[text]
+-----------------------------
Ihre Mailbuchung wurde somit gelöscht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support.
----------------
Werber: $content[sender_userid]
----------------
-Vergütung: {%pipe,translateComma=$content[points]%} {?POINTS?}
+Vergütung: {%pipe,getPaymentPayment,translateComma=$content[payment_id]%} {?POINTS?}
----------------
Verfallszeit: $content[expiration]
----------------
Beworbene Kategorie: {%pipe,getCategory=$content[cat_id]%}
----------------
-Wartezeit: {%pipe,createFancyTime=$content[time]%}
+Wartezeit: {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
----------------
Beworbene URL: $content[url]
----------------
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
<tr>
<td align="center" class="switch_sw2 bottom right">{--EMAIL_TIME--}:</td>
<td align="center" class="switch_sw2 bottom">
- {%pipe,createFancyTime=$content[time]%}
+ {%pipe,getPaymentTime,createFancyTime=$content[payment_id]%}
</td>
</tr>
<tr>
{%form,formMethodGet=modules.php%}
<input type="hidden" name="module" value="{%pipe,getModule%}" />
<input type="hidden" name="what" value="{%pipe,getWhat%}" />
-<input type="hidden" name="network_id" value="{%network,getNetworkDataById,network_id=%network_id%%}" />
+<input type="hidden" name="network_id" value="{%network,getNetworkDataFromId,network_id=%network_id%%}" />
<div class="table dashed">
<div class="table_header bottom">
<div>