From 950e91ffc2d515dae357d4044294abe301c09b41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 28 Oct 2009 23:25:55 +0000 Subject: [PATCH] Rewrites from to , fixes --- inc/mails/bonus_mails.php | 14 ++++++++++---- inc/modules/admin/what-del_email.php | 6 ++---- inc/modules/admin/what-unlock_emails.php | 16 ++++++++-------- templates/de/emails/order-accept.tpl | 4 ++-- templates/de/emails/order-deleted.tpl | 5 +++-- templates/de/emails/order-reject.tpl | 4 ++-- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index edd37ab917..568a2f0f98 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -98,10 +98,16 @@ if (!empty($sql)) { while ($content = SQL_FETCHARRAY($result_main)) { // Update account SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` -SET bonus_ral_notify='%s', bonus_ral_%s_notify='%s' -WHERE `userid`=%s +SET + `bonus_ral_notify`=UNIX_TIMESTAMP(), + `bonus_ral_%s_notify`=UNIX_TIMESTAMP() +WHERE + `userid`=%s LIMIT 1", - array(time(), $mode, time(), $content['userid']), __FILE__, __LINE__); + array( + $mode, + $content['userid'] + ), __FILE__, __LINE__); // Load email template and send it to the user! if ($sentBonusMails === true) { @@ -109,7 +115,7 @@ LIMIT 1", $UIDs[] = $content['userid']; } else { // Send normal notification mail to the members - $message = loadEmailTemplate('bonus_' . $mode . '_notify', array(), $content['userid']); + $message = loadEmailTemplate('bonus_' . $mode . '_notify', $content, $content['userid']); sendEmail($content['email'], $subject, $message); } } // END - while diff --git a/inc/modules/admin/what-del_email.php b/inc/modules/admin/what-del_email.php index 48ec07db39..b4ede2da86 100644 --- a/inc/modules/admin/what-del_email.php +++ b/inc/modules/admin/what-del_email.php @@ -64,16 +64,14 @@ if (isGetRequestElementSet('mid')) { $content['sender'] = generateUserProfileLink($sender); $content['subject'] = $subject; $content['url'] = generateDerefererUrl($url); + $content['url_raw'] = $url; $content['ordered'] = generateDateTime($timestamp, '0'); // Load template loadTemplate('admin_del_email_normal', false, $content); - // Transfer data to data array - $DATA = array('url' => $url, 'subject' => $subject); - // Load email template and send the email away - $message_user = loadEmailTemplate('order-deleted', array(), $sender); + $message_user = loadEmailTemplate('order-deleted', $content, $sender); sendEmail($sender, getMessage('MEMBER_ORDER_DELETED'), $message_user); // Fetch right stats_id from pool diff --git a/inc/modules/admin/what-unlock_emails.php b/inc/modules/admin/what-unlock_emails.php index 8bdde01352..658d487883 100644 --- a/inc/modules/admin/what-unlock_emails.php +++ b/inc/modules/admin/what-unlock_emails.php @@ -92,7 +92,7 @@ LIMIT 1", // Update wents fine? if (SQL_NUMROWS($result) == 1) { // Load data - $DATA = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Free result SQL_FREERESULT($result); @@ -101,24 +101,24 @@ LIMIT 1", // @TODO Rewrite these if-blocks to a filter if ((isExtensionActive('surfbar')) && (getConfig('surfbar_migrate_order') == 'Y')) { // Then "migrate" the URL to the surfbar - SURFBAR_ADMIN_MIGRATE_URL($DATA['url'], $DATA['sender']); + SURFBAR_ADMIN_MIGRATE_URL($content['url'], $content['sender']); } // END - if // Check for bonus extension version >= 0.4.4 for the order bonus if ((getExtensionVersion('bonus') >= '0.4.4') && (getConfig('bonus_active') == 'Y')) { // Add points directly SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+".getConfig('bonus_order')." WHERE `userid`=%s LIMIT 1", - array(bigintval($DATA['sender'])), __FILE__, __LINE__); + array(bigintval($content['sender'])), __FILE__, __LINE__); // Subtract bonus points from system handleBonusPoints(getConfig('bonus_order')); } // END - if // Load email template - $message_user = loadEmailTemplate('order-accept', array(), $DATA['sender']); + $message_user = loadEmailTemplate('order-accept', $content, $content['sender']); // Send email - sendEmail($DATA['sender'], getMessage('MEMBER_ORDER_ACCEPTED'), $message_user); + sendEmail($content['sender'], getMessage('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", @@ -148,14 +148,14 @@ LIMIT 1", array($id), __FILE__, __LINE__); // Load data - $DATA = SQL_FETCHARRAY($result); + $content = SQL_FETCHARRAY($result); // Free result SQL_FREERESULT($result); // Load email template and send it away - $message_user = loadEmailTemplate('order-reject', array(), $DATA['sender']); - sendEmail($DATA['sender'], getMessage('MEMBER_ORDER_REJECTED'), $message_user); + $message_user = loadEmailTemplate('order-reject', $content, $content['sender']); + sendEmail($content['sender'], getMessage('MEMBER_ORDER_REJECTED'), $message_user); // If you do not enter an URL to redirect to, your URL will be set! if ((!isPostRequestElementSet(('redirect'))) || (postRequestElement('redirect') == 'http://')) setRequestPostElement('redirect', getConfig('URL')); diff --git a/templates/de/emails/order-accept.tpl b/templates/de/emails/order-accept.tpl index b6df7dd488..572e9c78a9 100644 --- a/templates/de/emails/order-accept.tpl +++ b/templates/de/emails/order-accept.tpl @@ -3,9 +3,9 @@ Hallo $content[gender] $content[surname] $content[family], 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: ----------------------------- -Beworbene URL: $DATA[url] +Beworbene URL: $content[url] ----------------------------- -Betreffzeile: $DATA[subject] +Betreffzeile: $content[subject] ----------------------------- Sie koennen den Versand-Fortschritt im Mitgliedsmenue unter "Unbestätigte Mails" verfolgen. Sobald die Mail vollstaendig versendet wurde, erhalten Sie eine weitere Mail! diff --git a/templates/de/emails/order-deleted.tpl b/templates/de/emails/order-deleted.tpl index 1f7a0d9f02..1c2ec0bb2a 100644 --- a/templates/de/emails/order-deleted.tpl +++ b/templates/de/emails/order-deleted.tpl @@ -3,8 +3,9 @@ Hallo $content[gender] $content[surname] $content[family], Einer unserer Administratoren hat soeben Ihre Mailbuchung geloescht. Hier sind nochmals Ihre URL und Betreff Ihrer Mailbuchung: --------------- -Beworbene URL: $DATA[url] -Betreffzeile: $DATA[subject] +Beworbene URL: $content[url_raw] +--------------- +Betreffzeile: $content[subject] --------------- Ihre Mailbuchung wurde somit gelöscht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support. diff --git a/templates/de/emails/order-reject.tpl b/templates/de/emails/order-reject.tpl index 5b159601a8..3b9f65676d 100644 --- a/templates/de/emails/order-reject.tpl +++ b/templates/de/emails/order-reject.tpl @@ -3,9 +3,9 @@ Hallo $content[gender] $content[surname] $content[family], Einer unserer Administratoren hat soeben Ihre Mailbuchung abgelehnt. Bite beachten Sie unsere AGBs! Bei weiteren Verstoessen gegen unsere AGBs werden wir Ihre URL und ggf. auch Ihren Account sperren. Hier sind nochmals Ihre URL und Betreff Ihrer Mailbuchung: ----------------------------- -Beworbene URL: $DATA[url] +Beworbene URL: $content[url] ----------------------------- -Betreffzeile: $DATA[subject] +Betreffzeile: $content[subject] ----------------------------- Ihre Mailbuchung wurde somit gelöscht. Sollten Sie Fragen hierzu haben, so wenden Sie sich bitte an unseren Support. -- 2.30.2