- //* DEBUG: */ echo "?L:".__LINE__."/".$dummy."/".$key."/".$uid."(".$DATA[1].")/".$DATA[0]."/".$stats_id."?<br />";
- switch (REMOVE_RECEIVER($dummy, $key, bigintval($uid), bigintval($DATA[0]), bigintval($stats_id)))
- {
- case "done":
- // Prepare the mail
- $DATA[11] = bigintval($stats_id);
- $DATA[12] = $sname;
- $DATA[13] = $fname;
- $DATA[14] = TRANSLATE_GENDER($gender);
-
- // Replace text variables
- foreach ($GLOBALS['replacer'] as $key => $value) {
- if (isset($DATA[$key])) $DATA[3] = str_replace($value, $DATA[$key], $DATA[3]);
- } // END - if
-
- // Prepare content
- $content = array(
- 'id' => $DATA[11],
- 'url' => $DATA[7],
- 'sender_uid' => $DATA[1],
- 'category' => GET_CATEGORY($DATA[9]),
- 'time' => CREATE_FANCY_TIME(GET_PAY_POINTS($DATA[5], "time")),
- 'points' => TRANSLATE_COMMA(GET_PAY_POINTS($DATA[5], "payment")),
- 'text' => $DATA[3]
- );
-
- // Load message template
- $mailText = LOAD_EMAIL_TEMPLATE("normal-mail", $content, bigintval($uid));
-
- // Send mail away
- SEND_EMAIL($email, $DATA[2], $mailText, $HTML);
-
- // Count sent mails...
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_sent=emails_sent+1 WHERE userid=%s LIMIT 1",
- array(bigintval($DATA[1])), __FILE__, __LINE__);
-
- if (GET_EXT_VERSION("user") >= "0.1.4") {
- // Update mails received for receiver
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET emails_received=emails_received+1 WHERE userid=%s LIMIT 1",
- array(bigintval($uid)), __FILE__, __LINE__);
- } // END - if
-
- // Update mediadata if version is 0.0.4 or higher
- if (GET_EXT_VERSION("mediadata") >= "0.0.4") {
- // Update entry (or add missing)
- //* DEBUG: */ echo "*MEDIA/L:".__LINE__."*<br />";
- MEDIA_UPDATE_ENTRY(array("total_send", "normal_send"), "add", 1);
- } // END - if
-
- // And count up the mail
- $GLOBALS['pool_cnt']++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."*<br />";
- break;
-
- case "already":
- // Entry already found, but we still count one up!
- $GLOBALS['pool_cnt']++;
- //* DEBUG: */ echo"*EXIT/L:".__LINE__."/".$GLOBALS['pool_cnt']."<br />";
- break;
+ //* DEBUG: */ debugOutput('?L:'.__LINE__.'/'.$dummy.'/'.$key.'/'.$userid.'('.['sender'].')/'.$DATA['id'].'/'.$stats_id.'?');
+ switch (removeReceiver($dummy, $key, bigintval($userid), bigintval($DATA['id']), bigintval($stats_id))) {
+ case 'done':
+ // Prepare the mail
+ $DATA['stats_id'] = bigintval($stats_id);
+
+ // Replace text variables
+ foreach ($GLOBALS['replacer'] as $key => $value) {
+ if (isset($DATA[$key])) $DATA['text'] = str_replace($value, $DATA[$key], $DATA['text']);
+ } // END - if
+
+ // Prepare content
+ $DATA['time'] = getPaymentPoints($DATA['payment_id'], 'time');
+ $DATA['points'] = getPaymentPoints($DATA['payment_id'], 'payment');
+
+ // Load message template
+ $mailText = loadEmailTemplate('normal-mail', $DATA, bigintval($userid));
+
+ // Send mail away
+ sendEmail(getUserData('email'), $DATA['subject'], $mailText, $HTML);
+
+ // Count sent mails...
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET emails_sent=emails_sent+1 WHERE `userid`=%s LIMIT 1",
+ array(bigintval($DATA['sender'])), __FILE__, __LINE__);
+
+ if (isExtensionInstalledAndNewer('user', '0.1.4')) {
+ // Update mails received for receiver
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `emails_received`=`emails_received`+1 WHERE `userid`=%s LIMIT 1",
+ array(bigintval($userid)), __FILE__, __LINE__);
+ } // END - if
+
+ // Update mediadata if version is 0.0.4 or higher
+ if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
+ // Update entry (or add missing)
+ //* DEBUG: */ debugOutput('*MEDIA/L:'.__LINE__.'*');
+ updateMediadataEntry(array('total_send', 'normal_send'), 'add', 1);
+ } // END - if
+
+ // And count up the mail
+ $GLOBALS['pool_cnt']++;
+ //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt'].'*');
+ break;
+
+ case 'already':
+ // Entry already found, but we still count one up!
+ $GLOBALS['pool_cnt']++;
+ //* DEBUG: */ debugOutput('*EXIT/L:'.__LINE__.'/'.$GLOBALS['pool_cnt']);
+ break;