From eaff7aaabaa92f48bbaf28dbdeaa352dbceb9b9f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 3 Sep 2008 15:35:46 +0000 Subject: [PATCH] Surfbar extended with member notification --- inc/language/surfbar_de.php | 10 ++++++- inc/libs/surfbar_functions.php | 37 ++++++++++++++++++++----- templates/de/emails/order_accept_sb.tpl | 4 +-- 3 files changed, 41 insertions(+), 10 deletions(-) diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 6d71bb1e2e..39416c1422 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -37,7 +37,7 @@ if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) { require($INC); } -// Language definitions +// General admin text define('ADMIN_CONFIG_SURFBAR_TITLE', "Konfiguration der Surfbar"); define('ADMIN_CONFIG_SURFBAR_STATIC_REWARD', "Statische Vergütung in {!POINTS!}:"); define('ADMIN_CONFIG_SURFBAR_STATIC_TIME', "Statische Verweildauer bis nächste Seite geladen wird in Sekunden:"); @@ -51,5 +51,13 @@ define('ADMIN_SURFBAR_NOTIFY_UNLOCK_NO', "Nein, nicht informieren."); define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen für die Surfbar eingestellt.
\nBitte installieren Sie die Erweiterung surfbar neu."); define('ADMIN_SURFBAR_ADD_NEW_REFDEPTH', "Neue Referal-Ebene zur Surfbar hinzufügen"); +// Subject lines for admins +define('ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "URL in Surfbar gebucht"); +define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Mitglied hat URL in Surfbar gebucht"); + +// Subhect lines for members +define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen"); +define('MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Ihre URL in der Surfbar wartet auf Freischaltung"); + // ?> diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 64d5ea0ec7..f00ee9abe9 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -123,13 +123,10 @@ function SURFBAR_REGISTER_URL ($url, $uid, $reward, $status="PENDING", $addMode= $content['insert_id'] = SURFBAR_INSERT_URL_BY_ARRAY($content); // If in reg-mode we notify admin - if ($addMode == "reg") { - // Notify admin of newly added URL in surfbar - SURFBAR_NOTIFY_ADMIN("url_reg", $content); - } elseif ($_CONFIG['surfbar_notify_admin_unlock'] == "Y") { + if (($addMode == "reg") || ($_CONFIG['surfbar_notify_admin_unlock'] == "Y")) { // Notify admin even when he as unlocked an email - SURFBAR_NOTIFY_ADMIN("url_unlock", $content); - } + SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content); + } // END - if // Send mail to user SURFBAR_NOTIFY_USER("url_{$addMode}", $content); @@ -157,7 +154,33 @@ function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) { // Notify admin(s) with a selected message and content function SURFBAR_NOTIFY_ADMIN ($messageType, $content) { // Prepare template name - $template = sprintf("admin_surfbar_%s", $messageType); + $templateName = sprintf("admin_surfbar_%s", $messageType); + + // Prepare subject + $eval = sprintf("\$subject = ADMIN_SURFBAR_NOTIFY_%s_SUBJECT;", + strtoupper($messageType) + ); + eval($eval); + + // Send the notification out + SEND_ADMIN_NOTIFICATION($subject, $templateName, $content, $content['uid']); +} +// Notify the user about the performed action +function SURFBAR_NOTIFY_USER ($messageType, $content) { + // Prepare template name + $templateName = sprintf("admin_surfbar_%s", $messageType); + + // Prepare subject + $eval = sprintf("\$subject = MEMBER_SURFBAR_NOTIFY_%s_SUBJECT;", + strtoupper($messageType) + ); + eval($eval); + + // Load template + $mailText = LOAD_EMAIL_TEMPLATE($templateName, $content); + + // Send the email + SEND_EMAIL($content['uid'], $subject, $mailText); } // ?> diff --git a/templates/de/emails/order_accept_sb.tpl b/templates/de/emails/order_accept_sb.tpl index 7f431b8bd2..a8792904bf 100644 --- a/templates/de/emails/order_accept_sb.tpl +++ b/templates/de/emails/order_accept_sb.tpl @@ -3,9 +3,9 @@ Hallo $salut $surname, $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: $TARGET_URL +Beworbene URL: $DATA[url] ----------------------------- -Betreffzeile: $SUBJECT +Betreffzeile: $DATA[subject] ----------------------------- Sie koennen den Versand-Fortschritt im Mitgliedsmenue unter "Unbestaetigte Mails" verfolgen. Sobald die Mail vollstaendig versendet wurde, erhalten Sie eine weitere Mail! -- 2.39.5